I wrote the following into my installer, but when it runs it only gets a half dozen or so then jumps out. I intend to log the installation and would like to detail each of the removed entries from the Run key, otherwise I would just brute-force it and use DelRegKey and then make a new, empty one.
; Remove everything from the startup menu and the Run registry key
StrCpy $0 0 ; initialize a loop counter
loop:
ClearErrors
EnumRegValue $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Run" $0
IfErrors RunDone ; if nothing is set to run, then jump out
DetailPrint "Removed from startup: $1" ; print what software is set to autostart
DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" $1 ; delete the registry entry so it doesn't run automatically
IntOp $0 $0 + 1 ; increment the loop counter
Goto loop
RunDone: Am I missing something here? Why will it not cycle through all of the values in the Run key?