27

I need a WiX 3 script to display to display only 2 dialogs: Welcome & Completed. Thats it no need for EULA, folder selection etc. All help appreciated.

Charles
  • 50,943
  • 13
  • 104
  • 142
Tim Murphy
  • 4,892
  • 4
  • 40
  • 48

2 Answers2

55

All you need to do is add this in your WIX script, it will give you the WelcomeDlg before the installation and show the Installation progress, then the Exit Dialog. Don't forget to add the WixUIExtension.dll to your references.

<UI Id="UserInterface">
  <Property Id="WIXUI_INSTALLDIR" Value="TARGETDIR" />
  <Property Id="WixUI_Mode" Value="Custom" />

  <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
  <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="9" Bold="yes" />
  <TextStyle Id="WixUI_Font_Title"  FaceName="Tahoma" Size="9" Bold="yes" />

  <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />

  <DialogRef Id="ProgressDlg" />
  <DialogRef Id="ErrorDlg" />
  <DialogRef Id="FilesInUse" />
  <DialogRef Id="FatalError" />
  <DialogRef Id="UserExit" />

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

</UI>
<UIRef Id="WixUI_Common" />
CheGueVerra
  • 7,849
  • 4
  • 37
  • 49
  • 3
    looks like it was working for some old version of wix. see my complete example in answer below for Wix 3.8, which is based on original answer of comrade CheGueVerra – lowtech Jul 28 '14 at 21:08
  • @CheGueVerra Great work! Works for me. Do you know how to add dialog that will says: "A previous version already exists do you want to continue" ? I tried [http://stackoverflow.com/questions/16014082/custom-dialog-when-previous-version-exists] – grabhints Nov 11 '15 at 13:20
  • @CheGueVerra Great thank you! please see: http://stackoverflow.com/questions/33690724/wix-custom-dialog-when-previous-version-exists – grabhints Nov 15 '15 at 11:37
  • I couldn't find the "WixUIExtension.dll". For future reference it's in: `C:\Program Files (x86)\WiX Toolset v3.7\bin\WixUIExtension.dll` I'm quite new to WiX so excuse me if this is common knowledge. – Mike Bovenlander Aug 13 '18 at 14:26
7

If you are using Visual Studio and Wix 3.8 then you could create Wix Setup project and use text below as content of Product.wxs. In my case I needed to copy python and text file into destination dir. Thanks again for original masterpiece, comrade CheGueVerra:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

  <Product Id="*" Name="testwixsetup" Language="1033" Version="2.1.3.0" Manufacturer="ttt" UpgradeCode="PUT-GUID-HERE">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

        <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />     
    <MediaTemplate EmbedCab="yes"/>

        <Feature Id="ProductFeature" Title="testwixsetup" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>

    <UI Id="UserInterface">
      <Property Id="WIXUI_INSTALLDIR" Value="TARGETDIR" />
      <Property Id="WixUI_Mode" Value="Custom" />

      <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
      <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="9" Bold="yes" />
      <TextStyle Id="WixUI_Font_Title"  FaceName="Tahoma" Size="9" Bold="yes" />

      <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />

      <DialogRef Id="ProgressDlg" />
      <DialogRef Id="ErrorDlg" />
      <DialogRef Id="FilesInUse" />
      <DialogRef Id="FatalError" />
      <DialogRef Id="UserExit" />

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

    </UI>
    <UIRef Id="WixUI_Common" />
  </Product>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
        <Directory Id="COMPANYFOLDER" Name="test-wixinstall">
          <Directory Id="INSTALLFOLDER" Name="testwixsetup" />
        </Directory>
            </Directory>
        </Directory>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
                <Component Id="ProductComponent" Guid="*">
          <File Name="test.py"/>
          <File Name="test.txt"/>
             </Component>
        </ComponentGroup>
    </Fragment>

</Wix>
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
lowtech
  • 2,492
  • 2
  • 22
  • 31