Installshield 2020 Installscript install
Getting the below error trying to install a service with ServiceAddService.
What is Line 426 looking for? Can I get access to service.rul to look at the code?
Just as information.
From the product and license center there is the installation package "InstallShield 2020 InstallScript Objects" available (InstallShieldInstallScriptObjects.exe).
If you install this package, then you can add the InstallScript object "NT Services" to your InstallScript project. With this object it is very easy to define your program as service. Just add the object to your feature and go through the wizard ...
For standard cases you do not need any additional InstallScript code ...
Ok I found it and downloaded it. I'm setting it up now. One question. The setup is asking for the Domain\User Name and Password. We send those into the install as parameters can this be done?
Sure, use the default settings at step 7 "Local system account" and modify later. To modify later in the setup, you can also use the properties of the NT service object, see the help file ...
prototype SetUserForNT_Service(STRING, STRING)
/* Function definition: */ function SetUserForNT_Service(szUser, szPwd) OBJECT oObject; begin try set oObject = GetObject("My NT Service"); if (!IsObject(oObject)) then MessageBox( "Failed to get object reference.", INFORMATION ); abort; endif; oObject.DomainUserName = szUser;
oObject.Password = szPwd; catch Sprintf( szStatus, "Unexpected Exception\n\nNumber: 0X%X\nDescription:" + "%s\nSource: %s\nHelp File: %s\nHelp Context: %d", Err.Number, Err.Description, Err.Source, Err.HelpFile, Err.HelpContext); MessageBox( szStatus, SEVERE ); abort; endcatch; end;
This is just a modified sample from NT Services object help, not tested !!