40

I'm using Wix 3.6 to make a simple MSI which is used internally. I would like to know if there is an easy way to remove the license agreement dialog.

Thanks for any suggestions

user1770609
  • 463
  • 1
  • 4
  • 12
  • 3
    Possible duplicate of [How to build a minimal WiX installer UI without a license page?](https://stackoverflow.com/questions/597025/how-to-build-a-minimal-wix-installer-ui-without-a-license-page) – Nick Edwards Aug 15 '17 at 04:55

4 Answers4

57

I skipped it using:

<UI>
  <UIRef Id="WixUI_InstallDir" />
  <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>
Sean
  • 2,033
  • 2
  • 23
  • 28
  • Thank you, Sean, for your suggestion. In my case I used SetupTypeDlg as next dialog instead – Ifelere Bolaji Mar 31 '17 at 18:54
  • 5
    Great answer. However, for those who have 'simple' installations with a fixed install path and only one feature, I recommend replacing `InstallDirDlg` with `VerifyReadyDlg`. This is more akin to the simple UI without the EULA. – Joshua Gilman Sep 23 '17 at 05:03
  • 3
    I recommend a higher order that "2". "2" works here because the OP went one-higher than the published source code. But who wants to read the source? Other dialogs of other WixUI can use an order that maxes out at 4. Because Order means something like weight - higher has precedence. I would use Order="99" for anything behavior you wish to override. The only higher order in the published source is the Finish button on ExitDialog which has Order 999. – user922020 Jun 28 '18 at 22:09
  • I'd also add, I got an error without @JoshuaGilman's `VerifyReadyDlg` suggestion. – nopara73 Sep 20 '18 at 10:12
  • Going back from InstallDirDlg returns to Licence Page if i use Order="2" for all dialogs. Changing order to 3 for InstallDirDlg going Next/Back several times works! – Paolo Mazzoni Jan 12 '22 at 10:56
8

This simplification of the XML referred to above (http://www.howdoicode.net/2011/09/wix-how-to-hide-license-agreement.html) worked for me; this effectively skips the license rather than hooking in a custom page

<UI Id='Mondo'>
  <UIRef Id="WixUI_Mondo" />
  <UIRef Id="WixUI_ErrorProgressText" />
  <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="SetupTypeDlg"  Order="3">1</Publish>
   <!-- skip the page on the way back too -->
   <Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg"  Order="3">1</Publish>
</UI>

I gotta say the general approach of copy the wix code and hack it about a bit ("Changing the UI sequence of a built-in dialog set"(http://wixtoolset.org/documentation/manual/v3/wixui/wixui_customizations.html)) is kinda doomed really.... but hey

  • This works because "SetupTypeDlg" is magic; it just happens to be the dialog that normally comes after the license. nice huh? –  Dec 12 '14 at 11:56
  • What happens in your approach when you click `back` on the SetupType dialog? – harper Dec 12 '14 at 13:53
  • i quickly insert this line :-) 1 –  Dec 12 '14 at 14:15
  • (have updated the original snippet to skip the license when "back" is pressed...) –  Dec 12 '14 at 14:18
6

I've recently come across a project Wix# that mimics the Wix XML files, but enables you code the setup in C#. You can find this project on https://wixsharp.codeplex.com. I initially had the same problem with a license file with the "Terms and Conditions" that need to be accepted before the user can install the software. With the solution not being of such a nature that it required "Terms and Conditions" to be accepted, I had to find a way to remove this dialog.

After a bit of searching (in Wix#), I came up with the following:

WixSharp.CommonTasks.Tasks.RemoveDialogsBetween(project, 
                              WixSharp.Controls.NativeDialogs.WelcomeDlg,
                              NativeDialogs.InstallDirDlg);

Okay, I get that this doesn't solve the problem outright, because this will mean that you'd have to re-code your solution, so the next port of call was to look at the WiX Source File that was emitted during this process.

So from that, I saw that there was a <UI> element with the following:

<UI>
  <Publish Dialog="WelcomeDlg" 
           Control="Next" 
           Event="NewDialog" 
           Value="InstallDirDlg" 
           Order="5">1</Publish>

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

Which binds the Next button on the welcome dialog to the install directory dialog (or the dialog after the license dialog), and the Back button of the install dialog to the welcome dialog - effectively removing the license dialog box.

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
sober
  • 99
  • 1
  • 2
  • project.UI = WUI.WixUI_InstallDir; project.RemoveDialogsBetween(NativeDialogs.WelcomeDlg, NativeDialogs.InstallDirDlg); //this 2 lines worked for me – Xavave Apr 09 '21 at 18:35
5

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

You want to grab the WixUI code for the dialog set you are using (e.g Minimal, etc), Call it <UI Id='MyAppWix_UIMinimal'> and modify it a bit and reference it in your main wxs. 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.

Here is a good link with code: http://www.howdoicode.net/2011/09/wix-how-to-hide-license-agreement.html

Natalie Carr
  • 3,707
  • 3
  • 34
  • 68