【发布时间】:2014-01-21 18:22:15
【问题描述】:
这是我第一次尝试编写 MSI 安装程序。 WIX 安装程序中有关 UAC 的自定义命令在这里和其他地方有很多帖子。但是,还没有找到任何可以解决我的问题的方法。
我需要启动在我的 MSI 中提升的应用程序。我正在尝试启动将安装设备驱动程序的 .NET 应用程序(编译为以管理员身份运行)。如果需要,我使用 .NET exe 向用户显示“连接设备”提示,然后在非托管代码中执行实际的驱动程序安装。
MSI 立即导致 UAC 提示,但应用程序随后在没有提升的情况下启动,并且失败。从提升的命令提示符运行没有帮助。我在某处读到,将清单添加到安装中可能会有所帮助......它没有。
这是我的 WIX 代码:
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" UpgradeCode="12345678-1234-1234-1234-111111111111"
Name="FlashBoot Driver" Version="0.0.1" Manufacturer="ACME Corp" Language="1033">
<Package InstallerVersion="200" Compressed="yes" Comments="Windows Installer Package"/>
<Media Id="1" Cabinet="product.cab" EmbedCab="yes"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="FlashBoot Driver">
<Component Id="AppFiles" Guid="12345678-1234-1234-1234-222222222222">
<File Id="AppFile1" Source="C:\App\Release\Setup.exe"/>
<File Id="AppFile2" Source="C:\App\Release\Setup.exe.manifest"/>
<File Id="AppFile3" Source="C:\App\Release\Unmanaged.dll"/>
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="DefaultFeature" Level="1">
<ComponentRef Id="AppFiles"/>
</Feature>
<CustomAction Id="OurAction"
Execute="deferred"
Impersonate="no"
Return="ignore"
FileKey="AppFile1"
ExeCommand="" />
<InstallExecuteSequence>
<Custom Action="OurAction" Before="InstallFinalize" />
</InstallExecuteSequence>
</Product>
</Wix>
【问题讨论】:
标签: wix installation uac