cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
umairvb
Level 3

How Window Service in Installshield

Hey Everyone,Can anybody tell me how can .net Window service install using installshield 2009 ,Please give me details how can do this,Please Help is urgent
Labels (1)
0 Kudos
(5) Replies
TheTraveler
Level 8

Well, there are a couple of ways...

You can use the GUI in Install Shield to do it or if you are using Install Shield script, look at the function, ServiceAddService.
0 Kudos
umairvb
Level 3

Thanks for reply,but could you give me details ,if script required then could you give me script i am not expert in installshield script.Thanks
0 Kudos
TheTraveler
Level 8

Here is a small Example on how you can install a service via Install Shield (IS) script. However, I would highly recommend looking this up in the IS help. There are better examples there and more detailed information. Furthermore, you don't have to do this via IS script. You can also do this via the Integrated Development Environment (IDE). I would suggest that you play with both and find the one that you are more comfortable with.

ServiceAddService("MyServiceInternalName",              // szServiceName  
"MyServiceDispalyName", // szServiceDisplayName
"Breif description of the Service.", // szServiceDescription
TARGETDIR ^ "MyService.exe", // szServicePathFile,
FALSE, // bStartService,
""); // szStartServiceArgs


Here are some of the PROs and CONs.

In the IDE.
PRO
+ Less Code to write and maintain.
+ It is already specific to the components you are installing.

CON
- The service will startup as soon as it is installed.

In Install Shield Script.
PRO
+ You have control as to when it is installed.
+ You can control when the service starts up. This is useful for products that create and connect to database servers. You don't want your service trying to connect to the database while you are in the middle of trying to create it.

CON
- More programmable code to maintain.
0 Kudos
umairvb
Level 3

Thanks for reply me,ServiceAddService function not working i use in installscript file like

function MyFunction(hMSI)
// To Do: Declare local variables.
begin

ServiceAddService("InternetDetectService",
"InternetDetectService",
"Breif description of the Service.",
TARGETDIR ^ "InternetDetectService.exe",
FALSE,
"");

end;


window service not install on my computer ,please help what i wrong.
0 Kudos
TheTraveler
Level 8

What project type are you using???
0 Kudos