PDA

View Full Version : NT Service



andyansryan
06-14-2004, 04:28 PM
Hi All,

How can I update the user name and password field using install script. At the moment I am using the following line of code but it does not work.

err = MsiSetProperty(ISMSI_HANDLE, "username", "password");

andyansryan
06-14-2004, 05:29 PM
To make it more clear how can I update user name for a NT serivce.

Esquimaux
06-15-2004, 08:15 AM
Hi Andy,

If the service has standard settings, you can use the ServiceAddService() function along with the SERVICE_IS_PARAMS structure (lpServiceStartName and lpPassword) to change the user name and password.

Remember to DISABLE(LOGGING) before modying the service with this method, or it will be logged for uninstallation even if it already existed.

Good luck.

Esquimaux
06-15-2004, 08:20 AM
Sorry, forgot I was in the Developer 7 community...

The ServiceAddService() function is not available with that version of InstallShield.

I think your next best choice would be to use WMI and the Win32_Service object... more details to come.