Remove "Installation successful" Dialog - wix

I'm having a problem with the wix installer.
I want to remove the last dialog window when installing my application. The last dialog only shows the message "installation successful" and the user has to click finish.
I want the installation to close automatically after the progress bar reaches 100%.
I tried the approach Changing the UI sequence of a built-in dialog set but i got numerous errors and could not get it to work.
I also tried user "joylons" answer here but had no success either.
Is there another way to get this to work? Or can someone help me with the mentioned approach?
I am using the WixUI_Minimal scheme:
<UI>
<UIRef Id="WixUI_Minimal"/>
</UI>
EDIT:
Based on other answers I tried to use WixUI_Common and alter the sequences.
<UI>
<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="1"></Publish>
</UI>
<UIRef Id="WixUI_Common" />
<InstallUISequence>
<Show Dialog="WelcomeDlg" Sequence="1"/>
</InstallUISequence>
<AdminUISequence>
<Show Dialog="WelcomeDlg" Sequence="1"/>
</AdminUISequence>
Changes to the InstallUISequence or AdminUISequence do not seem to have any impact. The installer still shows the three dialogs: licence, progress and then the finished dialog.
I tried to remove the Publish Dialog="ExitDialog" and get the error: "Exit dialog/action not found in 'InstallUISequence' Sequence Table"
EDIT2: I changed my UI Tag like this (according to Chris Eelmaa's answer):
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<UIRef Id="WixUI_Minimal"/>
<UI>
<InstallUISequence>
<Show Dialog="ExitDialog" OnExit="success">0</Show>
</InstallUISequence>
<AdminUISequence>
<Show Dialog="ExitDialog" OnExit="success">0</Show>
</AdminUISequence>
</UI>
Unfortunatelly the dialog is still shown at the end of the installation process...
EDIT3 (25.03.15)
The problem seems to be the bootstrapper I'm using. Without the bootstrapper Chris Eelmaa's solution works. The bootstrapper seems to ignore all of the changes i make in my .wxs file and still displays the ExitDialog. Any suggestions?

It's pretty easy, basically you need to overwrite the scheduled "Show exit dialog when installation was successful", and say that it should never happen. The "0" means disabled.
<InstallUISequence>
<Show Dialog="ExitDialog" OnExit="success">0</Show>
</InstallUISequence>
<AdminUISequence>
<Show Dialog="ExitDialog" OnExit="success">0</Show>
</AdminUISequence>

Related

How to run multiple installed exe's using wix installer?

I'm trying to run multiple exe's after installation. This code creates single msi that deploy both exe's but run the first.
I haven't found a single example for it at the whole internet. This is my code (Don't mind the "put guid here"):
<?xml version="1.0" encoding="UTF-8"?>
<<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
UpgradeCode="PUT-GUID-HERE"
Version="1.0.0.0"
Language="1033"
Name="My Application Name"
Manufacturer="My Manufacturer Name">
<Package InstallerVersion="300" Compressed="yes"/>
<Media Id="1" Cabinet="myapplication.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="My Application Name"/>
</Directory>
</Directory>
<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
<Component Id="Installs" Guid="PUT-GUID-HERE">
<File Id="myapplication.exe" Source="MySourceFiles\MyApplication.exe" KeyPath="yes" Checksum="yes"/>
<File Id="myapplication2.exe" Source="MySourceFiles\MyApplication.exe2" KeyPath="yes" Checksum="yes"/>
</Component>
</DirectoryRef>
<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentRef Id="Installs" />
</Feature>
<UI>
<UIRef Id="WixUI_Minimal" />
<Publish Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch My Application Name" />
<Property Id="WixShellExecTarget" Value="[#myapplication.exe]" />
<CustomAction Id="LaunchApplication"
BinaryKey="WixCA"
DllEntry="WixShellExec"
Impersonate="yes" />
</Product>
</Wix>
But it only installs the first exe upon completing setup. Ideas?
Best Regards.
A component can't have multiple keypaths. Each EXE file should be the keypath of it's own component per Windows Installer component rules.
I don't see how anything would launch. [#myapplication.exe] is a formatted expression that's not valid until after ConstFinalize. You'd need a SetProperty custom action scheduled appropriately to work. You'd need more then one also to call LaunchApplication over and over for each EXE you want to launch. Or create a single custom EXE who's sole purpose is to launch the others.
You can just do it 2 times: First set the property "WixShellExecTarget" and then call "WixShellExec". I.e. try replacing with custom actions to set the property:
<UI>
<UIRef Id="WixUI_Minimal" />
<!-- set property and launch the first exe -->
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="PrepareLaunchApplication1">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication1">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<!-- set property and launch the second exe -->
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="PrepareLaunchApplication2">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication2">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch My Application Name" />
<CustomAction Id="PrepareLaunchApplication1" Property="WixShellExecTarget" Value="[#myapplication.exe]" />
<CustomAction Id="LaunchApplication1"
BinaryKey="WixCA"
DllEntry="WixShellExec"
Impersonate="yes" />
<CustomAction Id="PrepareLaunchApplication2" Property="WixShellExecTarget" Value="[#myapplication2.exe]" />
<CustomAction Id="LaunchApplication2"
BinaryKey="WixCA"
DllEntry="WixShellExec"
Impersonate="yes" />
If you want for programs to be run sequentially and wait for the second one to exit and check it's exit code, you can use "ExeCommand" instead of "WixShellExec". If you don't care about exit code, you'll need to configure ExeCommand correspondingly (check the docs).
<UI>
<UIRef Id="WixUI_Minimal" />
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication1">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication2">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<CustomAction Id="LaunchApplication1" FileKey="myapplication1.exe" ExeCommand="" Impersonate="yes" />
<CustomAction Id="LaunchApplication2" FileKey="myapplication2.exe" ExeCommand="" Impersonate="yes" />

Installer does not close after running custom action

I've made my Wix installer run an application after finishing installation. This now works, but the installer does not close. Every time I click the Finish button, the application is started once more.
I'd like the application to be run async and then installer terminate.
This is how I did it in Wix;
<UI>
<Publish Dialog="ExitDialog" Control="Finish" Order="1" Event="DoAction" Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch $(var.ProductName) Launcher" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
<CustomAction Id="LaunchApplication" FileKey="LnLauncherExe" ExeCommand="" Execute="immediate" Return="asyncNoWait" Impersonate="yes" />
An other problem I have is that the checkbox does not show up. I can live with this, but if someone can spot why, it would be nice to get fixed.
Thanks!
Adding the following seems to work;
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>

WiX - start application after install

I read an article http://wix.sourceforge.net/manual-wix3/run_program_after_install.htm and it works.
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch MS" />
<Property Id="WixShellExecTarget" Value="[#MainExe]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<UI Id="MyWixUI_Mondo">
<UIRef Id="WixUI_Minimal" />
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<UIRef Id="WixUI_ErrorProgressText"/>
</UI>
But I want to have checked checkbox by default, not unchecked. How to do it
Add <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" /> to give the checkbox property its "checked" value.
It goes outside the UI element. Here's a complete example:
<UI>
<UIRef Id="WixUI_Minimal"/>
<Publish Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed
</Publish>
</UI>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>

WiX: Can't handle "Launch an application after install" checkbox = 0

I'm making an installation with WiX that have a "Launch an application after install" checkbox.
The goal is to have a reaction on settting the checkbox as well as on unsetting the checkbox. In case the checkbox is set, I need to run an application. In case the checkbox is not set, I need to run the same application but with command line argument.
Here is a part of my WiX script.
<CustomAction Id="StartConfigManagerOnExit"
FileKey="ParamsShower.exe"
ExeCommand=""
Execute="immediate"
Impersonate="yes"
Return="asyncNoWait" />
<CustomAction Id="StartUpgradeConfigOnExit"
FileKey="ParamsShower.exe"
ExeCommand="/upgrade"
Execute="immediate"
Impersonate="yes"
Return="asyncNoWait" />
<UI>
<Publish Dialog="ExitDialogEx"
Control="Finish"
Order="1"
Event="DoAction"
Value="StartConfigManagerOnExit">LAUNCHAPPONEXIT = 1</Publish>
<Publish Dialog="ExitDialogEx"
Control="Finish"
Order="1"
Event="DoAction"
Value="StartUpgradeConfigOnExit">LAUNCHAPPONEXIT = 0</Publish>
<Publish Dialog="ExitDialogEx"
Control="Finish"
Event="EndDialog"
Value="Return"
Order="999">1</Publish>
<Dialog Id="ExitDialogEx"
Width="370"
Height="270"
Title="[ProductName] Setup">
<Control Id="LaunchCheckBox"
Type="CheckBox"
X="135"
Y="190"
Width="220"
Height="40"
Property="LAUNCHAPPONEXIT"
Hidden="yes"
CheckBoxValue="1"
Text="Launch an app">
<Condition Action="show">NOT Installed</Condition>
</Control>
</Dialog>
<InstallUISequence>
<Show Dialog="ExitDialogEx"
OnExit="success" />
</InstallUISequence>
<AdminUISequence>
<Show Dialog="ExitDialogEx"
OnExit="success" />
</AdminUISequence>
</UI>
An installation starts the application when LaunchCheckBox is set. But it doesn't run it in case the checkbox is not set.
I've found an answer. Looks like checkbox property is not equal to 0 when unchecked. Simply change the condition "LAUNCHAPPONEXIT = 0" with "NOT LAUNCHAPPONEXIT" solves the situation.
Make default:
<Property Id="LAUNCHAPPONEXIT" Value="1" />
Then correct the conditions (corrected with sascha's comment):
<Publish Dialog="ExitDialogEx" Control="Finish" Order="1" Event="DoAction" Value="StartConfigManagerOnExit">LAUNCHAPPONEXIT</Publish>
<Publish Dialog="ExitDialogEx" Control="Finish" Order="1" Event="DoAction" Value="StartUpgradeConfigOnExit">NOT LAUNCHAPPONEXIT</Publish>
A checkbox has no value at all when unchecked, so rather than use the 1/0 notation you can simply use
LAUNCHAPPONEXIT
and
Not LAUNCHAPPONEXIT
You need to add initialize custom action for your property,
<CustomAction ID="InitLAUNCHAPPONEXIT"
Property="LAUNCHAPPONEXIT"
Value="0"
Return="check"/>
and then add it to InstallUISequence before show exit dialog, or simply add your property to product <Property Id="LAUNCHAPPONEXIT" Value="0" />.

How to build a minimal WiX installer UI without a license page?

I would like to use the WixUI_Minimal installer, but I don't want the license page. How can I do this?
I would simply use one of the already created WiX UI and override the sequence (make it higher so that it will override the previous setting):
<Product>
...
<UI>
<UIRef Id="WixUI_InstallDir" />
<!-- Skip license dialog -->
<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>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
...
</Product>
The key is to make a custom UI and hook up different pages. See the page on WixWiki
You want to grab the WixUI minimal code, and modify it a bit. 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, which would be the PrepareDlg.
Full Code:
<UI Id="WixUI_Minimal">
<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="Minimal" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<!-- This is the welcome dialog you specified-->
<DialogRef Id="WelcomeDlg" />
<!-- Hook the new welcome dialog to the next one in the stack-->
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="PrepareDlg">1</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">1</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>
<Property Id="ARPNOMODIFY" Value="1" />
</UI>
<UIRef Id="WixUI_Common" />
The low-tech way to get around this is simply to set the property LicenseAccepted to 1 and put some useful readme type information into the license box. This means the user doesn't have to click the box and you don't have to worry about creating an additional dialog :)
Example:
<Property Id="LicenseAccepted" Value="1"/>
See the answer to a related question, WiX script with only Welcome and Completed screens, for the simplest minimal UI:
WelcomeDlg
Installation progress
Exit Dialog
#Ran Davidovitz 's answer is very good
but be carefully:
<Publish Dialog="InstallDirDlg"
Control="Back"
Event="NewDialog"
Value="WelcomeDlg"
Order="2">1</Publish>
it must have Order="2",or it can't work.