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 MSI Installing driver from DLL library in directory created by MSI causes issues during upgrade
At one time DIFX
was the "authoritative method" for driver installations using MSI, but it has now been deprecated by Microsoft. The recommended replacement is called Setup API
or Device and Driver Installation Reference
(depending on much platform support you need) but each evolution is more difficult to use within the confines of Windows Installer (although I've been tempted several times to write a WiX extension wrapping those APIs to help all the driver writers out there) because of the need to maintain MSI's transactional guarantees whenever using deferred custom actions.
Current best practice (early 2021) is to use a bootstrapper that supports multiple packages & will securely cache your packages (so they are available during upgrades & uninstalls, etc.), and to have it install both your driver and your MSI.
CustomAction DriverPackageInstall failing with 0x80030005
Similar Answer: WiX silent install unable to launch built in .EXE: WiX v3
Driver element: Why do you not use WiX's built-in difx:Driver element / construct? I am wondering if you have a system context / impersonation problem? By using the built-in driver element you get more "auto-magic" in the sense that you can avoid certain common problems that occur when you do things "manually".
Blast From The Past: Here is a previous answer which tersely describes this element. I have unfortunately not been able to test it properly myself: How do I use WiX to deploy an INF-based USB driver Plus all the start menu shortcuts and desktop icons
Testing: I would definitely give this element a try, just comment out your existing custom actions and give it a try.
<Component>
<File ... />
<difx:Driver ... />
</Component>
- Github.com search result showing projects using the difX element (and a direct link to one of them).
- Installing driver using cutomAction DriverPackageInstall in wix installer
Related Topics
What Is a Regular Expression for Parsing Out Individual Sentences
Using SQLdataadapter to Insert a Row
Using Tfs API, How to Find the Comments Which Were Made on a Code Review
Running a Method in Backgroundworker and Showing Progressbar
Comparing Floating Point Values
How to Write the Escape Char '\' to Code
Filesystemwatcher Fails to Access Network Drive
Jquery Ajax Calls to Web Service Seem to Be Synchronous
Http Post Returns Error: 417 "Expectation Failed."
How to Download a Nuget Package Without Nuget.Exe or Visual Studio Extension
Why Are Const Parameters Not Allowed in C#
How to Select Only the Records with the Highest Date in Linq
How to Pass an Object to Httpclient.Postasync and Serialize as a JSON Body
How to Create Migrations After Upgrading to ASP.NET Core 2.0
The Remote Certificate Is Invalid According to the Validation Procedure