Albert Mulder
Albert Mulder

Reputation: 167

NSIS WriteRegSTR or WriteRegDword

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.

Upvotes: 1

Views: 3228

Answers (1)

Anders
Anders

Reputation: 101736

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.

Upvotes: 2

Related Questions