如何在Wix设计器的帮助下为Wix安装程序中的自定义操作启用管理员权限 [英] How to enable admin rights for custom actions in Wix installer with the help of Wix designer
问题描述
您好!
我有wxs项目文件:
Hello!
I have wxs project file:
<Product Id="$(var.ProductCode)" Name="$(var.ProductName)" Language="1049" Codepage="1251" Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="200" Compressed="yes" AdminImage="yes" InstallScope="perMachine" />
...
自定义动作:
...
Custom actions:
<CustomAction Id="VSDCA_FolderForm_AllUsers" Property="FolderForm_AllUsers" Value="ALL" />
<CustomAction Id="_3D169966_7F4D_439B_8537_BD70D91919BA" Execute="deferred" FileKey="_2EFFD1DC_7915_4BB8_9CBB_5EA8A904EBC3" adx:VSName="ProjService.exe" ExeCommand="-uninstall" />
<CustomAction Id="_305A6029_72A4_489A_8231_A0220BE7101E" Execute="deferred" FileKey="_2EFFD1DC_7915_4BB8_9CBB_5EA8A904EBC3" adx:VSName="ProjService.exe" ExeCommand="-install" />
<CustomAction Id="_59E2C944_6709_459D_9DBE_88945EBFA44C" Execute="deferred" FileKey="_A2D15616_D4F4_447A_B3D2_4F41E4696152" adx:VSName="CheckOs.dll Save parametrs" DllEntry="SaveParametrs" />
<CustomAction Id="_59E2C944_6709_459D_9DBE_88945EBFA44C.SetProperty" Property="_59E2C944_6709_459D_9DBE_88945EBFA44C" Value="[TARGETDIR]|[SERVERSANDPORTS]" />
<CustomAction Id="_AB08B803_44E2_49A9_9413_45FAB63CEA4D" Execute="deferred" FileKey="_A2D15616_D4F4_447A_B3D2_4F41E4696152" adx:VSName="CheckOs.dll Show warning messages" DllEntry="ShowWarningMessages" />
<CustomAction Id="_1D5A2ADF_9073_427C_9E29_35D656BAC599" Execute="deferred" FileKey="_A2D15616_D4F4_447A_B3D2_4F41E4696152" adx:VSName="CheckOs.dll Check X64" DllEntry="CanInstall" />
<CustomAction Id="_1D5A2ADF_9073_427C_9E29_35D656BAC599.SetProperty" Property="_1D5A2ADF_9073_427C_9E29_35D656BAC599" Value="[TARGETDIR]" />
<CustomAction Id="DIRCA_TARGETDIR" Property="TARGETDIR" Value="[ProgramFilesFolder]ProjClient" Execute="firstSequence" />
和InstallExecuteSequence
And InstallExecuteSequence
<InstallExecuteSequence>
<Custom Action="DIRCA_TARGETDIR" Before="CostInitialize"><![CDATA[TARGETDIR = ""]]></Custom>
<Custom Action="_1D5A2ADF_9073_427C_9E29_35D656BAC599.SetProperty" After="StartServices"><![CDATA[$comp_A0CCA35C_322E_4040_AD3F_AE7AB4382C73>2]]></Custom>
<Custom Action="_1D5A2ADF_9073_427C_9E29_35D656BAC599" After="_1D5A2ADF_9073_427C_9E29_35D656BAC599.SetProperty"><![CDATA[$comp_A0CCA35C_322E_4040_AD3F_AE7AB4382C73>2]]></Custom>
<Custom Action="_AB08B803_44E2_49A9_9413_45FAB63CEA4D" After="_1D5A2ADF_9073_427C_9E29_35D656BAC599"><![CDATA[$comp_A0CCA35C_322E_4040_AD3F_AE7AB4382C73>2]]></Custom>
<Custom Action="_59E2C944_6709_459D_9DBE_88945EBFA44C.SetProperty" After="_AB08B803_44E2_49A9_9413_45FAB63CEA4D"><![CDATA[$comp_A0CCA35C_322E_4040_AD3F_AE7AB4382C73>2]]></Custom>
<Custom Action="_59E2C944_6709_459D_9DBE_88945EBFA44C" After="_59E2C944_6709_459D_9DBE_88945EBFA44C.SetProperty"><![CDATA[$comp_A0CCA35C_322E_4040_AD3F_AE7AB4382C73>2]]></Custom>
<Custom Action="_305A6029_72A4_489A_8231_A0220BE7101E" After="_59E2C944_6709_459D_9DBE_88945EBFA44C"><![CDATA[$comp_B2547267_A9C5_4B8B_AA20_4380CCF78AAD>2]]></Custom>
<Custom Action="_3D169966_7F4D_439B_8537_BD70D91919BA" After="MsiUnpublishAssemblies"><![CDATA[$comp_B2547267_A9C5_4B8B_AA20_4380CCF78AAD=2]]></Custom>
</InstallExecuteSequence>
我的自定义竞价在程序中执行CopyFile文件直接ry。
我有最高级别的UAC。如果我运行我的msi(UAC正在显示),在创建程序文件中的主目录之后,但是在没有管理员权限的情况下调用我的自定义操作后,我无法将additinal文件复制到程序文件中。
如果我禁用UAC,那么msi工作正常,我的自定义操作以管理员权限运行。如何修复?
请帮忙。
谢谢。
My custom auction do CopyFile in Program Files directory.
I have UAC with maximum level. If I run my msi (UAC is showing), after the main directory in program files is created, but after my custom actions is called without admin rights and I can not copy additinal file to program files.
If I disable UAC then msi is work correctly and my custom action is run with admin right. How to fix?
Please help.
Thanks.
推荐答案
(var.ProductCode) 名称 =
(var.ProductCode)" Name="
(var.ProductName) 语言 = 1049 代码页 = 1251 版本 =
(var.ProductName)" Language="1049" Codepage="1251" Version="
(var.ProductVersion) 制造商 =
(var.ProductVersion)" Manufacturer="
这篇关于如何在Wix设计器的帮助下为Wix安装程序中的自定义操作启用管理员权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!