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
- :
- Re: InstallScript Service params
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
‎Jun 04, 2008
02:51 PM
InstallScript Service params
I am currently using ServiceAddService to add a service but I would like to set the username and password to run the service and the recovery options to restart. I know this can be done with SERVICE_IS_PARAMS but cannot find examples of how it works or works with the ServiceAddService. Could someone show me a couple of examples of this.
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 05, 2008
02:00 AM
Currently this is what I have, but it will not compile saying numeric value required. even though what I have seen shows passing in the string values.
The service I am adding in not a .Net service so it will not automatically prompt for username and password, is there a way to force this or am I on the right path.
STRING szServiceUser, szServicePass;
ServiceInitParams ();
SERVICE_IS_PARAMS.dwServiceType = SERVICE_WIN32_OWN_PROCESS|SERVICE_INTERACTIVE_PROCESS;
SERVICE_IS_PARAMS.lpServiceStartName = szServiceUser;
SERVICE_IS_PARAMS.lpPassword = szServicePass;
ServiceAddService (szServiceName,szServiceName,szServiceName,MyService1,'');
The service I am adding in not a .Net service so it will not automatically prompt for username and password, is there a way to force this or am I on the right path.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 05, 2008
12:48 PM
It appears that when I use the SERVICE_IS_PARAMS like above it does not install my service now or unintall it. Any suggestions on how I can get this to install the service with a user name and password
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 05, 2008
01:10 PM
Which line or lines give you the compiler errors? For the string fields, perhaps try:
SERVICE_IS_PARAMS.lpServiceStartName = &szServiceUser; // pointer to user name string
SERVICE_IS_PARAMS.lpServiceStartName = &szServiceUser; // pointer to user name string
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 10, 2008
04:19 PM
I believe I see what I was doing wrong I was not doing this as a pointer &szServiceUser. I am trying this now. Thanks.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 22, 2020
07:51 AM
This was a very helpful post, thanks.
Could I ask that this kind of information is added to the online help (if it hasn't been already) so developers know how to use these parameters. Examples are always the most useful part of online help.