WiX:如何注册应用程序以在Windows启动时启动?

发布于 2024-07-25 19:13:20 字数 290 浏览 2 评论 0原文

我正在探索使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

童话 2024-08-01 19:13:20

使用 Google 找到了此内容(通过注册表提供自动程序启动); 它还包括添加 UI。 不要忘记您还应该在设置之外提供一个选项来启用/禁用自动启动。

它的基本 Wix 是:

  <Property Id="ASSISTANCE_START_VIA_REGISTRY">1</Property>

  <!-- Auto-start via Registry -->
  <Component Id="MerliniAssistanceAutostart" Guid="Place-your-own-GUID-here">
    <RegistryValue Id="MerAs.rst" Root="HKMU" Action="write"
                   Key="Software\Microsoft\Windows\CurrentVersion\Run"
                   Name="Merlinia Assistance Client"
                   Value="[INSTALLDIR]Assistance.exe"
                   Type="string" />
    <Condition>ASSISTANCE_START_VIA_REGISTRY</Condition>
  </Component>

  <ComponentRef Id="MerliniaAssistanceAutostart" />

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:

  <Property Id="ASSISTANCE_START_VIA_REGISTRY">1</Property>

  <!-- Auto-start via Registry -->
  <Component Id="MerliniAssistanceAutostart" Guid="Place-your-own-GUID-here">
    <RegistryValue Id="MerAs.rst" Root="HKMU" Action="write"
                   Key="Software\Microsoft\Windows\CurrentVersion\Run"
                   Name="Merlinia Assistance Client"
                   Value="[INSTALLDIR]Assistance.exe"
                   Type="string" />
    <Condition>ASSISTANCE_START_VIA_REGISTRY</Condition>
  </Component>

  <ComponentRef Id="MerliniaAssistanceAutostart" />
自在安然 2024-08-01 19:13:20

查看注册表中的 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 in HKCU\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.

尘曦 2024-08-01 19:13:20

我建议您使用自定义表单询问用户应用程序是否应自动启动,然后在用户启动文件夹中创建一个链接。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文