WiX: How do I get the MSI's dialogs to show, when wrapped in Burn/EXE?
Asked Answered
I

3

7

I have an MSI with its dialogs, prompting the user to [1] browse to installation directory, [2] accept EULA, [3] Launch app when the installation is finished.

I wrapped the MSI in a Burn Bundle to make an EXE. Now all I see is the EXE's prompt for the EULA, but no prompt to choose the installation directory, or launch the app.

I want to use the EXE format because customers understand it, I can associate my icon and embed my version number in the EXE, and it prompts for Admin password. Customers download my software as a single executable file.

This is the code:

<WixVariable Id="WixStdbaLogo" Value="MyIcon.ico" />
<Variable Name="InstallFolder" Type="string" Value="[ProgramFilesFolder]MyCompany\MyProduct"/>
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<WixVariable Id="WixStdbaLicenseRtf" Value="MyLicense.rtf" />

<Chain>
    <MsiPackage
      Id="Setup"
      Compressed="yes"
      SourceFile="MyProduct.msi"
      Vital="yes"
      DisplayInternalUI="yes"
      EnableFeatureSelection="yes"
      >
        <MsiProperty Name="INSTALLLOCATION" Value="[InstallFolder]" />
    </MsiPackage>
</Chain>

The "DisplayInternalUI="yes" option doesn't seem to do what I want. "EnableFeatureSelection" makes no difference whether it's yes or no.

How do I get the MSI dialogs to display? Alternatively, how do I get the Burn-produced EXE to prompt for installation directory, and app launch?

I am using WiX 3.7.1224, VS 2010.

I have looked at the following sources:

Here is the MSI (added 30 Jun 13:07 AST):

<Product Id="*" Name="My Product" Language="1033" Version="5.0.0" 
     Manufacturer="My Company" UpgradeCode="0bd6d4cf-d23d-431a-9baf-c72cb0525f0c">
  <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

  <MajorUpgrade DowngradeErrorMessage="A newer version of My Program is already installed." />
  <MediaTemplate EmbedCab="yes" CompressionLevel="high"/>

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

  <!-- Set Installer's Icon in Add/Remove Programs -->
  <Icon Id="icon.ico" SourceFile="MyProduct.ico"/>
  <Property Id="ARPPRODUCTICON" Value="icon.ico" />

  <Property Id="ProductSeed"> 3022 </Property> 
  <Binary Id="PlantSeedDLL" SourceFile="..\..\PlantSeed\Release\PlantSeed.DLL" />
  <CustomAction Id="DLLPlantSeed" BinaryKey="PlantSeedDLL" DllEntry="PlantSeedFunc"
    Execute="immediate" Return="check" HideTarget="no" Impersonate="yes"/>

  <!-- Step 1: Define the directory structure -->
  <Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="ProgramFilesFolder">
      <Directory Id="INSTALLFOLDER" Name="My Product"/>
    </Directory>
    <!-- Shortcut on Start Menu -->
    <Directory Id="ProgramMenuFolder">
      <Directory Id="ApplicationProgramsFolder" Name="My Product"/>
    </Directory>
    <!-- Desktop shortcut -->
    <Directory Id="DesktopFolder" Name="Desktop">
    </Directory>
  </Directory>

  <CustomAction Id="Install_PDF_printer" FileKey="Install.exe"
    ExeCommand='Install.exe -s "My PDF Printer" -n "My Company Inc." -c "****************"'
    Execute="deferred" Return="check" HideTarget="no" Impersonate="no" />

  <!-- Banner images -->
  <!-- <WixVariable Id="MainLogoBmp" Value="Resources/Images/weblabel.jpg" /> -->
  <WixVariable Id="WixUIBannerBmp" Value="MyProduct iconWiXbanner.jpg" /> <!-- 493 × 58 -->
  <WixVariable Id="WixUIDialogBmp" Value="MyProduct 616x390.jpg" /> <!-- 616 × 390 -->

  <!-- License (not necessary to have it as a component) -->
  <WixVariable Id="WixUILicenseRtf" Value="MyProduct License.rtf" />

  <!-- Prompt for install directory -->
  <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
  <UIRef Id="WixUI_InstallDir" />

  <!-- Display checkbox Prompt to run EXE at end -->
  <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/> <!-- Default to checked -->
  <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch My Product" />
  <Property Id="WixShellExecTarget" Value="[#MyProduct.exe]" />
  <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />

  <!-- Prompt to run EXE at end -->
  <UI>
    <UIRef Id="WixUI_FeatureTree"/> <!-- causes compilation errors -->
    <Publish Dialog="ExitDialog"
      Control="Finish"
      Event="DoAction"
      Value="LaunchApplication">
      WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed
    </Publish>
  </UI>

  <UI> <!-- For the dialogs -->
    <TextStyle Id="Font10" FaceName="Tahoma" Size="10" Red="0" Green="0" Blue="0"  />
    <TextStyle Id="Font12" FaceName="Tahoma" Size="12" Red="0" Green="0" Blue="0"  />
  </UI>

  <!-- Include dialogs -->
  <Property Id="ApplicationFolderName" Value="MyProduct Folder" /> <!-- WixUI_Advanced -->
  <Property Id="WixAppFolder" Value="WixPerMachineFolder" /> <!-- WixUI_Advanced -->
  <!-- Install for all users -->
  <WixVariable Id="WixUISupportPerUser" Value="0" /> <!-- WixUI_Advanced -->

  <!-- Write product key in Registry -->
  <DirectoryRef Id="TARGETDIR">
    <Component Id="RegistryEntries" Guid="*">
    <!-- HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\My Company Inc.\My Product -->
    <RegistryKey Root="HKLM"  
           Key="Software\My Company Inc.\My Product" >
      <RegistryValue Type="string" Name="TARGET" Value="[INSTALLFOLDER]"/>
    </RegistryKey>
    </Component>
  </DirectoryRef>

    <!-- Shortcut on Start Menu -->
  <DirectoryRef Id="ApplicationProgramsFolder">
    <Component Id="ApplicationShortcut" Guid="*">
      <Shortcut Id="ApplicationStartMenuShortcut"
        Name="My Product"
        Description="My Product"
        Target="[INSTALLFOLDER]MyProduct.exe"
        WorkingDirectory="INSTALLFOLDER"
      />
      <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
      <RegistryValue Root="HKCU" Key="Software\Microsoft\My Product" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
    </Component>
  </DirectoryRef>

  <!-- Step 2: Add files to your installer package -->
  <DirectoryRef Id="INSTALLFOLDER">

    <Component Id="MyProduct.exe" Guid="*">
      <File Id="MyProduct.exe" Name="MyProduct.exe"
        Source="..\\..\\Release\\MyProduct.exe"
        KeyPath="yes" Checksum="yes">

        <!-- Desktop shortcut -->
        <Shortcut Advertise="yes"
          Id="MyProductDesktopShortcut"
          Directory="DesktopFolder"
          Name="My Product"
          WorkingDirectory="INSTALLFOLDER"
          Description="My Product"
          Icon="MyProduct.ico">
          <Icon Id="MyProduct.ico" SourceFile="MyProduct.ico" />
        </Shortcut>
      </File>
    </Component>

    <Component Id="MyProduct.chm" Guid="*">
      <File Id="MyProduct.chm" Source="MyProduct.chm" KeyPath="yes" Checksum="yes"/>
    </Component>
    <Component Id="MyProduct.bmp" Guid="*">
      <File Id="MyProduct.bmp" Source="MyProduct.bmp" KeyPath="yes" Checksum="yes"/>
    </Component>
    <Component Id="MyProduct.ico" Guid="*">
      <File Id="MyProduct.ico" Source="MyProduct.ico" KeyPath="yes" Checksum="yes"/>
    </Component>

    <!-- Many, many more components... -->
  </DirectoryRef>

  <!-- Step 3: Tell WiX to install the files -->
  <Feature Id="MainApplication" Title="Main Application" Level="1">
    <ComponentRef Id="MyProduct.exe" />
    <ComponentRef Id="MyProduct.bmp" />
    <ComponentRef Id="MyProduct.ico" />
    <ComponentRef Id="MyProduct.chm" />

    <ComponentRef Id="ApplicationShortcut" />

    <ComponentRef Id="RegistryEntries" /> <!-- Registry entry -->
  </Feature>

  <InstallExecuteSequence>
    <!-- Before="InstallFinalize" -->
    <Custom Action="Install_PDF_printer" After="InstallFiles" />
  </InstallExecuteSequence>

  <!-- Calculate Trial Expiry date, write to Registry -->
  <InstallExecuteSequence>
    <Custom Action="DLLPlantSeed" After="InstallFiles" />
  </InstallExecuteSequence>  
</Product>

<Fragment>
  <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
    <!-- TODO: Remove the comments around this Component element 
      and the ComponentRef below in order to add resources to this installer. -->
    <!-- <Component Id="ProductComponent"> -->
      <!-- TODO: Insert files, registry keys, and other resources here. -->
    <!-- </Component> -->
  </ComponentGroup>
</Fragment>
Ingrained answered 28/6, 2013 at 21:52 Comment(7)
I have the exact same issue (have the bootstrap for installing .NET only, though). Additional info: the MSI on its on works fine and displays its UI correctly.Bagatelle
Works fine with UIRef Id="WixUI_FeatureTree". Perhaps the "Command Line" entry in the MSI log will give a clue.Matthia
@Tom: how would that work if the dialogs in the MSI are custom?Bagatelle
It shouldn't make any difference at all. My point was just to establish that DisplayInternalUI is not broken. Burn has no concern over how a Windows Installer package is built. The Bundle only controls what commands are passed to Windows Installer. They are what's causing the unexpected behavior in your installer but probably are not wrong in and of themselves.Matthia
There are no custom dialogs in the MSI (see source above). When I add <UIRef Id="WixUI_FeatureTree"/>, I get compilation errors: error LGHT0091: Duplicate symbol 'ControlEvent:WelcomeDlg/Next/NewDialog/VerifyReadyDlg/Installed AND PATCH' found. I am not able to see the source of the duplication. Thanks for your help.Ingrained
@TomBlodget the only thing I customize is the font size, position of controls in .WXL file.Ingrained
Having the same issue here:(Dira
M
1

Vice versa: try supress WIX ExitDlg in the MSI and leave your BA dialog.

Marna answered 2/7, 2013 at 12:9 Comment(1)
Thanks, that will be useful. Except in this case I need to suppress the BA dialog, and display the MSI dialog because the MSI dialog has a "Launch Application" option. Thank for the feedback.Ingrained
B
1

Just add the DisplayInternalUI tag.

<MsiPackage SourceFile = 'xxx' Id='xxx' Vital='yes'  DisplayInternalUI='yes'></MsiPackage>
Basting answered 30/8, 2017 at 20:29 Comment(0)
I
0

Inexplicably, the thing seems to be working now. I cannot discern which of the multitude of permutations "fixed" it. The only thing that comes to mind is that the MSI project needs to be rebuilt every time, as well as the Bootstrapper Application (BA) that envelops it.

Now I need to suppress the "Setup Successful" dialog displayed by the BA. It is redundant, as the MSI dialog says the same thing.

Ingrained answered 2/7, 2013 at 11:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.