This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Using component wizard to install and start a service ->
Subscribe
- 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
‎Oct 14, 2008
01:26 AM
IS2009 and Services
I've got InstallShield 12 and am contemplating an upgrade, as I've got some issues with ServiceAddService and ServiceStartService in a Server 2003/2008 environment - they just won't start the service in question (though I can still add it) . . .
My code:
ServiceAddService("SchedulingServer", "CRM Extensions Scheduling Server", "", INSTALLDIR+"\Scheduling Server\\SchedulingServer.exe", TRUE, "");
and
ServiceStartService ( "SchedulingServer", "" );
My question is, would the above code work properly with IS2009 when installing on a server 2003 or 2008?
My code:
ServiceAddService("SchedulingServer", "CRM Extensions Scheduling Server", "", INSTALLDIR+"\Scheduling Server\\SchedulingServer.exe", TRUE, "");
and
ServiceStartService ( "SchedulingServer", "" );
My question is, would the above code work properly with IS2009 when installing on a server 2003 or 2008?
(8) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 14, 2008
08:06 AM
What project type are you using? If you're using a Basic MSI or InstallScript MSI, the typical method of adding and starting a service is to use the Component Wizard.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 14, 2008
11:58 PM
Once I worked out that I need two components, one for installing the service and one to start it, as well as delete it on uninstalling, it all started working as intended 🙂
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 20, 2009
11:22 AM
JimmiLee wrote:
Once I worked out that I need two components, one for installing the service and one to start it, as well as delete it on uninstalling, it all started working as intended 🙂
Can you please give me the details steps to implement this?
Thanks,
Vaibhav Paralikar
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 21, 2009
12:03 AM
Ok, I will give you a more detailed guide in how to do this. Remember, this is a basic MSI project...
Installing the Service:
In the Installation Designer, pick Organizations->Components and in the main window right click components and pick Components Wizard. IS2009 will ask you if you want to associate the new component with a wizard now - I usually do this manually after creating the component, but it's up to you.
1. Once you continue the wizard, in the first window choose: "Let me select a type and define the component myself"...
2. In the second window, name the component and select "Install NT Service".
3. In this window, browse to your service executable - it's usually an exe file. Notice that this file will be copied to the root of your installation directory on the target machine. Click Add and the service will be added - then name the service.
4. In the fourth window give it a display name and possibly arguments. Furthermore choose whether it should run in its own process or with others - if you're unsure, choose it's own process!
5. In the fifth window you can set how the service should start up and if this works for you, there's no need to create the start service component, however, it didn't for me, so I had to - you can test and check first . . .
6. In the sixth window you can set load ordering and dependencies - it's rarely needed . . .
7. Then there's error control - I usually choose display a message box and then continue . . .
8. In this eight window, I always go with local account . . .
And you're done . . .
Starting the Service:
In the Installation Designer, pick Organizations->Components and in the main window right click components and pick Components Wizard. IS2009 will ask you if you want to associate the new component with a wizard now - I usually do this manually after creating the component, but it's up to you.
1. Once you continue the wizard, in the first window choose: "Let me select a type and define the component myself"...
2. In the second window, name the component and select "Control NT Service".
3. In the third window, choose the service.
4. In the fourth window, select "Start the Service" . . .
5. In the fifth, select stop and delete the service (OBS depends on your MSI).
6. In both installation and uninstallation I choose to wait for the service . . .
And you're done . . .
Hope this helps ...
Installing the Service:
In the Installation Designer, pick Organizations->Components and in the main window right click components and pick Components Wizard. IS2009 will ask you if you want to associate the new component with a wizard now - I usually do this manually after creating the component, but it's up to you.
1. Once you continue the wizard, in the first window choose: "Let me select a type and define the component myself"...
2. In the second window, name the component and select "Install NT Service".
3. In this window, browse to your service executable - it's usually an exe file. Notice that this file will be copied to the root of your installation directory on the target machine. Click Add and the service will be added - then name the service.
4. In the fourth window give it a display name and possibly arguments. Furthermore choose whether it should run in its own process or with others - if you're unsure, choose it's own process!
5. In the fifth window you can set how the service should start up and if this works for you, there's no need to create the start service component, however, it didn't for me, so I had to - you can test and check first . . .
6. In the sixth window you can set load ordering and dependencies - it's rarely needed . . .
7. Then there's error control - I usually choose display a message box and then continue . . .
8. In this eight window, I always go with local account . . .
And you're done . . .
Starting the Service:
In the Installation Designer, pick Organizations->Components and in the main window right click components and pick Components Wizard. IS2009 will ask you if you want to associate the new component with a wizard now - I usually do this manually after creating the component, but it's up to you.
1. Once you continue the wizard, in the first window choose: "Let me select a type and define the component myself"...
2. In the second window, name the component and select "Control NT Service".
3. In the third window, choose the service.
4. In the fourth window, select "Start the Service" . . .
5. In the fifth, select stop and delete the service (OBS depends on your MSI).
6. In both installation and uninstallation I choose to wait for the service . . .
And you're done . . .
Hope this helps ...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 21, 2009
12:58 AM
Thanks JimmiLee for your knowledgeable response!
I apologize for incomplete input from my site. I am using InstallScipt project. And I tried to install windows service using following function:
ServiceAddService("Enterprise","Enterprise"," Testing ","F:\\TestConsoleForService\\Release\\TestConsoleForService.exe",TRUE,"");
Where, TestConsoleForService.exe is a simple HELLO WORLD program in CPP. I did not implement any service specific in it.
Above function install service properly but it did not start, it failed to start with 1053 error. I have also tried to install this exe as a service manually using SC.exe, but I got same result.
Can you please help me in this aspect? Also let me know if we need to write service specific code in .exe program.
I apologize for incomplete input from my site. I am using InstallScipt project. And I tried to install windows service using following function:
ServiceAddService("Enterprise","Enterprise"," Testing ","F:\\TestConsoleForService\\Release\\TestConsoleForService.exe",TRUE,"");
Where, TestConsoleForService.exe is a simple HELLO WORLD program in CPP. I did not implement any service specific in it.
Above function install service properly but it did not start, it failed to start with 1053 error. I have also tried to install this exe as a service manually using SC.exe, but I got same result.
Can you please help me in this aspect? Also let me know if we need to write service specific code in .exe program.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 21, 2009
01:07 AM
As I wrote in the first post, I initially tried scripting it with ServiceAddService and ServiceStartService, but when testing on server 2003 and 2008 I couldn't get it to work, so to be honest I don't know how to solve this one with installscript . . .
Personally, I only use installscript when the Installation Designer fails me, so I'm not much of an Installscript Guy I'm afraid . . .
Do share the solution if you find it though and good luck . . .
Personally, I only use installscript when the Installation Designer fails me, so I'm not much of an Installscript Guy I'm afraid . . .
Do share the solution if you find it though and good luck . . .
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 21, 2009
01:23 AM
Yes sure JimmiLee.
Thanks for your support!
First, I need to find out if i can run any .exe (like simple HELLO WORLD CPP program) as a windows service or I need to implement special program (and create exe) to run it as exe.
Thanks for your support!
First, I need to find out if i can run any .exe (like simple HELLO WORLD CPP program) as a windows service or I need to implement special program (and create exe) to run it as exe.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 21, 2009
01:32 AM
No worries - I like to help whenever I can, to give back the help I got from this commmunity . . .