2017-10-11 54 views
-1

我正在嘗試寫入reg並且無法找到正確的方法。NSIS WriteRegSTR或WriteRegDword

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\" 

我曾嘗試:

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\" 

但沒有到Reg不斷出現。

回答

0

1)您的安裝程序需要run as a elevated administrator寫入HKLM。將RequestExecutionLevel Admin添加到您的腳本。

2)在64位Windows上有two different views的註冊表,默認情況下32位應用程序寫入在RegEdit中看到的「真實」註冊表中的HKLM\Software\Wow6432Node密鑰。在NSIS中使用SetRegView來寫入64位註冊表。

+0

非常感謝你,我正在摸索我的頭幾個小時試圖弄清楚,所有我需要的是SetRegView。 :) –