Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing license dialog

Tags:

wix

wix3.6

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>

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


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


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.