我想模擬一個VS.net安裝MSI的InstallURL屬性......我已經到了WIX MSI將打開一個瀏覽器到我希望它去的下載頁面的地方。我認爲事情進展順利,因爲在我的測試機器上,當我沒有安裝MSXML6組件時打開網頁。然而,當我發現即使在安裝了組件的情況下打開網頁時,情況也變得很糟糕。爲什麼我的Wix財產不被評估?
我正在使用一個屬性w/RegistrySearch搜索MSXML6組件。然而,盡我所知,註冊表值甚至沒有被評估,因此它「總是」看起來沒有安裝。
這裏是我的WXS的相關部分:
<Property Id="MSXML6">
<RegistrySearch Id="MSXML6Search" Root="HKCR" Key="Msxml2.DOMDocument.6.0" Type="raw" />
</Property>
<Property Id="TEST">
<RegistrySearch Id="TESTSearch" Root="HKLM" Type="raw" Name="Version" Key="SOFTWARE\Microsoft\DirectX" />
</Property>
<Property Id="cmd.exe" Value="cmd.exe" />
<CustomAction Id="OpenMSXML6Download" Property="cmd.exe" ExeCommand="/c start http://www.microsoft.com/downloads/details.aspx?FamilyID=993c0bcf-3bcf-4009-be21-27e85e1857b1" Execute="immediate" Return="check" />
<CustomAction Id="OpenMSXML6DownloadError" Error="This component requires MSXML6. =[MSXML6]=[cmd.exe]=[TEST]= A web browser has been opened to the download page. Please install MSXML6 and then re-install the connector." />
<!-- installation execution sequence -->
<InstallExecuteSequence>
<!-- wires the error dialog to the downgrade event -->
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
<!-- execution to delete old install info after upgrade-->
<RemoveExistingProducts After="InstallValidate" />
<!-- Forces MSXML6 to be pre-installed -->
<!-- <Custom Action="OpenMSXML6Download" Before="FindRelatedProducts">NOT MSXML6</Custom> -->
<Custom Action="OpenMSXML6Download" Before="FindRelatedProducts">NOT MSXML6</Custom>
<Custom Action="OpenMSXML6DownloadError" After="OpenMSXML6Download">NOT MSXML6</Custom>
</InstallExecuteSequence>
<!-- ui information for the custom actions above. -->
<InstallUISequence>
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
<Custom Action="OpenMSXML6Download" Before="FindRelatedProducts">NOT MSXML6</Custom>
<Custom Action="OpenMSXML6DownloadError" After="OpenMSXML6Download">NOT MSXML6</Custom>
</InstallUISequence>
這樣做是如果沒有定義MSXML6然後打開網頁,然後打印自定義錯誤消息。請注意,我試圖在錯誤消息中打印屬性的值(我不確定這是否有效,但它似乎是。)我看到的文本顯示「此組件需要MSXML6。= = [cmd.exe] == ...「,所以它打印'cmd.exe'屬性的值,但不是其他兩個...也許這是因爲我明確定義了屬性,我不確定..無論如何,我還在調試時運行了MSI,並且在日誌文件中,我完全沒有看到MSXML6或TEST屬性的設置。我已確認註冊表值確實已設置,但我不是100%確定如何處理Msxml2註冊表項,因爲它沒有任何實際值,只有默認值。 (我假設離開'姓名'參數是正確的方式來處理這個。)
幫助??