1

I am trying to write to the reg and cant seem to find the correct way.

HKEY_LOCAL_MACHINE
"SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "XboxStat" '"C:\\Program Files\\Microsoft Xbox 360 Accessories\\XboxStat.exe\" silentrun'
"SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "Hyperspin" "D:\\Arcade\\Hyperspin.exe\"

I have tried:

WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "Hyperspin" "D:\\Arcade\\Hyperspin.exe\"
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "Hyperspin" "D:\\Arcade\\Hyperspin.exe\"
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "Hyperspin" "D:\\Arcade\\Hyperspin.exe\"
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "Hyperspin" "D:\\Arcade\\Hyperspin.exe\"

But nothing ever shows up in reg.

alexander.polomodov
  • 5,396
  • 14
  • 39
  • 46
Albert Mulder
  • 147
  • 1
  • 12

1 Answers1

2

1) Your installer needs to run as a elevated administrator to write to HKLM. Add RequestExecutionLevel Admin to your script.

2) On 64-bit Windows there are two different views of the registry and by default 32-bit applications write to the HKLM\Software\Wow6432Node key in the "real" registry you see in RegEdit. Use SetRegView in NSIS to write to the 64-bit registry.

Anders
  • 97,548
  • 12
  • 110
  • 164