Old 4th August 2011, 19:23   #1
Ron.Stordahl
Member
 
Join Date: Oct 2005
Location: Minnesota
Posts: 57
Windows 7 Uninstall Registry Entries

I am updating an installer for XP to include Vista/Windows 7. Currently, in XP, I set in the registry:

WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\BPQ32.exe"

WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe". As well as similar entries for "DisplayIcon", "Publisher" etc.

Should these be changed to HKCU for Vista/Windows 7 installs. I do need to use HKCU as opposed to HKLM for other non-install related registry entries in Windows 7, such as paths to application data, etc.

The application is 32 bit if that matters.

Ron Stordahl
Ron.Stordahl is offline   Reply With Quote
Old 4th August 2011, 20:04   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
If you're elevating your install (that is, requiring admin access), you shouldn't be using HKCU at all, because they'll end up in the admin's reghive, not the user's. (It's true that on Vista/7 this might actually be the same user, but that's not guaranteed.)
If on the other hand you don't elevate, you cannot use HKLM at all because you need admin access to write there.

So, long story short: In almost all cases you shouldn't be writing to both HKLM and HKCU. It's either one or the other: HKLM for admin-level installers, HKCU for user-level installers.
MSG is offline   Reply With Quote
Old 5th August 2011, 00:04   #3
Ron.Stordahl
Member
 
Join Date: Oct 2005
Location: Minnesota
Posts: 57
That is good info. The entries I quoted are as far as I understand needed so that the control panel uninstall program list will include my application. I doubt it is actually necessary as I have the uninstall link in the program list, however good practice is to do as I have suggested.

So I will use HKCU for all and not mix the two.

Thanks for the informative response...I am just learning about W7!

Ron Stordahl
Ron.Stordahl is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump