這個應該是很容易,但幾個小時後我就空白了。 (根據條件在WiX中設置屬性
我做一個註冊表搜索(實際上是兩個),因爲我需要檢查前兩次安裝的要麼,然後安裝我的新文件的安裝被發現之前的位置
-
。
- 只有一個這些現有安裝的居然會存在。
然後我需要我的新文件安裝到「PROD#」被發現了「INSTALLLOCATION」。
<!— Look for the UnInstall key of the 1st possible product -->
<!— GUID = {E928E024-DEFE-41A7-8469-D338212C4943} -->
<Property Id='PROD1'>
<RegistrySearch Id='PROD_REG1'
Type='raw'
Root='HKLM'
Key='$(var.REGKEY_PROD1)'
Name='InstallLocation' />
</Property>
<!— Look for the UnInstall key of the 2nd possible product -->
<!— GUID = {A40A9018-DB9D-4588-A591-F012600C6300} -->
<Property Id='PROD2'>
<RegistrySearch Id='PROD_REG2'
Type='raw'
Root='HKLM'
Key='$(var.REGKEY_PROD2)'
Name='InstallLocation' />
</Property>
<!-- How do I set INSTALL_HERE Property to whichever ‘InstallLocation’ was found? -->
<!-- Define the directory structure -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALL_HERE">
<Directory Id="MAIN_DIRECTORY" Name="MyProduct"/>
<Directory Id="HELP_DIRECTORY" Name="Help"/>
</Directory>
</Directory>
所以你想找到創建1個安裝程序將安裝在哪一個頂部2種不同的產品? – 2009-11-06 20:31:57