代码之家  ›  专栏  ›  技术社区  ›  Albert Mulder

NSIS WriteRegSTR或WriteRegDword

  •  1
  • Albert Mulder  · 技术社区  · 9 年前

    我正试着给注册会计师写信,似乎找不到正确的方法。

    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中什么都没有出现。

    1 回复  |  直到 9 年前
        1
  •  1
  •   Anders    9 年前

    1) 安装程序需要 run as a elevated administrator 写信给HKLM。添加 RequestExecutionLevel Admin 到您的脚本。

    2) 在64位Windows上有 two different views 默认情况下,32位应用程序写入 HKLM\Software\Wow6432Node 输入您在RegEdit中看到的“real”注册表。使用 SetRegView 在NSIS中写入64位注册表。