SSchiessle93
Flexera beginner

Installshield 2020 Installscript install

Getting the below error trying to install a service with ServiceAddService.

AddServiceError.png

What is Line 426 looking for?  Can I get access to service.rul to look at the code?

Labels (1)
0 Kudos
8 Replies
MarkusLatz
Frequent contributor

Check line 426 in your installscript source "Service.rul".

Check the existence of your service exe file before you call ServiceAddService.

regards

Markus

0 Kudos

I can't find service.rul on my machine anywhere.  But I will try checking for the file first. 

0 Kudos

Also this is an installscript project not an MSI. Not sure I said that.
0 Kudos

That's what I'm assumed, because in a basic msi project "add a service" is "built-in functionality"

Do you use the installscript object "NT Services" ?

regards

Markus

0 Kudos

No I don't.  I don't see it in the list of objects in my IS.  

0 Kudos

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 ...

IsNtServiceObject.jpg

For standard cases you do not need any additional InstallScript code ...

regards

Markus

0 Kudos

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?

0 Kudos

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 !!

regards

Markus

0 Kudos