我们目前有一个创建的MSI 维克斯 3.5。该应用程序在.NET 3.5中。我们使用boostrapper任务生成一个bootstrapper 的MSBuild 文件。它指向6.0a SDK 文件。
当用户有 UAC 在他们安装,他们必须右键单击 setup.exe
并选择run-as administrator。
我真正想要的是让setup.exe自动提示提升(使用我在其他安装中看到的黄色对话框)。
更好的是,我希望MSI能够做到这一点并取消它 setup.exe
完全,但我认为这就是WiX 3.6的意义,对吧?
如果我使用创建boostrapper ApplicationRequiresElevation="true"
这需要7.0a SDK,对吗?然后引导程序会提示自动提升吗?这是否意味着应用程序必须是一个 。净 4申请?我不这么认为......
我们使用过WiX 3.0并且能够提升特权。但是,我们没有提升我们的引导程序。我们通过Package属性提升了MSI文件本身:
<Package Id="$(var.PackageCode)"
Description="$(var.ProductName) $(var.Version)"
InstallerVersion="301"
Compressed="yes"
InstallPrivileges="elevated" <!-- Elevated right here -->
InstallScope="perMachine"
Platform="x86"/>
作为旁注,我们的引导程序使用我们的官方证书进行签名(使用v6.0A SDK中的signtool.exe)。我不确定这是否会导致引导程序也需要提升权限。
更新:
我们的setup.exe bootstrapper项目中有一个app.manifest文件,要求在管理员级别运行可执行文件。请参阅以下示例:
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace
the requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</asmv1:assembly>
我们使用过WiX 3.0并且能够提升特权。但是,我们没有提升我们的引导程序。我们通过Package属性提升了MSI文件本身:
<Package Id="$(var.PackageCode)"
Description="$(var.ProductName) $(var.Version)"
InstallerVersion="301"
Compressed="yes"
InstallPrivileges="elevated" <!-- Elevated right here -->
InstallScope="perMachine"
Platform="x86"/>
作为旁注,我们的引导程序使用我们的官方证书进行签名(使用v6.0A SDK中的signtool.exe)。我不确定这是否会导致引导程序也需要提升权限。
更新:
我们的setup.exe bootstrapper项目中有一个app.manifest文件,要求在管理员级别运行可执行文件。请参阅以下示例:
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace
the requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</asmv1:assembly>
我知道这是一个古老的话题,但可能会为下一个节省一些时间。
我必须阅读所有评论,特别是 custom action had Impersonate=yes...
另一方面,自定义操作具有与权限相关的执行属性:
<CustomAction Id = "CA.First" Execute ="immediate" ... />
<CustomAction Id = "CA.Second" Execute ="deferred" ... />
CA.First
将始终在用户模式下执行,但是 CA.Second
可以拥有提升的特权。
可能在这里是与特权相关的其他技巧,
这里的要点 - WiX允许在CustomAction级别上进行控制权限,因此请确保将其设置为正确。
CustomAction元素