How to build a minimal WiX installer UI without a license page?
Asked Answered
K

5

77

I would like to use the WixUI_Minimal installer, but I don't want the license page. How can I do this?

Kabyle answered 27/2, 2009 at 23:5 Comment(0)
K
61

The key is to make a custom UI and hook up different pages. See the page on WixWiki

You want to grab the WixUI minimal code, and modify it a bit. Instead of the WelcomeEulaDlg welcome dialog, you want to use the WelcomeDlg. Adjust the references, and wire up the Next button on the WelcomeDlg to the next dialog in the stack, which would be the PrepareDlg.

Full Code:

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

    <!-- This is the welcome dialog you specified-->
    <DialogRef Id="WelcomeDlg" /> 

    <!-- Hook the new welcome dialog to the next one in the stack-->
    <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="PrepareDlg">1</Publish> 

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

    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">1</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>

    <Property Id="ARPNOMODIFY" Value="1" />
  </UI>

  <UIRef Id="WixUI_Common" />
Kabyle answered 27/2, 2009 at 23:21 Comment(9)
Thank you, I knew what I had to do, but I didn't know what to set the Next dialog after WelcomeDlg. Where can I find what the dialog stack is? How could I have figured out that the next dialog after WelcomeDlg should be PrepareDlg?Birdsall
I have an issue with the code above and launch application that also use ExitDialog <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">NOT WIXUI_EXITDIALOGOPTIONALCHECKBOX and NOT Installed</Publish> the application didn't closed properlySalamander
Anyone try this and get "The Windows Installer XML variable !(wix.WixUICostingPopupOptOut) is unknown. Please ensure the variable is declared on the command line for light.exe"?Excitable
I used the code above (from 2009) and got "The Windows Installer XML variable !(wix.WixUICostingPopupOptOut) is unknown. To resolve this I got the latest source and copied the fragment \src\ext\UIExtension\wixlib\WixUI_Minimal.wxs. Then removed the <DialogRef Id="WelcomeEulaDlg" /> and added the new DialogRef and Publish as per Adam's answer.Excitable
The wixwiki link is broken.Homelike
I am getting error:Unresolved reference to symbol 'Dialog:ErrorDlg' in section 'Product:{07CDD126-8D87-46CF-87B0-8731980619FA}'.Kindly help.Luteolin
Cut, paste, BOOYA! ... +1Dermato
Works like a charm - 28/7/2015Trevelyan
In Wix 3.11.0 using Visual Studio, you get an error "Duplicate Symbol WixUI:WixUI_Minimal ..." To fix just find and replace WixUI_Minimal with WixUI_CustomMinimal in your above code chunk and then in your main product do a <UIRef Id="WixUI_CustomMinimal" />Fraley
D
94

I would simply use one of the already created WiX UI and override the sequence (make it higher so that it will override the previous setting):

    <Product> 
        ...
        <UI>
            <UIRef Id="WixUI_InstallDir" />

            <!-- Skip license dialog -->
            <Publish Dialog="WelcomeDlg"
                     Control="Next"
                     Event="NewDialog"
                     Value="InstallDirDlg"
                     Order="2">1</Publish>
            <Publish Dialog="InstallDirDlg"
                     Control="Back"
                     Event="NewDialog"
                     Value="WelcomeDlg"
                     Order="2">1</Publish>
        </UI>

        <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
        ...
    </Product>
Danidania answered 9/2, 2011 at 17:31 Comment(6)
This answer would be better if it explained where to put the UI tagNumerary
@Numerary I put the <UI> element into the <Product> element, that worked fine.Formalin
@Justin The UI & UIRef stuff apparently can't be the first element under Product. I have no idea why, but it failed for me too until I had something above it. Not sure if it is the same error.Kissiah
does not compile: error LGHT0091: Duplicate symbol 'ControlEvent:WelcomeDlg/Next/NewDialog/VerifyReadyDlg/Installed AND PATCH' found. This typically means that an Id is duplicated. Check to make sure all your identifiers of a given type (File, Component, Feature) are unique. ... and so forthTum
@Justin: For error code 2819 see https://mcmap.net/q/104590/-wix-installer-failing-error-code-2819Reynolds
For me this didn't work, as the installer /sometimes/ (dunno when) told users, to their surprise, C: was not actually a local hard disk. I copied all of the content of the <UI> Element from src/ext/UIExtension/wixlib/WixUI_InstallDir.wxs and made these adjustments there, without the "Order" attributes, which worked well.Dissociation
K
61

The key is to make a custom UI and hook up different pages. See the page on WixWiki

You want to grab the WixUI minimal code, and modify it a bit. Instead of the WelcomeEulaDlg welcome dialog, you want to use the WelcomeDlg. Adjust the references, and wire up the Next button on the WelcomeDlg to the next dialog in the stack, which would be the PrepareDlg.

Full Code:

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

    <!-- This is the welcome dialog you specified-->
    <DialogRef Id="WelcomeDlg" /> 

    <!-- Hook the new welcome dialog to the next one in the stack-->
    <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="PrepareDlg">1</Publish> 

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

    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">1</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>

    <Property Id="ARPNOMODIFY" Value="1" />
  </UI>

  <UIRef Id="WixUI_Common" />
Kabyle answered 27/2, 2009 at 23:21 Comment(9)
Thank you, I knew what I had to do, but I didn't know what to set the Next dialog after WelcomeDlg. Where can I find what the dialog stack is? How could I have figured out that the next dialog after WelcomeDlg should be PrepareDlg?Birdsall
I have an issue with the code above and launch application that also use ExitDialog <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">NOT WIXUI_EXITDIALOGOPTIONALCHECKBOX and NOT Installed</Publish> the application didn't closed properlySalamander
Anyone try this and get "The Windows Installer XML variable !(wix.WixUICostingPopupOptOut) is unknown. Please ensure the variable is declared on the command line for light.exe"?Excitable
I used the code above (from 2009) and got "The Windows Installer XML variable !(wix.WixUICostingPopupOptOut) is unknown. To resolve this I got the latest source and copied the fragment \src\ext\UIExtension\wixlib\WixUI_Minimal.wxs. Then removed the <DialogRef Id="WelcomeEulaDlg" /> and added the new DialogRef and Publish as per Adam's answer.Excitable
The wixwiki link is broken.Homelike
I am getting error:Unresolved reference to symbol 'Dialog:ErrorDlg' in section 'Product:{07CDD126-8D87-46CF-87B0-8731980619FA}'.Kindly help.Luteolin
Cut, paste, BOOYA! ... +1Dermato
Works like a charm - 28/7/2015Trevelyan
In Wix 3.11.0 using Visual Studio, you get an error "Duplicate Symbol WixUI:WixUI_Minimal ..." To fix just find and replace WixUI_Minimal with WixUI_CustomMinimal in your above code chunk and then in your main product do a <UIRef Id="WixUI_CustomMinimal" />Fraley
T
16

The low-tech way to get around this is simply to set the property LicenseAccepted to 1 and put some useful readme type information into the license box. This means the user doesn't have to click the box and you don't have to worry about creating an additional dialog :)

Example:

<Property Id="LicenseAccepted" Value="1"/>
Ticktack answered 2/3, 2009 at 23:23 Comment(1)
Specifically: <Property Id="LicenseAccepted" Value="1"/>Pinsk
T
7

See the answer to a related question, WiX script with only Welcome and Completed screens, for the simplest minimal UI:

  1. WelcomeDlg
  2. Installation progress
  3. Exit Dialog
Tadeo answered 2/4, 2013 at 17:36 Comment(1)
This is the answer I was looking for. All the other solutions here have downsides, and require more clicks to get through the dialogs.Spickandspan
F
4

@Ran Davidovitz 's answer is very good

but be carefully:

<Publish Dialog="InstallDirDlg"
         Control="Back"
         Event="NewDialog"
         Value="WelcomeDlg"
         Order="2">1</Publish> 

it must have Order="2",or it can't work.

Fathead answered 24/6, 2013 at 10:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.