[wix-users] moving UI code into a fragment in separate source file

Alan Sinclair anadem at gmail.com
Sat Sep 30 21:30:06 PDT 2017


I'm going to need to extend the installer UI so want to move that code into
a separate source file, gui.wxs. I assume it will be a fragment but how do
I reference it so it's included in the MSI? (Sorry, this feels like a
really dumb question!)

My current UI code is inside <Product>  </Product>, so presumably a
reference to the new fragment should go in its place.
At present main.wxs is like this:

<Product Id= ... etc>
    <!-- lots of stuff snipped from here -->
        <Feature Id='Complete' Title='Client' Description='The complete
package.'
            Display='expand' Level='1'
ConfigurableDirectory='APPLICATIONROOTDIRECTORY'>
            <ComponentRef Id='cmp_Clientexe' />
            <FeatureRef Id='feat_Core' />
            <FeatureRef Id='feat_Localization' />
        </Feature>

        <WixVariable Id="WixUILicenseRtf" Value=".\EndUserLicense.rtf" />
        <WixVariable Id="WixUIDialogBmp" Value=".\mydialog.bmp" />
        <UIRef Id="WixUI_Minimal" />
        <UIRef Id="WixUI_ErrorProgressText" />
        <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT"
Value="!(loc.StartClientMsg)" />
        <Property Id="WixShellExecTarget" Value="[#fil_Client.exe]" />
        <CustomAction Id="LaunchApplication" BinaryKey="WixCA"
DllEntry="WixShellExec" Impersonate="yes" />
        <UI>
            <UIRef Id="WixUI_Minimal" />
            <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction"
Value="LaunchApplication">
                WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed
            </Publish>
        </UI>
</Product>
</Wix>


If the gui.wxs file has the following (it will get more), what goes in
main.wxs?

<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
    <Fragment Id="WsGUI">
        <WixVariable Id="WixUILicenseRtf" Value=".\EndUserLicense.rtf" />
        <WixVariable Id="WixUIDialogBmp" Value=".\aldialog.bmp" />
        <UIRef Id="WixUI_Minimal" />
        <UIRef Id="WixUI_ErrorProgressText" />
        <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT"
Value="!(loc.StartClientMsg)" />
        <Property Id="WixShellExecTarget" Value="[#fil_Client.exe]" />
        <CustomAction Id="LaunchApplication" BinaryKey="WixCA"
DllEntry="WixShellExec" Impersonate="yes" />
        <UI>
            <UIRef Id="WixUI_Minimal" />
            <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction"
Value="LaunchApplication">
                WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed
            </Publish>
        </UI>
    </Fragment>
</Wix>



many thanks
Alan


More information about the wix-users mailing list