Launch after install, with no UI?
From the msdn topic on sequencing custom actions:
As in the case of standard actions,
custom actions that are scheduled in
the InstallUISequence or
AdminUISequence run only if the
internal user interface is set to the
full level.
So I guess your custom action is scheduled in a UI sequence, not in InstallExecuteSequence
. Try scheduling your custom action in the InstallExecuteSequence
like this:
<InstallExecuteSequence>
<Custom Action='LaunchApplication' After='InstallFiles'/>
</InstallExecuteSequence>
where "LaunchApplication" should be replaced by the Id
of your CustomAction
element.
edit: I looked at the instructions that you followed, and I don't see the custom action for launching the application being scheduled in any sequence. It is only triggered from a UI action (clicking the Finish button). This explains why it is never executed during a silent install.
edit: full sample (it's a bit sloppy as it also tries to execute the custom action on uninstall, repair etc. but for some reason I couldn't get the "NOT Installed" condition to work)
<?xml version='1.0' encoding='utf-8'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product
Name='ProductName'
Id='*'
Language='1033'
Version='0.0.1'
Manufacturer='ManufacturerName' >
<Package
Keywords='Installer'
Description='Launch application demo'
Manufacturer='ManufactererName'
InstallerVersion='100'
Languages='1033'
Compressed='yes'
SummaryCodepage='1252'/>
<Media Id='1' Cabinet='test.cab' EmbedCab='yes'/>
<Directory Id='TARGETDIR' Name="SourceDir">
<Directory Id='ProgramFilesFolder'>
<Directory Id='TestFolder' Name='Test' >
<Component Id="ExeComponent" Guid="*">
<File Id="ExeFile" Source="c:\windows\notepad.exe" />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id='Complete'
Display='expand'
Level='1'
Title='Test'
Description='Test'>
<ComponentRef Id="ExeComponent" />
</Feature>
<InstallExecuteSequence>
<Custom Action='LaunchInstalledExe' After='InstallFinalize'/>
</InstallExecuteSequence>
<CustomAction Id="LaunchInstalledExe"
FileKey="ExeFile"
ExeCommand=""
Execute="immediate"
Impersonate="yes"
Return="asyncNoWait" />
</Product>
</Wix>
Wix - How to run exe files after installation from installed directory?
The Isaiah4110 answer is not the best way if you don´t need a UI.
The simplest way to execute the exe file target you are installing through the MSI file produced by Wix is with a custom action type 18 (identifying the action by FileKey), here you are a complete example:
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="TargetProgram" Guid="f757ff43-0266-483a-8749-ec796cba4b25" >
<File Id="EXE" Source="C:\SetupProject\Includes\TargetProgram.exe" />
</Component>
</ComponentGroup>
<CustomAction Id="EXECUTE_AFTER_FINALIZE"
Execute="immediate"
Impersonate="no"
Return="asyncNoWait"
FileKey="EXE"
ExeCommand="" />
<InstallExecuteSequence>
<Custom Action="EXECUTE_AFTER_FINALIZE" After="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>
</Fragment>
Start application after installation
What happens if you use
ExeCommand="[SystemFolder]cmd.exe /C start MyExe.exe"
Wix Minimal UI doesnt show up
System Reboot: In this case a simple reboot solved the problem - which is great news.
Speculation: One could speculate as to why, and maybe it had to do with PendingFileRenames (file and folder names waiting to be
changed) or some lock in Windows Updates that affected the System
Restore point creation? Doesn't sound too likely. Just speculation.A Deployment Mnemonic: To think about this - if you see the problem - a deployment mnemonic:
What is locking
(in use),
what is blocking
(permissions),what is corrupt
(disk, malware, configs, encryption),what are unexpected system states
(disk space, time & date settings, language, licensing, windows patch
state, path too long, PendingFileRenames, etc...),what are incompatible products
(things that can't co-exist),what is unreachable or misconfigured
(what points to erroneous locations and resources: network server names,
disk paths, URLs, databases, services, UAT environments, PROD environments, etc...) and last but not least:what is missing
(runtime, resource image, settings file, etc...)? Launch debugging.
And the older answer. Leaving in to perhaps spark ideas:
- Prevalence: Do other MSI files work without issues?
- Timeout: How long do you wait for the MSI to initialize?
- Initialization & System Restore: The Windows Installer engine may create a system restore point before the GUI is shown. This can be quite slow, and your setup could appear to hang.
- Source: Maybe post your whole source.
- Logging: Always make a log file for your installation session to debug.
Sounds like you don't need it, but here is a: Sample, minimal MSI compile with WiX Votive.
Gut feel is that there might be an AppSearch in this dialog set that I am unaware of. Maybe try to have a look at the sources yourself first (WixUI_Minimal.wxs
et al). Any other issues with your machine? Virtual? Up to date with hotfixes? Malware checked? Disk space? Event logs?
Related Topics
Overloading Getter and Setter Causes a Stack Overflow in C#
How to Get the Full Url of the Page I am on in C#
Save and Retrieve Image (Binary) from SQL Server Using Entity Framework 6
How to Specify My Explicit Type Comparator Inline
How to Show File Copy Progress Using Fileinfo.Copyto() in .Net
Wpf - How to Create Menu and Submenus Using Binding
Addeventhandler Using Reflection
How to Print the Contents of an Array Horizontally
How to Pass User Defined Table Type as Stored Procedured Parameter in C#
Awaiting Asynchronous Function Inside Formclosing Event
Passing Data to Master Page in ASP.NET MVC
Differencebetween Linq to Xml Descendants and Elements
How Can a Separator Be Added Between Items in an Itemscontrol
Could Not Find an Implementation of the Query Pattern
How to Make a Call to My Wcf Service Asynchronous
Loading a Full Hierarchy from a Self Referencing Table with Entityframework.Core