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 安装程序应始终以管理员身份运行


基础教程推荐
- SSE 浮点算术是否可重现? 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 将 XML 转换为通用列表 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01