2014-07-10 60 views
1

我是WiX的新手,我一直在爲使用WiX的應用程序創建安裝程序。我已經正確安裝了大部分應用程序和依賴項,但目前它沒有任何UI。如何將兩個許可協議添加到安裝程序?

我想添加一個簡單的嚮導界面,並且已經閱讀了關於最小配置和其他配置,但我有一個稍微不尋常的要求,我需要兩個不同的許可證樣式協議。第一個許可協議是標準許可,第二個是處理政府出口限制。

我一直在搜索有關如何在WiX中設置許可協議的信息,但我不確定如何添加兩個單獨的屏幕,用戶必須同意繼續?你能否解釋一下如何將兩個.RTF文件添加爲許可協議嚮導頁面?除此之外,我不需要複雜的用戶界面,也沒有可選的功能等。

回答

1

我們所做的是下載source,然後複製現有許可證對話框並對其進行修改(我們希望發佈說明對話框,因此我們關閉了大部分控制)。

然後我們複製並修改WixMinimalUI設置爲包含對話框。以下是我們的發行說明對話框的一個示例,您希望取消註釋掉註釋掉的控件並處理它們的使用。另外,我們在自己的項目中創建了這個項目,以便其他安裝程序可以使用它,我們添加了一個預處理器變量releaseNotesRtf,然後可以從其他項目中設置該變量,此變量是第二個rtf文檔的路徑。

<Fragment> 
<UI> 
    <Dialog Id="ReleaseNotesDlg" Width="370" Height="270" Title="!(loc.LicenseAgreementDlg_Title)"> 
    <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.LicenseAgreementDlgBannerBitmap)" /> 
    <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" /> 
    <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" /> 
    <!--<Control Id="Description" Type="Text" X="25" Y="23" Width="340" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.LicenseAgreementDlgDescription)" />--> 
    <!--<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.LicenseAgreementDlgTitle)" />--> 
    <!--<Control Id="LicenseAcceptedCheckBox" Type="CheckBox" X="20" Y="207" Width="330" Height="18" CheckBoxValue="1" Property="LicenseAccepted" Text="!(loc.LicenseAgreementDlgLicenseAcceptedCheckBox)" />--> 
    <Control Id="Print" Type="PushButton" X="112" Y="243" Width="56" Height="17" Text="!(loc.WixUIPrint)"> 
     <Publish Event="DoAction" Value="WixUIPrintEula">1</Publish> 
    </Control> 
    <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" /> 
    <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)"> 
     <Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish> 
     <!--<Condition Action="disable"><![CDATA[LicenseAccepted <> "1"]]></Condition> 
     <Condition Action="enable">LicenseAccepted = "1"</Condition>--> 
    </Control> 
    <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)"> 
     <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish> 
    </Control> 
    <Control Id="LicenseText" Type="ScrollableText" X="20" Y="60" Width="330" Height="140" Sunken="yes" TabSkip="no"> 
     <Text SourceFile="!(wix.WixUIReleaseNotesRtf=$(var.releaseNotesRtf))" /> 
    </Control> 
    </Dialog> 
</UI> 



    <UI Id="WixUI_MinimalReleaseNotes"> 
    <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="Minimal" /> 

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

    <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish> 

    <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish> 
    <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish> 

    <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish> 
    <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="ReleaseNotesDlg">LicenseAccepted = "1"</Publish> 

    <Publish Dialog="ReleaseNotesDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish> 
    <Publish Dialog="ReleaseNotesDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> 

    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ReleaseNotesDlg" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish> 
    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish> 
    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish> 

    <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish> 

    <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> 
    <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> 
    <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish> 


    </UI> 

    <UIRef Id="WixUI_Common" /> 
</Fragment> 
+0

謝謝我會研究這個問題,你能向我解釋這些UI集合中的第一個對話框如何被調用嗎?我看到Next按鈕調用新的對話框,但第一個對話框呢? – Alan

+0

我真的不知道WiX如何確定首先調用哪個對話框,因爲我們只是修改了現有的代碼,我們不需要弄清楚,但知道這很有趣。 –

相關問題