【发布时间】: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