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
- :
- Possible to Query a Windows Service Username?
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
‎Aug 16, 2011
11:06 AM
Possible to Query a Windows Service Username?
I'm trying to update a windows service that is already present on a system. The service has been previously installed and assigned a specific user account to run under.
Is there a way to query the user name and password from this existing service so i can preserve and replace this info when i install the new version?
Is there a way to query the user name and password from this existing service so i can preserve and replace this info when i install the new version?
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 16, 2011
10:09 PM
Hi there,
Username is easy, password much less so:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ServiceName\ObjectName
You won't even be able to query for where the passwords are stored without using low-level Windows API's. Decrypting them is another task entirely:
http://www.pctools.com/forum/showthread.php?6874-Opening-keys-under-HKLM%5CSecurity%5CPolicy%5CSecrets
Needless to say, it's clear that Microsoft doesn't want you doing this sort of thing.
Your best bet is to plan ahead for this for next time, storing the username and password in the registry in an encrypted fashion, to be re-read during upgrades and maintenance. This is basically what InstallShield does with its SQL functionality to let SQL Scripts run during uninstall.
As for this time around, you might be able to get this going by stopping the service, overwriting the service binary and restarting the service. However, accomplishing this while following all the various rules of Windows Installer is going to be a bit tough.
It'd be a rather long discussion on how to implement all of , but it goes without saying that our Professional Services department is available should you want some expert guidance on implementing a solution.
Username is easy, password much less so:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ServiceName\ObjectName
You won't even be able to query for where the passwords are stored without using low-level Windows API's. Decrypting them is another task entirely:
http://www.pctools.com/forum/showthread.php?6874-Opening-keys-under-HKLM%5CSecurity%5CPolicy%5CSecrets
Needless to say, it's clear that Microsoft doesn't want you doing this sort of thing.
Your best bet is to plan ahead for this for next time, storing the username and password in the registry in an encrypted fashion, to be re-read during upgrades and maintenance. This is basically what InstallShield does with its SQL functionality to let SQL Scripts run during uninstall.
As for this time around, you might be able to get this going by stopping the service, overwriting the service binary and restarting the service. However, accomplishing this while following all the various rules of Windows Installer is going to be a bit tough.
It'd be a rather long discussion on how to implement all of , but it goes without saying that our Professional Services department is available should you want some expert guidance on implementing a solution.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 17, 2011
06:11 PM
Are you certain the password for SQL stored in registry by IS2011 is indeed encrypted?
Cary R wrote:
Your best bet is to plan ahead for this for next time, storing the username and password in the registry in an encrypted fashion, to be re-read during upgrades and maintenance. This is basically what InstallShield does with its SQL functionality to let SQL Scripts run during uninstall.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 17, 2011
06:57 PM
TsungH wrote:
Are you certain the password for SQL stored in registry by IS2011 is indeed encrypted?
Yes, I am certain. Check:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\InstallShield Uninstall Information\[ProductCode]\SQLServer\SqlConnectionName
If you have any doubt.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 18, 2011
10:28 PM
Well, I saw the password in plaintext when I tried it a few months back. I will try again after my vacation, when I get a chance. The earliest will be in Sept, that is if I still remember.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 19, 2011
01:57 PM
It may have been plaintext at one point, but for at least as far back as InstallShield 12 or 2008 it would have been encrypted.
My test was with IS2011.
My test was with IS2011.
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)