PDA

View Full Version : Installing an NT service via the IDE



cada0310
07-01-2005, 02:16 PM
Is it possible to use this functionality of the IDE, but base the User name and Password off of scripting variables, or perhaps data from a dialog?

RobertDickau
07-05-2005, 07:11 PM
If you're asking about the NT Services Object for an InstallScript project, perhaps see this Macrovision KB article: http://support.installshield.com/kb/view.asp?articleid=Q105117. If you're talking about an InstallScript MSI project, you might see if you can use MSI properties for those settings.

cada0310
07-20-2005, 12:08 PM
Hi Robert,

Thanks again for your response.

I'm using an Installscript MSI project, and under Components->My Component->Advanced Settings->Install NT Services.

I placed my service in there, and I'd like to put something (like username & password variables from the SdLogonUserInformation dialog) in the Install NT Services UI. I guess I'm not sure if that's possible, or what the syntax is.

Thanks for any tips you can provide.

RobertDickau
07-20-2005, 12:28 PM
Hmmm... You might be able to use made-up properties such as [SERVICEACCOUNT] and [SERVICEACCOUNTPASSWORD] in the NT Services view, and after showing your dialog box call MsiSetProperty to associate the custom properties with the variables from the dialog box. (You might also want to set MsiHiddenProperties to keep the service password from being written to the log file...)

One additional thing to keep in mind is that the account must have the "log on as a service" right; MSI doesn't grant it automatically...

cada0310
07-20-2005, 12:37 PM
That sounds pretty good, I'll give that a try.

One question though: this routine "function OnFirstUIBefore()" doesn't seem to have the MSI handle I need to call MsiSetProperty. Is there some way to get that handle?

RobertDickau
07-20-2005, 01:57 PM
I think you can use the InstallScript variable ISMSI_HANDLE.

cada0310
07-20-2005, 02:29 PM
Worked like a champ. Thanks again.