cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
LCShankle
Level 2

Installed Service Difference

I have upgraded (by rewriting, not converting) my InstallShield project now using InstallShield 2019 R3. I am using an InstallScript type of project. I am installing a service (among other executables, etc.). Previously the service would install and respond as expected. With this version of InstallShield the installed service seems to start slowly (or some other unknown difference in the service startup causing issues), and more obviously taking a long time to stop - up to 35 seconds where previously it took only a couple of seconds. Copying the service executable into installed directory using the previous installer works as expected. Copying the previous version of the service executable into the newly installed directory exhibits the new problems, so I have eliminated the service executable.

I am using SC command to control the service. The return code of each of the commands shows success (the installation is installed and "appears" to be installed correctly.  Restarting the service through the Services console does not fix the situation. When installing, I am using the following (with name changes, simplification of text):

szCmdLine = "create myService type= own type= interact start= auto " +
            "displayname= \"myServer\" " +
            "binpath= \"" + TARGETDIR ^ "Controls\\myService.exe\" ";
nResult = LaunchAppAndWait (szProgram, szCmdLine,
    LAAW_OPTION_WAIT | LAAW_OPTION_SHOW_HOURGLASS | LAAW_OPTION_HIDDEN);

szProgram = "SC.exe";
szCmdLine = "description myService" + "MyService, provides enhanced processing. Version " + IFX_PRODUCT_VERSION + ".\"";
nResult = LaunchAppAndWait (szProgram, szCmdLine,
    LAAW_OPTION_WAIT | LAAW_OPTION_SHOW_HOURGLASS | LAAW_OPTION_HIDDEN);
szProgram = "SC.exe";
szCmdLine = "start myService";
nResult = LaunchAppAndWait (szProgram, szCmdLine,
    LAAW_OPTION_WAIT | LAAW_OPTION_SHOW_HOURGLASS | LAAW_OPTION_HIDDEN);

Any thoughts as to what might be causing my issue? Thanks!

Labels (1)
0 Kudos
(3) Replies
ch_eng2
Level 6

Hello.  Would you consider using the InstallScript function ServiceAddService?
https://docs.flexera.com/installshield19helplib/Subsystems/installshield19langref/helplibrary/ServiceAddService.htm

As an example, this is how we install services and then modify them after the fact (for options not available in ServiceAddService):

ServiceAddService( strServiceName,
                   strServiceDisplayName,
                   strServiceDescription,
                   "\"" + szPath ^ strFilename + "\"",
                   TRUE,
                   ""
                   );
// configure services to restart on failure and stop errors (failureflag)
LaunchAppAndWait( WINSYSDIR ^ "cmd.exe", "/c sc failure " + strServiceName + " reset= 0 actions= restart/60000/restart/60000/restart/60000&sc failureflag " + strServiceName + " 1", WAIT | LAAW_OPTION_HIDDEN );

HTH

0 Kudos

I have modified my code to match what was shown here (it is cleaner than using SC directly). However, the problem still persists. Are there any installation settings I should look at? I do have dependencies required for other items in my software. I removed those items (the service does not require them), but things still do not work as expected. I am installing 32 bit software on my 64 bit system (wondering if there might be something that InstallShield is assuming there).

Thank you
Louis

________________________________

Hi LCShankle,

ch_eng2 posted a new reply in InstallShield Forum on Aug 06, 2020 07:04 AM:

________________________________
Re: Installed Service Difference

Hello. Would you consider using the InstallScript function ServiceAddService?
https://docs.flexera.com/installshield19helplib/Subsystems/installshield19langref/helplibrary/ServiceAddService.htm

As an example, this is how we install services and then modify them after the fact (for options not available in ServiceAddService):

ServiceAddService( strServiceName,
strServiceDisplayName,
strServiceDescription,
"\"" + szPath ^ strFilename + "\"",
TRUE,
""
);
// configure services to restart on failure and stop errors (failureflag)
LaunchAppAndWait( WINSYSDIR ^ "cmd.exe", "/c sc failure " + strServiceName + " reset= 0 actions= restart/60000/restart/60000/restart/60000&sc failureflag " + strServiceName + " 1", WAIT | LAAW_OPTION_HIDDEN );
0 Kudos

The only other thing I could think of would be to ensure the TARGETDIR is defaulting to the 32bit location and/or your Components are set to 64-bit Component: "No".  Additionally, we are still using InstallShield 2019 R2 so I don't know if that would have an effect.  Sorry, but that's all I know!

HTH

0 Kudos