2013-06-24 92 views
2

我刻錄內置變量WixBundleProviderKey時出現問題。我需要將此變量的值傳遞給msi包。我的問題是這個變量的值沒有被評估,並且msi只會收到一個空字符串。我用其他內置變量進行了測試,並且按預期工作。無法將WixBundleProviderKey變量傳遞給msipackage

任何想法爲什麼這不起作用?有沒有解決方法?

例子:

<Fragment> 
    <PackageGroup Id="Test" > 
     <MsiPackage Id="Test" 
      DisplayName="Test 4.10.0002" 
      DisplayInternalUI="no" 
      Visible="no" 
      SourceFile=".\Template\ProductsToInstall\Test\Test 4.10.msi" 
      Name="Test\Test 4.10.msi" 
      Cache="yes" 
      CacheId="Test 4.10" 
      Compressed="no" 
      Vital="yes" 
      Permanent="no"> 

      <MsiProperty Name="BURN_WIXBUNDLEORIGINALSOURCE" Value="[WixBundleOriginalSource]" /> 
      <MsiProperty Name="BURN_COMMONAPPDATAFOLDER" Value="[CommonAppDataFolder]" /> 
      <MsiProperty Name="BURN_WIXBUNDLEPROVIDERKEY" Value="[WixBundleProviderKey]" /> 
     </MsiPackage> 
    </PackageGroup> 
</Fragment> 

在此先感謝

回答

0

不完全是這個問題的答案,但也許它幫助。 在我來說,我需要傳遞的值WixBundleProviderKey變量微星去我BundeSetup.exe,這是在「COMMONAPPDATAFOLDER \包緩存\ WixBundleProviderKey」目錄緩存的完整路徑。爲此,我在msi中創建了一個FileSearch元素的屬性,提供搜索文件的完整路徑。

<Property Id="BUNDLECACHEPATH"> 
    <DirectorySearch Id="BundleDirSearch" Path="[CommonAppDataFolder]Package Cache" Depth="1"> 
    <FileSearch Name="BundleSetup.exe" /> 
    </DirectorySearch> 
</Property> 
+0

沒有太多有效的解決方案,」。看到我的另一個答案。 – snapsh0t

0

試試這個把戲。 您可以創建名爲「BUNDLE_KEY」新的變量(例如)

<Variable Name="BUNDLE_KEY" Type="string" Value="[WixBundleProviderKey]" /> 

然後這個變量適用於MsiProperty:

<MsiProperty Name="YOU_PROPERTY_IN_MSI" Value="[BUNDLE_KEY]" /> 

我希望這會幫助你。

0

好像只有這樣才能在標準引導程序的應用通過WixBundleProviderKey值是通過它通過InstallFolder變量:

<Variable Name="InstallFolder" Value="[WixBundleProviderKey]" /> 

另一個解決方案是將它傳遞路徑內的束設置

<util:DirectorySearch Path="[TempFolder][WixBundleProviderKey]" Variable="KeyPath" /> 

<MsiProperty Name="BUNDLE_KEY" Value="[KeyPath]" /> 

方式噸:通過DirectorySearch元件變量temp文件o得到WixBundleProviderKey在你的msi中從[BUNDE_KEY]屬性值實現C#自定義動作使用String.Substring()方法。並把它放在InstallUISequence之前AppSearch事件 - 如果你想使用RegistrySearch元素中獲得的值。