2015-05-30 29 views
3

這個問題是問一個ICE57驗證器是否創建了一個誤報錯誤報告。爲什麼我們在每臺機器安裝中發現非廣告快捷方式的ICE57錯誤?

我使用WIX 3.9來生成安裝程序。我希望每臺機器都安裝了非廣告快捷方式。

這WXS例如安裝了一個文本文件和快捷方式,打開文本文件:

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Product Id="*" Name="ShortcutTest" Language="1033" 
      Version="1.0.0.0" Manufacturer="Widget Co" 
      UpgradeCode="--YOUR GUID1--"> 
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> 

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 
    <MediaTemplate EmbedCab="yes"/> 

    <Feature Id="ProductFeature" Title="ShortcutTest" Level="1"> 
     <ComponentRef Id="TextFile" /> 
     <ComponentRef Id="ShortCut" /> 
    </Feature> 

    <Directory Id="TARGETDIR" Name="SourceDir"> 
     <Directory Id="ProgramFilesFolder"> 
     <Directory Id="INSTALLFOLDER" Name="ShortcutTest"> 
      <Component Id="TextFile" Guid="--YOUR GUID2--"> 
      <File Id="File" Name="TextFile.txt" Source="TextFile.txt" KeyPath="yes"/> 
      </Component> 
     </Directory> 
     </Directory> 

     <Directory Id="ProgramMenuFolder"> 
     <Directory Id="ApplicationProgramsFolder" Name="Shortcut Test"> 
      <Component Id="ShortCut" Guid="--YOUR GUID3--"> 
      <RegistryValue Root="HKMU" Key="Software\WidgetCo\ReadMeTextFile\TextFile" Name="Installed" Type="string" Value="yes" KeyPath="yes"/> 
      <Shortcut Id="Shortcut" 
       Name="Open Text File" 
       Description="Opens a text file" 
       Target="[INSTALLFOLDER]TextFile.txt" 
       WorkingDirectory="INSTALLFOLDER"/> 
      <RemoveFolder Id="ApplicationProgramsFolder" Directory="ApplicationProgramsFolder" On="uninstall"/> 
      </Component> 
     </Directory> 
     </Directory> 
    </Directory> 
    </Product> 
</Wix> 

如果構建了上面的例子爲MSI包,你得到這個Internal Consistency Evaluator (ICE)錯誤:

D:\Robert\Documents\Visual Studio 2013\Projects\ShortcutTest\Product.wxs(27,0): error LGHT0204: ICE57: Component 'ShortCut' has both per-user data and a keypath that can be either per-user or per-machine.

ICE57意味着每個用戶和每臺機器的數據不一致。但是,組件的關鍵路徑是HKMU,它在每臺計算機安裝中都會解析爲HKLM(HKEY_LOCAL_MACHINE)。快捷方式的位置來自'ProgramMenuFolder',它在每臺機器安裝中解析爲C:\ProgramData\Microsoft\Windows\Start Menu\(在Windows 8.1上)。沒有一個組件的資源似乎有任何每個用戶的關聯。

您可以通過抑制ICE57將安裝程序包構建到MSI中。由此產生的MSI軟件包安裝時沒有任何明顯的錯誤。多個用戶可以登錄並訪問快捷方式。任何用戶都可以卸載軟件包,並刪除軟件包中的所有資源。

Wix create non advertised shortcut for all users/per machine的回答有一個有趣的解決方法,那就是爲作者製作廣告快捷方式,然後關閉廣告。似乎圍繞創建未公佈的快捷方式的一輪。

ICE57錯誤的常見修復方法是將<RegistryValue...>根改爲HKCU(HKEY_CURRENT_USER)。但是,這會創建一個安裝程序,可以在未安裝時留下用戶註冊表項。例如,如果用戶A安裝該軟件包,則會向用戶A的註冊表配置單元添加一個註冊表項。如果用戶B刪除了該程序包,則註冊表項不會從用戶A的註冊表配置單元中刪除。

在這種情況下,ICE57錯誤是內部一致性評估者中的一個錯誤嗎?或者有什麼我想念的東西?

回答

0

將您的快捷方式移至File的子項並添加Adversite="yes"屬性。 RegistryValue應該把從perUser到perMachine的快捷方式轉換成訣竅。

<Fragment> 
    <Directory Id="TARGETDIR" Name="SourceDir"> 
     <Directory Id="ProgramFilesFolder"> 
      <Directory Id="INSTALLFOLDER" Name="MyApp" /> 
     </Directory> 

     <Directory Id="ProgramMenuFolder" Name="Programs"> 
      <Directory Id="ApplicationProgramsFolder" Name="My App Name" /> 
     </Directory> 
    </Directory> 
</Fragment> 

<Fragment> 
    <ComponentGroup Id="ComponentGroup_Core"> 
     <Component Id="Component_App" Guid="INSERT_GUID_HERE" Directory="INSTALLFOLDER"> 

      <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[AppName]" 
          Name="AppInstalled" Type="string" Value="yes" KeyPath="yes"/> 

      <File Id="MyApp" Name="My Test App.txt"> 
       <Shortcut Id="Shortcut" 
          Name="Open Text File" 
          Description="Opens a text file" 
          Directory="ApplicationProgramsFolder" 
          WorkingDirectory="INSTALLFOLDER" /> 
      </File> 
     </Component> 
     <Component Id="Component_MenuFolder" Guid="INSERT_GUID_HERE" 
        Directory="ApplicationProgramsFolder"> 
      <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[AppName]" 
          Name="MenuFolderInstalled" Type="string" Value="yes" 
          KeyPath="yes"/> 
      <RemoveFolder Id="RemoveFolder_App" On="uninstall" /> 
     </Component> 
    </ComponentGroup> 
</Fragment> 
+0

這個答案改變了廣告的捷徑,這不是我正在尋找的答案。問題是關於ICE57和每臺機器安裝中未公佈的捷徑。您的回答確實突出顯示了我在問題中已修復的缺少的KeyPath屬性。 – bradfordrg

+0

您是對的,AFAIK無法解決PerMachine安裝中的ICE57和未公佈的快捷方式。我們可以完成的是在「所有用戶」文件夾中創建一個不像公佈的快捷方式的快捷方式(因爲它位於所有用戶中,並且不會觸發安裝),但它將被聲明爲如此。 – Marlos

+0

我認爲切換到廣告的主要區別在於:a)它使得難以找到快捷方式的目標,b)如果目標文件丟失,快捷方式會啓動安裝程序來修復組件。我大約90%確定這個特定的ICE57測試產生誤報錯誤。 – bradfordrg

2

雖然研究的另一個問題,我發現這個評論http://sourceforge.net/p/wix/mailman/message/26687047/羅布Mensching:

IIRC, this is a bug in ICE57. The Windows Installer team didn't look at ALLUSERS property when evaluating these values... that was a long time ago though so my memory may have decayed a bit.

它看起來像在ICE57的錯誤。

相關問題