WiX installer should always run as administrator(WiX 安装程序应始终以管理员身份运行)
问题描述
我使用 WiX 为 .NET WPF 应用程序开发了一个自定义安装程序.如果我右键单击并以管理员身份运行,它可以正常工作,但是在没有运行时,由于权限不足,某些组件无法安装.
I developed a custom installer with WiX for a .NET WPF application. It works fine if I right-click and run as administrator, however when running without, some components fail to install due to insufficient privileges.
这些组件包括 SQL Server Express 2008 R2、FoxIt Reader、一个 ActiveX 组件和其他一些组件.它还要求在新安装的数据库上运行一些 SQL 脚本——无论如何,它们都需要管理员权限.
The components include SQL Server Express 2008 R2, FoxIt Reader, an ActiveX component and some others. It also requires that some SQL scripts are ran on the newly installed database - anyway, they all require administrator privileges.
我尝试将 InstallScope="perMachine" 和 InstallPrivileges="elevated" 属性添加到 Package 节点,但这似乎没有什么不同.
I tried adding the InstallScope="perMachine" and InstallPrivileges="elevated" attributes to the Package node, but this didn't seem to make a difference.
我确定这很愚蠢,但我在参考资料或网上找不到任何东西.
I'm sure it's something silly, but I couldn't find anything in the reference or online.
推荐答案
我想如果你只是添加
<Property Id="MSIUSEREALADMINDETECTION" Value="1" />
它应该可以解决问题.如果没有,请告诉我,我可以做更多检查.
it should solve the problem. Let me know if not and I can do some more checking.
这篇关于WiX 安装程序应始终以管理员身份运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:WiX 安装程序应始终以管理员身份运行


- 输入按键事件处理程序 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01