My frustration level is nearing 10. I've been working on a wix installer for a couple weeks now. This installer installs prerequisites for our software. I don't have Visual Studio so I made a batch file to build (read command line only) the wix project. There are about 9 prerequisites which include .msi, .msu, and .exe files in this bundle.
My question relates specifically to the ExePackage described in the chain element. It seems several (but not all) ExePackages always install regardless of the DetectCondition, InstallCondition, on Install, and on Unistall. The log file shows the DetectCondition = true and the InstallCondition = false but these problem ExePackages still execute and install. Every. Time.
I read somewhere on stackoverflow in the past two weeks of frustration, that ExePackages don't allow the same visibility by the installer as .msi files and that can cause problems with exactly what I'm dealing with. I seem to remember someone mentioning how, on uninstall, the ExePackage gets executed and if the actual .exe file doesn't have the proper internal flags, it will install instead of uninstall. However, if I remember correctly, although those answers were good for their questions, I haven't been able to find something that completely prevents the execution of the ExePackage under certain conditions.
EDIT 1: I'm using WiX Version 3.7.
I'd like an example or some lifeline giving me a clue about how to do this. Here's an example of a problem ExePacakge:
...
<Bundle Name='MySoftware' Version='1.0.0.0' Manufacturer='MyCompany'
UpgradeCode='{GUID}'
Condition='(VersionNT >= v6.1 AND ServicePackLevel >= 1)'>
...
<util:FileSearch Id='CheckChromeVersion' Path='[ProgramFilesFolder]Google\Chrome\Application\chrome.exe' Variable='CHROMEVERSION' Result='version' />
<util:FileSearch Id='CheckChromeExists' Path='[ProgramFilesFolder]Google\Chrome\Application\chrome.exe' Variable='CHROMEEXISTS' Result='exists' />
...
<Chain>
...
<ExePackage Id='Chrome'
Compressed='yes'
SourceFile='.\installers\ChromeStandaloneSetup64-v51.0.2704.103.exe'
PerMachine='yes'
DetectCondition='CHROMEEXISTS AND CHROMEVERSION="51.0.2704.103"'
InstallCondition='(NOT CHROMEEXISTS) OR (NOT CHROMEVERSION="51.0.2704.103")' />
...
</Chain>
</Bundle>
...
And here are all instances of 'chrome' from the log file:
[0910:0794][2017-09-20T06:30:33]i000: Setting numeric variable 'CHROMEEXISTS' to value 1
[0910:0794][2017-09-20T06:30:33]i000: Setting version variable 'CHROMEVERSION' to value '51.0.2704.103'
[0910:0794][2017-09-20T06:30:33]i052: Condition 'CHROMEEXISTS AND CHROMEVERSION="51.0.2704.103"' evaluates to true.
[0910:0794][2017-09-20T06:30:33]i101: Detected package: Chrome, state: Present, cached: None
[0910:0794][2017-09-20T06:30:34]i052: Condition '(NOT CHROMEEXISTS) OR (NOT CHROMEVERSION="51.0.2704.103")' evaluates to false.
[0910:0794][2017-09-20T06:30:34]w321: Skipping dependency registration on package with no dependency providers: Chrome
[0910:0794][2017-09-20T06:30:34]i000: Setting string variable 'WixBundleLog_Chrome' to value 'C:\Users\User\AppData\Local\Temp\MyProgram_20170920063033_2_Chrome.log'
[0910:0794][2017-09-20T06:30:34]i000: Setting string variable 'WixBundleRollbackLog_Chrome' to value 'C:\Users\User\AppData\Local\Temp\MyProgram_20170920063033_2_Chrome_rollback.log'
[0910:0794][2017-09-20T06:30:34]i201: Planned package: Chrome, state: Present, default requested: Absent, ba requested: Absent, execute: Uninstall, rollback: Install, cache: Yes, uncache: Yes, dependency: None
[01B4:0E6C][2017-09-20T06:30:54]i305: Verified acquired payload: Chrome at path: C:\ProgramData\Package Cache\.unverified\Chrome, moving to: C:\ProgramData\Package Cache\9102865AE2381BC34E91C107DA5818CF971356E8\ChromeStandaloneSetup64-v51.0.2704.103.exe.
[01B4:0F1C][2017-09-20T06:31:19]i301: Applying execute package: Chrome, action: Uninstall, path: C:\ProgramData\Package Cache\9102865AE2381BC34E91C107DA5818CF971356E8\ChromeStandaloneSetup64-v51.0.2704.103.exe, arguments: '"C:\ProgramData\Package Cache\9102865AE2381BC34E91C107DA5818CF971356E8\ChromeStandaloneSetup64-v51.0.2704.103.exe"'
[0910:0794][2017-09-20T06:31:33]i319: Applied execute package: Chrome, result: 0x0, restart: None
[01B4:0F1C][2017-09-20T06:31:59]i351: Removing cached package: Chrome, from path: C:\ProgramData\Package Cache\9102865AE2381BC34E91C107DA5818CF971356E8\
[0910:0794][2017-09-20T06:32:02]i410: Variable: CHROMEEXISTS = 1
[0910:0794][2017-09-20T06:32:02]i410: Variable: CHROMEVERSION = 51.0.2704.103
[0910:0794][2017-09-20T06:32:02]i410: Variable: WixBundleLog_Chrome = C:\Users\User\AppData\Local\Temp\MyProgram_20170920063033_2_Chrome.log
[0910:0794][2017-09-20T06:32:02]i410: Variable: WixBundleRollbackLog_Chrome = C:\Users\User\AppData\Local\Temp\MyProgram_20170920063033_2_Chrome_rollback.log
Thanks in advance for your help.
InstallCondition
: If the condition evaluates to false and the bundle is being installed, repaired, or modified, the package will be uninstalled. That means it should be trying to uninstall the package, but no uninstall command is given. I would imagine that means the bundle is executing the installer with some parameters that the installer is ignoring. Try adding anUninstallCommand
with whatever parameters are necessary to removeChromeStandaloneSetup64-v51.0.2704.103.exe
(if that's even possible). – philselmerInstallCondition
as the bundle will only install the package ifDetectCondition
evaluates to false (or is omitted). "Burn uses this condition to determine how to treat this package during a bundle action; for example, if this condition is false or omitted and the bundle is being installed, Burn will install this package." – philselmer