将安装程序配置为 enable/disable 在 Windows 启动时启动
Configuring an installer to enable/disable startup on Windows start
我正在尝试为 Windows 8.1 安装应用程序,以便可以启用和禁用它以在 Windows 启动时从 TaskManager 和 Windows > 设置> 应用程序。注册表是这样创建的:
<RegistryValue Id="myProgram.exe"
Root="HKLM"
Action="write"
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
Name="My Program"
Value="[INSTALLFOLDER]myProgram.exe"
Type="string"/>
这已成功将程序添加到启动应用程序列表中,可以从任务管理器中禁用/启用它,但无法通过 Windows > 设置 > 应用程序进行控制。该应用程序显示在 Windows 设置列表中,但您可以通过进入注册表并查看 HLM\software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run\My 程序中的值没有改变来判断切换启用/禁用不会改变任何内容。为什么 Windows 设置无法控制此启动应用程序?
此外,如果我们想在 HLM\software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run\My 程序中预先输入启用/禁用启动的值,我们将为每个选项使用哪个二进制值?
根据本网站https://winaero.com/blog/how-to-add-or-remove-startup-apps-in-windows-10/ "Modern" 启动应用程序系统设置仅适用于 HKCU 中的 运行 键。
我没有测试过这篇文章。您可能想要使用分析工具,例如注册表 snapshot/diff and/or processexplorer 来验证这个新设置屏幕在做什么。
HKCU:我不确定,我现在无法测试。尝试一些提示。正如 Chris 指出的那样:您为什么要写信给 HKLM
?将其更改为 HKCU
并查看是否有效:
<RegistryValue Id="myProgram.exe"
Root="HKCU"
Action="write"
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
Name="My Program"
Value="[INSTALLFOLDER]myProgram.exe"
Type="string"/>
Autoruns:SysInternals 有一个工具在检查 auto-run 问题时非常有用:https://docs.microsoft.com/en-us/sysinternals/downloads/autoruns. And a direct run from source link.使用此工具似乎在禁用列表中的项目时,它们被移动到名为 AutorunsDisabled
的 sub-key:
我正在尝试为 Windows 8.1 安装应用程序,以便可以启用和禁用它以在 Windows 启动时从 TaskManager 和 Windows > 设置> 应用程序。注册表是这样创建的:
<RegistryValue Id="myProgram.exe"
Root="HKLM"
Action="write"
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
Name="My Program"
Value="[INSTALLFOLDER]myProgram.exe"
Type="string"/>
这已成功将程序添加到启动应用程序列表中,可以从任务管理器中禁用/启用它,但无法通过 Windows > 设置 > 应用程序进行控制。该应用程序显示在 Windows 设置列表中,但您可以通过进入注册表并查看 HLM\software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run\My 程序中的值没有改变来判断切换启用/禁用不会改变任何内容。为什么 Windows 设置无法控制此启动应用程序?
此外,如果我们想在 HLM\software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run\My 程序中预先输入启用/禁用启动的值,我们将为每个选项使用哪个二进制值?
根据本网站https://winaero.com/blog/how-to-add-or-remove-startup-apps-in-windows-10/ "Modern" 启动应用程序系统设置仅适用于 HKCU 中的 运行 键。
我没有测试过这篇文章。您可能想要使用分析工具,例如注册表 snapshot/diff and/or processexplorer 来验证这个新设置屏幕在做什么。
HKCU:我不确定,我现在无法测试。尝试一些提示。正如 Chris 指出的那样:您为什么要写信给 HKLM
?将其更改为 HKCU
并查看是否有效:
<RegistryValue Id="myProgram.exe"
Root="HKCU"
Action="write"
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
Name="My Program"
Value="[INSTALLFOLDER]myProgram.exe"
Type="string"/>
Autoruns:SysInternals 有一个工具在检查 auto-run 问题时非常有用:https://docs.microsoft.com/en-us/sysinternals/downloads/autoruns. And a direct run from source link.使用此工具似乎在禁用列表中的项目时,它们被移动到名为 AutorunsDisabled
的 sub-key: