- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Installed Service Difference
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
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 );
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
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