【问题标题】:recurring self healing; msi installer event 1001反复出现的自我修复; MSI 安装程序事件 1001
【发布时间】:2014-01-16 16:59:38
【问题描述】:

我有一个安装的产品不知何故进入了广告快捷方式将触发自我修复两次然后退出的状态。这一切过去都可以正常工作,但现在卸载也不会删除文件,而且我似乎无法恢复到干净状态。

当触发自我修复时,会出现 MsiInstaller 1001 警告事件:Detection of product '{79D7389C-5858-48EE-B250-E84E789F8683}', feature 'CurrentUser' failed during request for component '{789CBE30-0F16-46CA-BA06-464AD61A458E}'

组件 GUID 是我的 MainExe 组件:

<Component Id="MainExe" Guid="{789CBE30-0F16-46CA-BA06-464AD61A458E}">
   <File Id="MyProgram.exe" Name="MyProgram.exe" Source="MyProgram.exe" KeyPath="yes" />
   <Shortcut Id="StartMenuShortcut" Name="My Program" Directory="StartMenuDir" Icon="Icon.exe" IconIndex="0" Advertise="yes" WorkingDirectory="APPLICATIONROOTDIRECTORY" />
   <Shortcut Id="DesktopShortcut" Name="My Program" Directory="DesktopFolder" Icon="Icon.exe" IconIndex="0" Advertise="yes" WorkingDirectory="APPLICATIONROOTDIRECTORY" />
</Component>

没有其他警告事件。

初始安装的 MSI 日志显示:

MSI (s) (CC:64) [10:46:53:357]: Feature: CurrentUser; Installed: Absent;   Request: Local;   Action: Local
MSI (s) (CC:64) [10:46:53:357]: Feature: CoreFiles; Installed: Absent;   Request: Local;   Action: Local
MSI (s) (CC:64) [10:46:53:357]: Feature: InstallerUI; Installed: Absent;   Request: Local;   Action: Local
MSI (s) (CC:64) [10:46:53:357]: Component: MainExe; Installed: Absent;   Request: Local;   Action: Local;   Client State: Unknown

但修复的 MSI 日志显示:

MSI (s) (CC:EC) [10:47:50:769]: Feature: CurrentUser; Installed: Advertise;   Request: Local;   Action: Local
MSI (s) (CC:EC) [10:47:50:770]: Feature: CoreFiles; Installed: Advertise;   Request: Local;   Action: Local
MSI (s) (CC:EC) [10:47:50:770]: Feature: InstallerUI; Installed: Advertise;   Request: Local;   Action: Local
MSI (s) (CC:EC) [10:47:50:770]: Component: MainExe; Installed: Absent;   Request: Local;   Action: Local;   Client State: Unknown

我尝试运行Unadvertise Features script,但它告诉我:

$ cscript.exe //nologo Unadvertise.wsf /ProductCode:{79D7389C-5858-48EE-B250-E84E789F8683}
Checking if product {79D7389C-5858-48EE-B250-E84E789F8683} is installed
Product {79D7389C-5858-48EE-B250-E84E789F8683} is installed as AAA My Program
Checking for advertised features in product {79D7389C-5858-48EE-B250-E84E789F8683}
Found feature CurrentUser : Local
Found feature CoreFiles : Local
Found feature InstallerUI : Local
Product {79D7389C-5858-48EE-B250-E84E789F8683} does not have advertised features

如何诊断问题,或至少清理此产品的状态?同样,现在卸载不会删除文件,也不能解决问题。

【问题讨论】:

  • 您是否进行了升级?也许那是在 MigrateFeatureStates 标准操作期间,按照宣传的方式安装功能的时刻,从以前的版本继承了功能安装状态。关于清理机器,这可能很棘手,没有确切的解决方案,通常我在 VM 上进行测试,以便在包损坏时轻松恢复快照。

标签: wix windows-installer


【解决方案1】:

我认为我做错的是使用no longer available MSI cleanup util,它与MSIZAP 相同或相似,它可以使您的MSI 数据库失效。

放弃尝试修复我的机器,现在我在 VM 中进行所有 MSI 测试。

【讨论】:

【解决方案2】:

写完下面的答案后,我发现我以前回答过类似的帖子。 我认为影响您的程序包的问题是安装到用户配置文件的文件设置了一个关键路径。在此处查看完整详细信息:How can I determine what causes repeated Windows Installer self-repair?。我将在下面留下答案作为解释问题的另一种方式。


此应用程序的名称是什么?存在周期性自我修复的情况,因为组件的key-path设置为空文件夹,而不是文件的完整路径。 Windows Installer 倾向于删除空文件夹,除非您在 MSI 中为该文件夹添加 CreateFolder 条目。很荒谬,但这就是技术的工作原理。

我已经好几年没看到这个问题了,但大致是这样的:

  1. 缺少组件键路径
  2. 广告的快捷方式被调用
  3. keypath 检查发现某个组件缺失并计划安装
  4. 安装过程中出现问题,密钥路径仍然缺失
  5. 下次调用通告的快捷方式时,自我修复重复循环无济于事

发生这种情况的一个原因是目标位置是否出于某种原因被写保护。还有其他情况,例如当目标位置被硬编码到用户配置文件中的位置时,登录用户不存在 - 例如另一个用户配置文件:

  • C:\Users\User\MyFile.ini
  • C:\Users\AnotherUser\MyFile.ini

这里有一个很好的关于自愈问题的全面解释:http://www.installsite.org/pages/en/msifaq/a/1037.htm

【讨论】:

    【解决方案3】:

    如果没有其他帮助,您始终可以手动删除应用程序(例如删除所有所属文件和快捷方式)并使用 MSIZAP 更正安装程序数据库(较新版本不推荐使用、不受​​支持且不安全的工具Windows 版本。2017 年 8 月)。

    然后再次安装 MSI 并检查错误是否仍然存在,如果是,则 MSI 本身有问题。

    【讨论】:

    • MSIZAP 是 dangerous,或多或少是我让自己陷入这种混乱的原因。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-15
    • 1970-01-01
    • 1970-01-01
    • 2023-03-25
    • 1970-01-01
    相关资源
    最近更新 更多