【发布时间】:2014-06-14 14:02:54
【问题描述】:
当我运行我的安装程序时,我遇到了以下问题。
我正在执行一些需要访问注册表的自定义操作,我只能认为这是因为 WiX 配置不会使其请求管理员权限。我看过一些关于 SO 的帖子并尝试使用。
InstallPriveleges="elevated"
在 package 元素中,但是这不会使安装程序具有管理员屏蔽,也不会请求它,因此仍然会产生错误。
关于测试项目的额外信息。
我的应用程序的名称是:WindowsFormsApplication33,自定义操作项目的名称是CustomAction1,安装项目的名称是SetupProject1。
这是我当前的 wix xml 文件。
<Package InstallerVersion="200" Compressed="yes" InstallPrivileges="elevated" InstallScope="perUser" />
<Binary Id="CustomAction1.CA.dll" SourceFile ="..\CustomAction1\bin\$(var.Configuration)\CustomAction1.CA.dll" />
<CustomAction Id="disableTaskManager"
Return="check"
Execute="immediate"
BinaryKey="CustomAction1.CA.dll"
DllEntry="disableTaskManager" />
<CustomAction Id="enableTaskManager"
Return="check"
Execute="immediate"
BinaryKey="CustomAction1.CA.dll"
DllEntry="enableTaskManager" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="SetupProject1" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<InstallExecuteSequence>
<Custom Action="disableTaskManager" Before="InstallFinalize" />
<Custom Action="enableTaskManager" After="InstallInitialize"><![CDATA[(NOT UPGRADINGPRODUCTCODE)]]></Custom>
</InstallExecuteSequence>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="Form Test Application" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Guid="{EDA315F6-A115-4348-8607-981C252EA317}">
<File Source="$(var.WindowsFormsApplication33.TargetPath)" KeyPath ="yes" />
</Component>
<Component Guid="{E3182F61-F563-4C13-82B5-8CC39D9DB380}">
<File Source="$(var.CustomAction1.TargetPath)" KeyPath ="yes" />
</Component>
<Component Guid="{E4AF325E-B244-47F5-855A-5B40DBC425D2}">
<File Source="..\WindowsFormsApplication33\bin\Release\WindowsFormsApplication33.exe.config" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
更新:将 InstallScope 值从 perUser 更改为“perMachine”确实会出现 UAC 提示,但 DLL 错误仍然存在。..
【问题讨论】:
-
令人讨厌的是我什至无法测试安装程序的其余部分,因为当我右键单击 .msi 文件时,它不允许我以管理员身份手动启动。
-
您找到解决方案了吗?我陷入了一个非常相似的问题,这让我发疯!
-
@jcansdale 恐怕只是整个线程中的内容。我这样做已经有一段时间了。
-
感谢您的更新。调试安装程序对我来说一直是一个痛苦的世界。我会继续加油的。 ;)
标签: wix installation