WiX Learning - User Interface - Customize Built-in Dialog Set

来源:互联网 发布:前端页面优化方法 编辑:程序博客网 时间:2024/06/05 08:34

1.      Specify a licensefile

Set WiX variable “WixUILicenseRtf” to your ownlicense file.

<WixVariable Id=’WixUILicenseRtf’ Value=’[path to license file]’>

 

Tips: WiX linker “light.exe” supportsan argument switch “-b” to add more looking for directories.

         light… -b”[path to directories]”-dWixUILicenseRtf=bobpl.rtf …

 

         There’sa known issue about blank RTF file content in UI, but with 2 workarounds forit.

l Resave RTF file in WordPad and rebuilt installer.

l Don’t use WixUI_Minimal dialog set.

2.      Replace texts

All texts displayed in built-in WiX dialog setscan be overridden with custom strings. You can go to WixUI_en-us.wxl in WiX installationfolder to get the whole list of these replaceable string IDs. To override anexpected string, you must specify that string ID in relative .wxl files withcustom text.

<String Id="WelcomeDlgDescription">

This is a custom welcome message.Click Next to continue or Cancel to exit.

</String>

3.      Replace bitmaps

In .wxs file, to specify your own bitmaps forbuilt-in dialogs.

<WixVariableId='WixUIBannerBmp'Value='../Resources/InstallerBanner.bmp' />

 

Variable name

Description

Dimensions

WixUIBannerBmp

Top banner

493 × 58

WixUIDialogBmp

Background bitmap used on the welcome and completion dialogs

493 × 312

WixUIExclamationIco

Exclamation icon on the WaitForCostingDlg

32 × 32

WixUIInfoIco

Information icon on the cancel and error dialogs

32 × 32

WixUINewIco

Button glyph on the BrowseDlg

16 × 16

WixUIUpIco

Button glyph on the BrowseDlg

16 × 16

4.      Insert a customdialog into a built-in dialog set

l Firstly you need to create the appearance of the custom dialogusing WiX elements.

It’s a good practice to define the customdialog in a separated .wxs file.

<Fragment>

<UI>

 <DialogId=’’ …>

<Control Id="Back" Type="PushButton"…>

 <Publish Event="NewDialog"Value="[WixUI_UserRegistrationDlgBack]">

1

</Publish>

</Control>

<Control Id="Next" Type="PushButton"…>

 <PublishEvent="NewDialog" Value="[WixUI_UserRegistrationDlgNext]">

ProductID

</Publish>

</Control>

 </Dialog>

</UI>

</Fragment>

l Then in major .wxs file, redefine the UI sequence.

<UIId="MyWixUI_Mondo">

<UIRef Id="WixUI_Mondo" />

<DialogRefId="UserRegistrationDlg" />

<Publish Dialog="LicenseAgreementDlg"

Control="Next"

Event="NewDialog"

Value="UserRegistrationDlg"

Order="2">LicenseAccepted= "1"

</Publish>

<PublishDialog="SetupTypeDlg"

Control="Back"

Event="NewDialog"

Value="UserRegistrationDlg">1

</Publish>

<Property Id="WixUI_UserRegistrationDlgBack">

LicenseAgreementDlg

</Property>

<PropertyId="WixUI_UserRegistrationDlgNext">

SetupTypeDlg

</Property>

</UI>

原创粉丝点击