I have a few installers, that write a few things to the registry, both HKLM and HKCU.
Since some of my 'clients' don't always uninstall using the uninstaller, but just remove the program, the registry entries remain. So I have made a 'cleaner' file that searches the 'client's' registry for my strings, and deletes them if he/she wants to. The client can use that cleaner file if he/she hasn't properly uninstalled using my uninstaller.
However...
Some time ago, a client e-mailed me, saying he couldn't reinstall my installer because there were some old registry strings still present. It turned out that somehow (I have no idea how), the HKLM string had been deleted, but the HKCU string was still there.
So - I updated my 'cleaner' file so that it would look for the HKCU string as well(it didn't do that originally, because I didn't think it necessary). The cleaner file works in a way that if it detects the registry strings, a checkbox will appear on the install options page, and you can then check the checkbox and it will then remove the registry entries when you execute the cleaner file.
But - he wrote back again, saying that the cleaner file still didn't show the checkbox for that installer.
So I opened the script of the cleaner file, and looked through it. I then removed the HKLM search from it, leaving only the search for the HKCU strings.
Compiled, but as my client had experienced, the checkbox now didn't turn up (it did turn up when searching for the HKLM string).
What I find strange about that, is that on my computer, I am the only user, and I'm admin.
So why won't the installer read from HKCU? Is this a known thing?
I have checked and doublechecked the script, and the name of the string against the one directly from the registry, but I can't find anything wrong there.
My 'cleaner' file has lots of Sections that are UnSelected if the registry strings aren't found. In other words, as mentioned, if the string is found, the checkbox for that application will appear, and you can then remove that application's registry entries by clicking 'Next'.
Here's the code for the UnSelection part of the script (installer name is changed). I have only kep the HKCU part here:
It finds the HKLM part(that isn't shown here) just fine, but not the HKCU part.
ReadRegStr $0 HKCU "Software\My_Installer.\Sections" "(Default)"
StrCmp $0 "" +2
Goto next
!insertmacro UnselectSection ${Sec00}
SectionSetText ${Sec00} ""
;some more strings are searched for here
next:
So again, my question is: Is there something wrong with my script anyway, or with the way I have written the name, or isn't it possible to read from HKCU at all?
I am right in thinking that the +2 only jumps over Goto next, right?