2010-11-17 103 views
2

我是WiX的新手,並嘗試通過添加新對話框來自定義對話框隊列。新對話框的名稱是ServerChoice和流程是:WiX中的新對話框,點擊返回跳過對話框

SetupTypeDlg < - >完整或典型< - > ServerChoice < - > VerifyReadyDlg

SetupTypeDlg < - >自定義< - > CustomizeDlg < - > ServerChoice < - > VerifyReadyDlg

唯一的問題是在VerifyReadyDlg的第一種情況。 「返回」將我帶到SetupTypeDlg並跳過ServerChoice,儘管在第二個流程中它可以根據需要運行。

來源:

<UI> 
     <DialogRef Id="ServerChoice" /> 
     <Publish Dialog="SetupTypeDlg" Control="TypicalButton" Event="NewDialog" Value="ServerChoice">1</Publish> 
     <Publish Dialog="SetupTypeDlg" Control="CompleteButton" Event="NewDialog" Value="ServerChoice">1</Publish> 
     <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ServerChoice">1</Publish> 
     <Publish Dialog="ServerChoice" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> 
     <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ServerChoice">1</Publish> 
     <Publish Dialog="ServerChoice" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">WixUI_InstallMode = "InstallCustom"</Publish> 
     <Publish Dialog="ServerChoice" Control="Back" Event="NewDialog" Value="SetupTypeDlg" Order="2">WixUI_InstallMode = "InstallTypical" OR WixUI_InstallMode = "InstallComplete"</Publish> 
     <Publish Dialog="ServerChoice" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="3">WixUI_InstallMode = "Change"</Publish> 
     <Publish Dialog="ServerChoice" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="4">WixUI_InstallMode = "Repair" OR WixUI_InstallMode = "Remove"</Publish> 
    </UI> 

一些幫助的新手? :)

+0

在我看來,這裏有一些缺失的信息。如果您還包含WiX提供的發佈條目,則會有2個發佈條目用於VerifyReadyDlg後退按鈕。您可以嘗試使用Orca或InstEdit查看MSI的ControlCondition表,或者使用Wix的dark.exe來反編譯MSI並查看生成的WiX文件,以確保您沒有VerifyReadyDlg後退按鈕的多個事件。 – 2010-11-17 16:14:25

+0

感謝您的回覆。似乎你是對的,我發現以下內容: VerifyReadyDlg |返回| NewDialog | SetupTypeDlg | WixUI_InstallMode =「InstallTypical」或WixUI_InstallMode =「InstallComplete」 和 VerifyReadyDlg |返回| NewDialog | ServerChoice | 1 如何使用WiX刪除第一個? – Cyril 2010-11-18 09:09:26

+0

grrr ...不能作爲代碼出來。我應該使用哪個標籤?去閱讀手冊... – Cyril 2010-11-18 09:16:22

回答

4

您引用的是哪種類型的用戶界面(Mondo?)。此信息不在您的代碼片段中。我認爲daddyman的評論是正確的,你可能有多個Back按鈕事件,因爲Mondo本身在這個按鈕點擊事件上掛鉤了它自己的'處理程序'。

我最近創建了一個自定義的UI對話框流程,我的方法根本沒有引用WiXUI_Mondo。取而代之的是,我創建了基於Mondo源代碼的自己的新用戶界面(您必須查看WiX源代碼)。最後我有這個代碼(不相關的代碼部分已被刪除),它工作正常。

<Fragment> 
    <!-- this is based on the WixUI_Mondo dialog set --> 
    <UI Id="WixUI_MyNewUI"> 
     <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> 
     <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> 
     <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> 

     <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" /> 
     <Property Id="WixUI_Mode" Value="Mondo" /> 

     <DialogRef Id="ErrorDlg" /> 
     <DialogRef Id="FatalError" /> 
     <DialogRef Id="FilesInUse" /> 
     <DialogRef Id="MsiRMFilesInUse" /> 
     <DialogRef Id="PrepareDlg" /> 
     <DialogRef Id="ProgressDlg" /> 
     <DialogRef Id="ResumeDlg" /> 
     <DialogRef Id="UserExit" /> 

     <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg">1</Publish> 
     <!-- we do not use the SetupTypeDlg which allows user to choose either Typical, Complete or Custom installation; this ensures InstallCustom schema is run --> 
     <Publish Dialog="WelcomeDlg" Control="Next" Property="WixUI_InstallMode" Value="InstallCustom" Order="2">1</Publish> 

     <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">WixUI_InstallMode = "InstallCustom"</Publish> 
     <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="MyDlg1">1</Publish> 

     <Publish Dialog="MyDlg1" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="1">MY_CONDITION_PROPERTY = 0</Publish> 
     <Publish Dialog="MyDlg1" Control="Next" Event="NewDialog" Value="MyDlg2" Order="2">MY_CONDITION_PROPERTY = 1</Publish> 

     <Publish Dialog="MyDlg2" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="1" /> 
     <Publish Dialog="MyDlg2" Control="Back" Event="NewDialog" Value="MyDlg1">1</Publish> 


     <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MyDlg1" Order="1">WixUI_InstallMode = "InstallCustom" and MY_CONDITION_PROPERTY = 0</Publish> 
     <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MyDlg2" Order="2">WixUI_InstallMode = "InstallCustom" and MY_CONDITION_PROPERTY = 1</Publish>  
    </UI> 

    <UIRef Id="WixUI_Common" /> 
    <UIRef Id="WixUI_ErrorProgressText" /> 
</Fragment> 

+2

謝謝。你的代碼幫助我找到最短的解決方案。添加Order =「2」解決了這個問題。正確的條目是: ' 1' – Cyril 2010-11-18 09:53:03