WiX:如何注册应用程序以在Windows启动时启动?
我正在探索使用 WiX 生成的 MSI 分发 .NET 桌面应用程序。
到目前为止效果很好。 但我有几个问题,谷歌搜索无法帮助解决。
注册应用程序以在 Windows 启动时启动(在 WiX 中)的建议方式是什么?
我可以使用什么 WixUI 以及如何使用?
注意:
- 该应用程序不是 Windows 服务,不应如此注册。
- 最好让用户在设置过程中禁用该选项。
提前致谢!
I'm exploring distribution of .NET desktop applications with MSI generated by WiX.
So far it works great. But I've got a few questions, googling can't help out with.
What's the advised way of registering application to start when windows launches (in WiX)?
What WixUI could I use and how?
Notes:
- The application is not a Windows Service and should not be registered as such.
- It would be nice to let user to disable that option in the setup process.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我使用 Google 找到了此内容(通过注册表提供自动程序启动); 它还包括添加 UI。 不要忘记您还应该在设置之外提供一个选项来启用/禁用自动启动。
它的基本 Wix 是:
I found this using Google (Providing automatic program start via the Registry); it also includes adding UI. Don't forget you should also provide an option outside the setup to enable/disable autostart.
The basic Wix for it is:
查看注册表中的
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
。 如果您希望它按用户启动,请查看HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
。 如果您希望它在 Windows 启动时启动,而不需要用户登录,那就是服务。Take a look in the registry at
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
. If you want it to start per-user then look inHKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
. If you want it to start when Windows starts, without requiring a user to log on, that's a Service.我建议您使用自定义表单询问用户应用程序是否应自动启动,然后在用户启动文件夹中创建一个链接。
I would suggest you ask the user with a custom form if the application should startup automatically and then create a link in the users startup folder.