WiX: How to register application to start when Windows launches?(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 启动时启动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:WiX:如何注册应用程序以在 Windows 启动时启动?
- C# 中多线程网络服务器的模式 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 输入按键事件处理程序 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
