对于基于 WiX 的安装程序,添加-删除卸载和 msiexec /x 无法相应工作

发布于 2024-11-17 06:29:00 字数 4226 浏览 2 评论 0原文

我的一些基于 WiX 的安装程序遇到了这种奇怪的行为。安装后,如果我尝试通过“添加删除程序”(Windows 7 中的程序和功能)使用右键单击菜单并选择“卸载”(这是默认的顺便说一句)来删除,它只会显示一个立即退出的进度对话框并且程序永远不会卸载并保持完整。

时也会出现相同的行为,

使用msiexec /x {ProductCode}

(或 Product.msi)

但是,使用右键单击菜单,选择更改,然后从维护对话框中,选择删除,可以完美卸载它。

以下是 InstallUISequence 和 InstallExecuteSequence 的代码:

<InstallUISequence>
    <Custom Before="CostFinalize" Action="CheckPreReqs" />
    <Show Dialog="MaintenanceWelcomeDlg" 
          Overridable="yes" 
          Sequence="1230">Installed And Not RESUME And Not Preselected And Not PATCH</Show>
</InstallUISequence>
<InstallExecuteSequence>
    <ScheduleReboot Sequence="6410">ISSCHEDULEREBOOT</ScheduleReboot>
    <LaunchConditions Sequence="410">Not Installed</LaunchConditions>
    <FindRelatedProducts Sequence="420">NOT ISSETUPDRIVEN</FindRelatedProducts>
    <AppSearch Sequence="400" />
    <CCPSearch Sequence="500">CCP_TEST</CCPSearch>
    <RMCCPSearch Sequence="600">Not CCP_SUCCESS And CCP_TEST</RMCCPSearch>
    <ValidateProductID Sequence="700" />
    <CostInitialize Sequence="800" />
    <FileCost Sequence="900" />
    <IsolateComponents Sequence="950" />
    <CostFinalize Sequence="1000" />
    <SetODBCFolders Sequence="1100" />
    <MigrateFeatureStates Sequence="1200" />
    <InstallValidate Sequence="1400" />
    <InstallInitialize Sequence="1501" />
    <AllocateRegistrySpace Sequence="1550">NOT Installed</AllocateRegistrySpace>
    <ProcessComponents Sequence="1600" />
    <UnpublishComponents Sequence="1700" />
    <UnpublishFeatures Sequence="1800" />
    <StopServices Sequence="1900">VersionNT</StopServices>
    <DeleteServices Sequence="2000">VersionNT</DeleteServices>
    <UnregisterComPlus Sequence="2100" />
    <SelfUnregModules Sequence="2200" />
    <UnregisterTypeLibraries Sequence="2300" />
    <RemoveODBC Sequence="2400" />
    <UnregisterFonts Sequence="2500" />
    <RemoveRegistryValues Sequence="2600" />
    <UnregisterClassInfo Sequence="2700" />
    <UnregisterExtensionInfo Sequence="2800" />
    <UnregisterProgIdInfo Sequence="2900" />
    <UnregisterMIMEInfo Sequence="3000" />
    <RemoveIniValues Sequence="3100" />
    <RemoveShortcuts Sequence="3200" />
    <RemoveEnvironmentStrings Sequence="3300" />
    <RemoveDuplicateFiles Sequence="3400" />
    <RemoveFiles Sequence="3500" />
    <RemoveFolders Sequence="3600" />
    <CreateFolders Sequence="3700" />
    <MoveFiles Sequence="3800" />
    <InstallFiles Sequence="4000" />
    <DuplicateFiles Sequence="4210" />
    <PatchFiles Sequence="4090" />
    <BindImage Sequence="4300" />
    <CreateShortcuts Sequence="4500" />
    <RegisterClassInfo Sequence="4600" />
    <RegisterExtensionInfo Sequence="4700" />
    <RegisterProgIdInfo Sequence="4800" />
    <RegisterMIMEInfo Sequence="4900" />
    <WriteRegistryValues Sequence="5000" />
    <WriteIniValues Sequence="5100" />
    <WriteEnvironmentStrings Sequence="5200" />
    <RegisterFonts Sequence="5300" />
    <InstallODBC Sequence="5400" />
    <RegisterTypeLibraries Sequence="5500" />
    <SelfRegModules Sequence="5600" />
    <RegisterComPlus Sequence="5700" />
    <InstallServices Sequence="5800">VersionNT</InstallServices>
    <StartServices Sequence="5900">VersionNT</StartServices>
    <RegisterUser Sequence="6000" />
    <RegisterProduct Sequence="6100" />
    <PublishComponents Sequence="6200" />
    <PublishFeatures Sequence="6300" />
    <PublishProduct Sequence="6400" />
    <InstallFinalize Sequence="6600" />
    <RemoveExistingProducts Sequence="1410" />
    <MsiPublishAssemblies Sequence="6250" />
    <MsiUnpublishAssemblies Sequence="1750" />
</InstallExecuteSequence>

如何解决此问题?

I’m facing this strange behavior for some of my WiX-based installers. After installation, if I try to remove via Add Remove Program (Programs and Features in Windows 7) using Right Click Menu and select Uninstall (This default BTW), it only shows a progress dialog which quits immediately and program never uninstalls and stays intact.

The Same behavior is there upon using

msiexec /x {ProductCode}

(or Product.msi)

However, using Right Click Menu, select Change and then from Maintenance Dialog Box, select Remove, uninstalls it perfectly.

Here is the code for InstallUISequence and InstallExecuteSequence:

<InstallUISequence>
    <Custom Before="CostFinalize" Action="CheckPreReqs" />
    <Show Dialog="MaintenanceWelcomeDlg" 
          Overridable="yes" 
          Sequence="1230">Installed And Not RESUME And Not Preselected And Not PATCH</Show>
</InstallUISequence>
<InstallExecuteSequence>
    <ScheduleReboot Sequence="6410">ISSCHEDULEREBOOT</ScheduleReboot>
    <LaunchConditions Sequence="410">Not Installed</LaunchConditions>
    <FindRelatedProducts Sequence="420">NOT ISSETUPDRIVEN</FindRelatedProducts>
    <AppSearch Sequence="400" />
    <CCPSearch Sequence="500">CCP_TEST</CCPSearch>
    <RMCCPSearch Sequence="600">Not CCP_SUCCESS And CCP_TEST</RMCCPSearch>
    <ValidateProductID Sequence="700" />
    <CostInitialize Sequence="800" />
    <FileCost Sequence="900" />
    <IsolateComponents Sequence="950" />
    <CostFinalize Sequence="1000" />
    <SetODBCFolders Sequence="1100" />
    <MigrateFeatureStates Sequence="1200" />
    <InstallValidate Sequence="1400" />
    <InstallInitialize Sequence="1501" />
    <AllocateRegistrySpace Sequence="1550">NOT Installed</AllocateRegistrySpace>
    <ProcessComponents Sequence="1600" />
    <UnpublishComponents Sequence="1700" />
    <UnpublishFeatures Sequence="1800" />
    <StopServices Sequence="1900">VersionNT</StopServices>
    <DeleteServices Sequence="2000">VersionNT</DeleteServices>
    <UnregisterComPlus Sequence="2100" />
    <SelfUnregModules Sequence="2200" />
    <UnregisterTypeLibraries Sequence="2300" />
    <RemoveODBC Sequence="2400" />
    <UnregisterFonts Sequence="2500" />
    <RemoveRegistryValues Sequence="2600" />
    <UnregisterClassInfo Sequence="2700" />
    <UnregisterExtensionInfo Sequence="2800" />
    <UnregisterProgIdInfo Sequence="2900" />
    <UnregisterMIMEInfo Sequence="3000" />
    <RemoveIniValues Sequence="3100" />
    <RemoveShortcuts Sequence="3200" />
    <RemoveEnvironmentStrings Sequence="3300" />
    <RemoveDuplicateFiles Sequence="3400" />
    <RemoveFiles Sequence="3500" />
    <RemoveFolders Sequence="3600" />
    <CreateFolders Sequence="3700" />
    <MoveFiles Sequence="3800" />
    <InstallFiles Sequence="4000" />
    <DuplicateFiles Sequence="4210" />
    <PatchFiles Sequence="4090" />
    <BindImage Sequence="4300" />
    <CreateShortcuts Sequence="4500" />
    <RegisterClassInfo Sequence="4600" />
    <RegisterExtensionInfo Sequence="4700" />
    <RegisterProgIdInfo Sequence="4800" />
    <RegisterMIMEInfo Sequence="4900" />
    <WriteRegistryValues Sequence="5000" />
    <WriteIniValues Sequence="5100" />
    <WriteEnvironmentStrings Sequence="5200" />
    <RegisterFonts Sequence="5300" />
    <InstallODBC Sequence="5400" />
    <RegisterTypeLibraries Sequence="5500" />
    <SelfRegModules Sequence="5600" />
    <RegisterComPlus Sequence="5700" />
    <InstallServices Sequence="5800">VersionNT</InstallServices>
    <StartServices Sequence="5900">VersionNT</StartServices>
    <RegisterUser Sequence="6000" />
    <RegisterProduct Sequence="6100" />
    <PublishComponents Sequence="6200" />
    <PublishFeatures Sequence="6300" />
    <PublishProduct Sequence="6400" />
    <InstallFinalize Sequence="6600" />
    <RemoveExistingProducts Sequence="1410" />
    <MsiPublishAssemblies Sequence="6250" />
    <MsiUnpublishAssemblies Sequence="1750" />
</InstallExecuteSequence>

How do I fix this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心不设防 2024-11-24 06:29:01

您很可能在 InstallUISequence 期间尝试执行“操作”(不会从 ARP 或 msiexec /x 显示),并且您(错误地)需要用户界面并在此处执行步骤,如下所示与在 InstallExecuteSequence 期间执行它们相反。

如果您使用 Orca 检查这两个序列,您应该能够识别有问题的操作。

Chances are that you are attempting to do "stuff" during the InstallUISequence (which doesn't display from ARP or msiexec /x) and you are (incorrectly) requiring a User Interface and performing steps here, as opposed to performing them during the InstallExecuteSequence

If you inspect the two sequences using Orca, you should be able to identify the problematic actions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文