How to create a bootstrapper application without a license agreement step

左心房为你撑大大i 提交于 2019-11-29 22:48:01

Assuming that you are using the WiX Standard Bootstrapper Application, your current BootstrapperApplicationRef might look like this:

<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />

WixStandardBootstrapperApplication has three variants as explained in the docs. HyperlinkLicense is the simplest. It has a license link on the welcome page instead of a license page. It allows you to specify an empty URL for the license, in which case it won't display the link. For example,

<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
  <bal:WixStandardBootstrapperApplication 
    LicenseUrl=""
    xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" />
</BootstrapperApplicationRef>

I used a custom theme to get rid of the license agreement step. You can see a brief overview of how to do that here.

Steps to take:

  1. Download the WiX 3.11 source, which you can download here at the bottom of the page.

  2. Extract it to a folder and add HyperlinkTheme.xml and HyperlinkTheme.wxl to your bootstrapper project. The files can be found at \src\ext\BalExtension\wixstdba\Resources relative to where they were extracted.

  3. Add the BalExtension namespace definition to the Wix element in your bundle file:

    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
         xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
    
  4. Modify your bootstrapper definition to something like this:

    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
        <bal:WixStandardBootstrapperApplication
            LicenseUrl=""
            ThemeFile="HyperlinkTheme.xml"
            LocalizationFile="HyperlinkTheme.wxl"
            SuppressOptionsUI="yes" />
    </BootstrapperApplicationRef>
    
  5. Now open the theme file and change the page with the Name attribute set to Install and comment out or remove the checkbox and hyperlink:

    <Page Name="Install">
        <!--<Hypertext Name="EulaHyperlink" X="11" Y="121" Width="-11" Height="51" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallLicenseLinkText)</Hypertext>
        <Checkbox Name="EulaAcceptCheckbox" X="-11" Y="-41" Width="260" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallAcceptCheckbox)</Checkbox>-->
        <Button Name="OptionsButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.InstallOptionsButton)</Button>
        <Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
        <Button Name="WelcomeCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallCloseButton)</Button>
    </Page>
    

After doing that your bootstrapper should now look like:

I personally would change the theme more so it doesn't look so awkward with all of that blank space.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!