Jump to content

This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.

How to install NT service in Install Shield

5 replies to this topic


  • Members
  • 11 posts

Posted 08 April 2004 - 12:14

Hi! I'm currently having a problem installing the NT services using the Install Shield method. I don't understand the parameters to be used and it turns out that my installation fails. Currently, i'm using LaunchAppAndWait() in installing the NT services. However, it fails to install the service sometimes. Here is the code i'm currently using:

LaunchAppAndWait(WINDOWSDIR^"instsrv, TARGETDIR^"zerospam.exe" -d TARGETDIR^"\conf\\", LAAW_IPTION_HIDDEN);

Can someone help me use the install shield method for installing and uninstalling NT services using the commandline parameter I'm using??? I really need to do this... please help me.

Thanks and I hope someone can help me with my problem.



  • Members
  • 134 posts

Posted 08 April 2004 - 15:51

Just some quick things:

I'm guessing you didn't copy and paste because the option should be LAAW_OPTION_HIDDEN

Also the TARGETDIR^"\conf\\" either has one too many slashes or one too few (in the fron of conf)

I personally just use the -service switch and never have had any problems
ie. LaunchAppAndWait(TARGETDIR^"SwitchServer3.exe", " -service", WAIT);

There is great chaos under heaven, and the situation is excellent. (Mao Tse Tung)

Stefan Krueger

Stefan Krueger


  • Administrators
  • 13,269 posts

Posted 10 April 2004 - 18:02

Also there's a quote sign missing in
and it should be WINDOR not WINDOWSDIR.

Without your actual code and more details about the error message it's hard to figure out what's going wrong.

Have you tried the NT Service Object that comes with InstallShield, or one of the NT Service sample scripts here on InstallSite?


  • Members
  • 11 posts

Posted 11 April 2004 - 10:43

nope! I haven't tried using the sample code in the install site since most of the code are from C++ and the others are hard to understand and complicated. I'm sorry for the typo graphical error and thanks for the correction. I have tried using the install shield method ServiceAddService(). Below are my codes:

szServicePathFile = TARGETDIR^"zerospam.exe" + " -d \"" + TARGETDIR^"\\conf\\"";

ServiceAddService ("ZeroSpamUniversal", "ZeroSpamUniversal", "", szServicePathFile, TRUE, "");

ServiceStartService ("ZeroSpamUniversal", szServicePathFile);

Am I using the correct parameter for the method serviceAddService()???? I tried getting the return value for the result and always fail.

With regards to what Xitch13 says, is your "-service" your command line??? Can I use the same command line even if I have my own commandline parameter??? This is my previous code while I was using the LaunchAppAndWait() method.

szApplicationPath = WINSYSDIR^"instsrv.exe";
LongPathToQuote( szApplicationPath, TRUE );
szApplicationPath3 = TARGETDIR^"zerospam.exe\"";
LaunchAppAndWait(szApplicationPath, "ZeroSpamUniversal \"" + szApplicationPath3, LAAW_OPTION_HIDDEN );

Does ServiceAddService() only works in Windows 2000??? This should also work in windows xp right???

Also I want to know if ever I was able to successfully install NT, how can I uninstall it also.

I hope to hear from you guys again... thanks and have a good day!


  • Members
  • 11 posts

Posted 11 April 2004 - 12:05

This was the error details I received when ServiceAddService() fails.

svScriptFile = C:\Professional\Source\Code\BackEnd\RunTime\ISFunc\Service.rul
nvLineNumber = 581
nvError = 1053


  • Members
  • 11 posts

Posted 11 April 2004 - 13:03

Hi! I have installed the service in my machine using the ServiceAddService() even if it displays an error that I

have previously posted before this reply. Now, I'm having a problem starting the service even if I already used

the ServiceStartService(). When I tried restarting it manually, an error occurred saying: Error 1053: The

service did not respond to the start or control request in a timely fashion. I searched in google and found a

description of the error and their solution to the problem. They require to have an administrative privilege to be

able to start the installation, and I have an admin account in my system. Then most of the solutions they offer are for other accounts only. In my case, I'm using my account. I don't understand the problem. Please help me solve this problem.