Link to home
Start Free TrialLog in
Avatar of ktola
ktola

asked on

Moving the WIX Checkbox

I am trying to move the Launch Application checkbox found at the end of the WIX installation process dwon to the navigation bar.  I have tried using a Post Build script and I have tried customizing the WixUI_InstallDir using a Fragment - nothing is working.
Avatar of ktola
ktola

ASKER

OK - I have no download and installed WIX 3.0 about 4 times and tried to get all of the sopurce files and I STILL do not see the src folder - is there somewhere else this thing is loaded?
Avatar of ktola

ASKER

I found the source files for WIX at http://wix.sourceforge.net/releases/
As it turns out, all I need to do was change the condition you set to:

WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed
 instead of

WIXUI_EXITDIALOGOPTIONALCHECKBOX and NOT Installed
The complete version is below:
 

<!-- Here is the part that goes in the Product element
<UI>
      <!-- Options here are WixUI_Minimal, WixUI_InstallDir, WixUI_FeatureTree and WixUI_Mondo -->
      <!-- WixUI_Minimal is about where most normal Setup projects end-->
      <!-- WixUI_InstallDir allows users to choose an install directory-->
      <!-- We use uses a custom UI found in the fragment below -->
      <UIRef Id="WixUI_InstallDir_Custom"/>
    </UI>

    <!-- This property turns on a checkbox letting a user conditionally launch the app-->
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Start My Application!" />

    <!--This property tells WIX that we are using a custom script and to run the MyApp.exe ID'd KeyFile entry-->
    <CustomAction Id="StartAppOnExit" FileKey="MyApp.exe" ExeCommand="" Execute="immediate" Impersonate="yes" Return="asyncNoWait" />

<!-- Here is the Fragment copied after the closing Product tag-->
<Fragment>
    <UI Id="WixUI_InstallDir_Custom">
      <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
      <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
      <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
      <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
      <Property Id="WixUI_Mode" Value="InstallDir" />
      <DialogRef Id="BrowseDlg" />
      <DialogRef Id="DiskCostDlg" />
      <DialogRef Id="ErrorDlg" />
      <DialogRef Id="FatalError" />
      <DialogRef Id="FilesInUse" />
      <DialogRef Id="MsiRMFilesInUse" />
      <DialogRef Id="PrepareDlg" />
      <DialogRef Id="ProgressDlg" />
      <DialogRef Id="ResumeDlg" />
      <DialogRef Id="UserExit" />
      <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
      <Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4">
        <![CDATA[ WIXUI_INSTALLDIR_VALID<>"1"]]>
      </Publish>

      <Publish Dialog="ExitDialog2" Control="Finish" Event="DoAction" Value="StartAppOnExit" Order="1">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1</Publish>
      <Publish Dialog="ExitDialog2" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
      
      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
      <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
      <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg">LicenseAccepted = "1"</Publish>
      <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
      <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
      <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
      <Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3">
        <![CDATA[ NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]>
      </Publish>
      <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
      <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
      <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="1">NOT Installed</Publish>
      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed</Publish>
      <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
      <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
      <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
      <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>

      <Dialog Id="ExitDialog2" Width="370" Height="270" Title="!(loc.ExitDialog_Title)">
        <Control Id="Finish" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUIFinish)" />
        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUICancel)" />
        <Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.ExitDialogBitmap)" />
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUIBack)" />
        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
        <Control Id="Description" Type="Text" X="135" Y="70" Width="220" Height="20" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogDescription)" />
        <Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogTitle)" />
        <Control Id="OptionalCheckBox" Type="CheckBox" X="155" Y="100" Width="10" Height="10" Hidden="no" Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" CheckBoxValue="1" >
          <Condition Action="show">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Condition>
        </Control>
        <Control Id="OptionalText" Type="Text" X="170" Y="100" Width="220" Height="80" Hidden="no" Transparent="yes" NoPrefix="yes" Text="Start My Application!">
          <Condition Action="show">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Condition>
        </Control>
      </Dialog>

      <Dialog Id="ConfirmUpgradeDialog" Y="10" Width="260" Height="85" Title="Another version found">
        <Control Id="No" Type="PushButton" X="132" Y="57" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUINo)">
          <Publish Event="EndDialog" Value="Exit">1</Publish>
        </Control>
        <Control Id="Yes" Type="PushButton" X="72" Y="57" Width="56" Height="17" Text="!(loc.WixUIYes)">
          <Publish Event="EndDialog" Value="Return">1</Publish>
        </Control>
        <Control Id="Text" Type="Text" X="48" Y="15" Width="194" Height="30" Text="Earlier version of [ProductName] is already installed. Do you wish to upgrade?" />
        <Control Id="Icon" Type="Icon" X="15" Y="15" Width="24" Height="24" ToolTip="!(loc.CancelDlgIconTooltip)" FixedSize="yes" IconSize="32" Text="!(loc.CancelDlgIcon)" />
      </Dialog>

      <Property Id="ARPNOMODIFY" Value="1" />
    </UI>
    
    <InstallUISequence>
      <Show Dialog="ExitDialog2" OnExit="success" />
      <Show Dialog="ConfirmUpgradeDialog" After="FindRelatedProducts">NOT Installed AND (PREVIOUSVERSIONFOUND OR PREVIOUSVERSIONFOUND2)</Show>
    </InstallUISequence>

    <AdminUISequence>
      <Show Dialog="ExitDialog2" OnExit="success" />
    </AdminUISequence>

    <UIRef Id="WixUI_Common" />
  </Fragment>

Open in new window

Set WIXUI_INSTALLDIR property:

<Property Id="WIXUI_INSTALLDIR">INSTALLDIR</Property>
> WIXUI_EXITDIALOGOPTIONALCHECKBOX and NOT Installed

Does it skip launching the application if checkbox is not checked?
Sorry, about WIXUI_INSTALLDIR. I misunderstood your comment
ASKER CERTIFIED SOLUTION
Avatar of Mike_Mozhaev
Mike_Mozhaev

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ktola

ASKER

Thank you very much for all of your help!