Removing license dialog
Asked Answered
O

4

41

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

Outshine answered 24/10, 2012 at 8:42 Comment(1)
Possible duplicate of How to build a minimal WiX installer UI without a license page?Struggle
R
59

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>
Runion answered 25/8, 2015 at 23:31 Comment(5)
Thank you, Sean, for your suggestion. In my case I used SetupTypeDlg as next dialog insteadBilabiate
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.Hoon
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.Rabbin
I'd also add, I got an error without @JoshuaGilman's VerifyReadyDlg suggestion.Foolproof
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!Ardy
D
9

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

Duala answered 12/12, 2014 at 11:55 Comment(4)
This works because "SetupTypeDlg" is magic; it just happens to be the dialog that normally comes after the license. nice huh?Duala
What happens in your approach when you click back on the SetupType dialog?Superincumbent
i quickly insert this line :-) <Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">1</Publish>Duala
(have updated the original snippet to skip the license when "back" is pressed...)Duala
B
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.

Brachy answered 12/4, 2016 at 1:40 Comment(1)
project.UI = WUI.WixUI_InstallDir; project.RemoveDialogsBetween(NativeDialogs.WelcomeDlg, NativeDialogs.InstallDirDlg); //this 2 lines worked for meFerdelance
T
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

Tatman answered 24/10, 2012 at 8:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.