安装的自定义操作在卸载时执行

时间:2013-06-21 10:46:20

标签: wix custom-action

我有以下WiX XML文件:

    <Binary Id='IISCustomActionBinary' SourceFile='$(var.Setup.CustomActions.TargetDir)$(var.Setup.CustomActions.TargetName).CA.dll' />
    <CustomAction Id='IISCustomActionInstall' BinaryKey='IISCustomActionBinary' DllEntry='ConfigureIis' Execute='deferred'/>
    <CustomAction Id='IISCustomActionUninstall' BinaryKey='IISCustomActionBinary' DllEntry='UnconfigureIis' Execute='deferred' />
    <InstallExecuteSequence>
        <Custom Action='IISCustomActionInstall' Before='InstallFinalize'>
            NOT INSTALLED
        </Custom>
        <Custom Action='IISCustomActionUninstall' Before='InstallFinalize'>
            (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")
        </Custom>
    </InstallExecuteSequence>

“IISCustomActionInstall”自定义操作不仅在安装时执行,还在卸载时执行。我做错了什么?

1 个答案:

答案 0 :(得分:3)

您应该使用的变量是Installed。如果我没有弄错的话,Windows Installer会将INSTALLED识别为单独的用户定义变量。