反复自愈; msi安装程序事件1001

时间:2014-01-16 16:59:39

标签: wix windows-installer

我有一个已安装的产品,它已经进入一种状态,其中广告的快捷方式将触发自我修复两次然后退出。这一切都以前工作正常,但现在卸载也不会删除文件,我似乎无法恢复到干净的状态。

当触发自我修复时,会出现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

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

3 个答案:

答案 0 :(得分:1)

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

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

答案 1 :(得分:1)

写完下面的答案后,我发现我之前已经回答了类似的问题。 我认为影响您的软件包的问题是,有一个密钥路径设置为安装到userprofile的文件。请在此处查看完整详细信息:How can I determine what causes repeated Windows Installer self-repair?。我将把下面的答案作为解释问题的替代方法。


此应用程序的名称是什么?由于组件的键路径,会出现周期性自我修复的情况设置为空文件夹,而不是文件的完整路径。除非在MSI中为该文件夹添加 CreateFolder 条目,否则Windows Installer会删除空文件夹。非常荒谬,但这就是技术的运作方式。

我多年没有看到这个问题,但这大致发生了什么:

  1. 缺少组件密钥路径
  2. 调用广告的快捷方式
  3. 通过密钥路径检查发现组件丢失,并计划安装
  4. 安装过程中出现问题,但仍然缺少关键路径
  5. 下次调用广告快捷方式时,自我修复会重复循环无效
  6. 出现这种情况的一个原因是,由于某种原因,目标位置是写保护。还有其他情况,例如当目标位置被硬编码到用户配置文件中对于登录用户不存在的位置时 - 例如另一个用户配置文件:

    • C:\用户\用户\ MyFile.ini
    • C:\用户\ AnotherUser \ MyFile.ini

    以下是关于自我修复问题的全面解释:http://www.installsite.org/pages/en/msifaq/a/1037.htm

答案 2 :(得分:0)

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

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