WiX:如何注册应用程序以在 Windows 启动时启动? [英] WiX: How to register application to start when Windows launches?

查看:20
本文介绍了WiX:如何注册应用程序以在 Windows 启动时启动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在探索使用 WiX 生成的 MSI 分发 .NET 桌面应用程序.

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.

在 Windows 启动时(在 WiX 中)注册应用程序以启动的建议方法是什么?

我可以使用什么 WixUI 以及如何使用?

What WixUI could I use and how?

注意事项:

  • 该应用程序不是 Windows 服务,因此不应注册.
  • 最好让用户在设置过程中禁用该选项.

提前致谢!

推荐答案

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

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.

它的基本 Wix 是:

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="SoftwareMicrosoftWindowsCurrentVersionRun"
                   Name="Merlinia Assistance Client"
                   Value="[INSTALLDIR]Assistance.exe"
                   Type="string" />
    <Condition>ASSISTANCE_START_VIA_REGISTRY</Condition>
  </Component>

  <ComponentRef Id="MerliniaAssistanceAutostart" />

这篇关于WiX:如何注册应用程序以在 Windows 启动时启动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆