gpt4 book ai didi

wix - Wix 中的 CustomAction 未执行

转载 作者:行者123 更新时间:2023-12-04 14:45:33 24 4
gpt4 key购买 nike

所以我正在创建我的第一个 Wix 项目,但我似乎在执行自定义操作时遇到了问题。我不确定它是否包含在 msi 中,我也不太确定我做错了什么。以下是我的 Wix 文件:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="ExactaDynamicManifest" Language="1033" Version="1.0.0.0" Manufacturer="Bastian Software Solutions" UpgradeCode="274ff2d9-e291-4706-a8db-ce80ccd91538">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/>

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />

<Feature Id="ProductFeature" Title="ExactaDynamicManifest" Level="1">
<ComponentGroupRef Id="ExactaDynamicManifest"/>
</Feature>

<Icon Id="exacta.ico" SourceFile="icons\exacta.ico"/>
<Property Id="ARPPRODUCTICON" Value="exacta.ico" />

</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="ExactaFolder" Name ="Exacta">
<Directory Id="INSTALLFOLDER" Name="ExactaExactaDynamicManifest" />
</Directory>
</Directory>
</Directory>
</Fragment>

<Fragment>
<CustomAction Id="InstallService" FileKey="ExactaDynamicManifest.exe" ExeCommand="install"/>
<InstallExecuteSequence>
<Custom Action="InstallService" After="InstallFinalize"/>
</InstallExecuteSequence>
</Fragment>
</Wix>

最后一个片段包含我的自定义操作,我希望在将所有文件放入目录后在命令行上执行以下操作:
ExactaDynamicManifest.exe install

需要注意的一件事是 exe 实际上来自 组件组引用 上面定义。不确定这是否是一个问题,但我想我会提到它。任何帮助,将不胜感激。

最佳答案

我终于得到了一些有效的东西。我最初未加载 CustomAction 的问题似乎是由于它位于不同的 <fragment> 中。 .我将所有代码合并到一个片段中,它似乎可以运行。

在与用户权限等斗争之后,我最终得到了这个解决方案:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="ExactaDynamicManifest" Language="1033" Version="1.0.0.0" Manufacturer="Bastian Software Solutions" UpgradeCode="274ff2d9-e291-4706-a8db-ce80ccd91538">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/>

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />

<Feature Id="ProductFeature" Title="ExactaDynamicManifest" Level="1">
<ComponentGroupRef Id="ExactaDynamicManifest"/>
</Feature>

<Icon Id="exacta.ico" SourceFile="icons\exacta.ico"/>
<Property Id="ARPPRODUCTICON" Value="exacta.ico" />

</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="ExactaFolder" Name ="Exacta">
<Directory Id="INSTALLFOLDER" Name="ExactaExactaDynamicManifest" />
</Directory>
</Directory>
</Directory>

<CustomAction Id="RunTopShelfServiceInstall" Directory="INSTALLFOLDER" Execute="deferred" Return="ignore" Impersonate="no" ExeCommand="[INSTALLFOLDER]ExactaDynamicManifest.exe install"/>
<CustomAction Id="RunTopShelfServiceUninstall" Directory="INSTALLFOLDER" Execute="deferred" Return="ignore" Impersonate="no" ExeCommand="[INSTALLFOLDER]ExactaDynamicManifest.exe uninstall"/>

<InstallExecuteSequence>
<Custom Action="RunTopShelfServiceInstall" After="InstallFiles">
NOT Installed
</Custom>
<Custom Action="RunTopShelfServiceUninstall" After='InstallInitialize'>
(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")
</Custom>
</InstallExecuteSequence>

</Fragment>
</Wix>

关于wix - Wix 中的 CustomAction 未执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21194398/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com