Adding Merge Module to Wix Project Causes Upgrade to Fail - installation

So, I have a product installer authored using WiX which is failing to upgrade correctly once the 'Microsoft_VC100_CRT_x86.msm' merge module is incorporated. The old product is not removed during the installation. If the merge modules are removed from the project the removal of the old version takes place as it should.
The merge module is included quite simply under a Directory node:
<Directory Id="ProgramFilesFolder">
<Merge Id="VC10_CRT_MergeId1" Language="0" SourceFile="c:\\Program Files (x86)\\Common Files\\Merge Modules\\Microsoft_VC100_CRT_x86.msm" DiskId="1" />
... other stuff
</Directory>
and then referenced in the features:
<Feature Id="MainFeature" Title="Core Files" Level="1">
<MergeRef Id="VC10_CRT_MergeId1" />
... other stuff
</Feature>
I am incrementing the version number of the product but the upgrade fails to happen and the new version is installed over the old version but without performing a correct upgrade - both versions are listed in 'Add or Remove Programs'.
The old product should be removed as follows:
<InstallExecuteSequence>
<RemoveExistingProducts After='InstallValidate'/>
</InstallExecuteSequence>
I have also tried various other positions for RemoveExistingProducts as per http://jpassing.com/2007/06/16/where-to-place-removeexistingproducts-in-a-major-msi-upgrade/, with the same results.
In the verbose log for the installer the following is seen:
MSI (s) (AC:44) [19:48:22:300]: Doing action: RemoveExistingProducts
MSI (s) (AC:44) [19:48:22:300]: Note: 1: 2205 2: 3: ActionText
Action start 19:48:22: RemoveExistingProducts.
MSI (s) (AC:44) [19:48:22:300]: Note: 1: 2205 2: 3: Error
MSI (s) (AC:44) [19:48:22:300]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 22
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2205 2: 3: Error
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 23
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2205 2: 3: Error
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 16
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2205 2: 3: Error
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 21
Action ended 19:48:22: RemoveExistingProducts. Return value 1.
In the WiX build log I get the following (but from memory this is normal with the VC runtime msms?):
1>light.exe(0,0): warning LGHT1076: ICE82: This action SystemFolder_x86_VC.F1DD796A_B984_3DCA_A68D_6B352BDC86F3 has duplicate sequence number 1 in the table InstallExecuteSequence
1>light.exe(0,0): warning LGHT1076: ICE82: This action SystemFolder_x86_VC.F1DD796A_B984_3DCA_A68D_6B352BDC86F3 has duplicate sequence number 1 in the table InstallUISequence
1>light.exe(0,0): warning LGHT1076: ICE82: This action SystemFolder_x86_VC.F1DD796A_B984_3DCA_A68D_6B352BDC86F3 has duplicate sequence number 3 in the table AdminExecuteSequence
1>light.exe(0,0): warning LGHT1076: ICE82: This action SystemFolder_x86_VC.F1DD796A_B984_3DCA_A68D_6B352BDC86F3 has duplicate sequence number 3 in the table AdminUISequence
1>light.exe(0,0): warning LGHT1076: ICE82: This action SystemFolder_x86_VC.F1DD796A_B984_3DCA_A68D_6B352BDC86F3 has duplicate sequence number 3 in the table AdvtExecuteSequence
The InstallExecuteSequence in the msi looks like the following:
If the merge module is removed (it needs to be included due to updated files in the installer) then the upgrade works as expected. Is this a bug in the merge module stuff/WiX/Windows Installer, or am I doing something wrong?

You're not getting any error messages on the upgrade? It goes through but you're left with two Add/Remove entries and a messed up file system? It sounds like your two versions don't share the same upgrade code.
If you're trying to do a minor upgrade, RemoveExistingProducts won't be triggered. Files should be updated but you'll keep one Add/Remove entry.
If you're trying to do a major upgrade that will trigger RemoveExistingProducts, but you need to set up the Upgrade element correctly.
Also, as a tip, don't use the merge modules. Due to how Windows Installer component rules work, on a minor upgrade you cannot remove the components the merge module adds. You would need to introduce a major upgrade. (Or add all the component codes from the old merge module to your project by hand. Not fun.) Depending on how all your stuff is set up, forcing a major upgrade could be a big hassle.
You'll run into this if you add the merge module and later need to remove it. Or if you want to replace say the VS 2010 module with the VS 2012 one. MS even broke component rules between service packs once. It's much easier to install them by running the vcredist*.exes during or before your product's install.

Have you found the problem yet? Check if the version of merge modules you are adding is older than that already existing on the system you are installing. In that case, the MSI would remove the VC++ files but not put the new ones down because they were older.
Edit: I found the solution to your problem!!
you should be using:
RemoveExistingProducts After="InstallFinalize
Refer: http://blogs.msdn.com/b/astebner/archive/2007/02/08/assemblies-may-be-missing-from-the-gac-or-winsxs-cache-after-an-msi-major-upgrade.aspx
I had the same issue and changing this fixed it.

Related

How do I make WIX execute command immediately at uninstall

I have a java desktop application which is using WIX to install the application. At install WIX is creating a folder located in the {...}/AppData/Local folder. The application is then populating this folder with subfolders and files during execution of the application.
We noticed that at uninstall of the application this folder is not removed (if it is populated, if it is empty it is removed via the RemoveFolder elelemt) which leads to unpleasantries.
Reasearch into the matter shows that the RemoveFolder element can only remove empty folders, ie. without subfolders and files. For solving the issue I came up with the solution of executing a batch file with code for removing the whole folder, including sub folders and files, via a Custom Action. I thought of placing this file in the installation path of the application, which is not the same as where the folder I want to remove is placed.
After turning on logging for installing/uninstalling the application I find that this custom action is not executedc in the correct order, ie. it is executed after the installation folder is removed and thereby the batch file is never run.
Here is my WIX InstallExecuteSequence:
<InstallExecuteSequence>
<Custom Action='RemoveAlelionFolder' After="InstallFiles">
Installed AND NOT UPGRADINGPRODUCTCODE
</Custom>
<RemoveExistingProducts After="InstallValidate"/>
</InstallExecuteSequence>
<CustomAction Id='RemoveAlelionFolder' ExeCommand='[INSTALLDIR]remove.bat' Directory="INSTALLDIR" Execute="deferred" Return='asyncNoWait' />
Here are parts of the install/uninstall log file:
Action ended 15:20:21: RemoveShortcuts. Return value 1.
Action start 15:20:21: RemoveFiles.
MSI (s) (8C:BC) [15:20:21:111]: Counted 9 foreign folders to be removed.
MSI (s) (8C:BC) [15:20:21:111]: Removing foreign folder: C:\Users\Public\Desktop\
MSI (s) (8C:BC) [15:20:21:111]: Removing foreign folder: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Company\
MSI (s) (8C:BC) [15:20:21:111]: Removing foreign folder: C:\Users\{username}\AppData\Local\Company\ **<-- This is not working if folder contains files**
MSI (s) (8C:BC) [15:20:21:111]: Removing foreign folder: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Company\
MSI (s) (8C:BC){Removing a lot of folders here}
MSI (s) (8C:BC) [15:20:21:112]: Doing action: RemoveFolders
MSI (s) (8C:BC) [15:20:21:112]: Note: 1: 2205 2: 3: ActionText
Action ended 15:20:21: RemoveFiles. Return value 1.
Action start 15:20:21: RemoveFolders.
MSI (s) (8C:BC) [15:20:21:113]: Doing action: CreateFolders
MSI (s) (8C:BC) [15:20:21:113]: Note: 1: 2205 2: 3: ActionText
Action ended 15:20:21: RemoveFolders. Return value 1.
Action start 15:20:21: CreateFolders.
MSI (s) (8C:BC) [15:20:21:114]: Doing action: InstallFiles
MSI (s) (8C:BC) [15:20:21:114]: Note: 1: 2205 2: 3: ActionText
Action ended 15:20:21: CreateFolders. Return value 1.
MSI (s) (8C:BC)
MSI (s) (8C:BC) [15:20:21:118]: Note: 1: 2205 2: 3: Patch
MSI (s) (8C:BC) [15:20:21:118]: Note: 1: 2228 2: 3: Patch 4: SELECT `Patch`.`File_`, `Patch`.`Header`, `Patch`.`Attributes`, `Patch`.`Sequence`, `Patch`.`StreamRef_` FROM `Patch` WHERE `Patch`.`File_` = ? AND `Patch`.`#_MsiActive`=? ORDER BY `Patch`.`Sequence`
MSI (s) (8C:BC) [15:20:21:118]: Note: 1: 2205 2: 3: MsiSFCBypass
MSI (s) (8C:BC) [15:20:21:118]: Note: 1: 2228 2: 3: MsiSFCBypass 4: SELECT `File_` FROM `MsiSFCBypass` WHERE `File_` = ?
MSI (s) (8C:BC) [15:20:21:118]: Note: 1: 2205 2: 3: MsiPatchHeaders
MSI (s) (8C:BC) [15:20:21:118]: Note: 1: 2228 2: 3: MsiPatchHeaders 4: SELECT `Header` FROM `MsiPatchHeaders` WHERE `StreamRef` = ?
Action start 15:20:21: InstallFiles.
MSI (s) (8C:BC) [15:20:21:118]: Doing action: RemoveAlelionFolder **<-- Here is action for removing folder w/ files**
MSI (s) (8C:BC) [15:20:21:118]: Note: 1: 2205 2: 3: ActionText
Action ended 15:20:21: InstallFiles. Return value 1.
Action start 15:20:21: RemoveAlelionFolder.
MSI (s) (8C:BC) [15:20:21:119]: Doing action: CreateShortcuts
MSI (s) (8C:BC) [15:20:21:119]: Note: 1: 2205 2: 3: ActionText
Some research effort:
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Removing-Folders-td703071.html
Removing files when uninstalling WiX
How to add a WiX custom action that happens only on uninstall (via MSI)?
https://stackoverflow.com/questions/320921/how-to-add-a-wix-custom-action-that-happens-only-on-uninstall-via-msi
Solved!
I had to run the Custom Action 'After='InstallInitialize' in order for it to run at the correct place in the flow of the code.
<InstallExecuteSequence>
<Custom Action='RemoveAlelionFolder' After="InstallInitialize">
Installed AND NOT UPGRADINGPRODUCTCODE
</Custom>
<RemoveExistingProducts After="InstallValidate"/>
</InstallExecuteSequence>

Cannot get MajorUpgrade to work with setup produced with different installer

I have a problem getting a wix installer to do a major upgrade when the previous versions installer was made by a different toolkit. I have my product defined like this:
<Product Version="!(bind.FileVersion.baustatik.exe)" Id="*"
Name="DIE Anwendungen"
Language="0"
Codepage="1252"
Manufacturer="D.I.E. Software GmbH"
UpgradeCode="6DCA3BAD-77E9-41AE-8F72-B92DE136C499">
<Package InstallerVersion="400"
Compressed="yes"
InstallScope="perMachine"
InstallPrivileges="elevated" />
<MajorUpgrade
AllowDowngrades="no"
AllowSameVersionUpgrades="no"
DowngradeErrorMessage="Es ist bereits eine neuere Version von [ProductName] installiert." />
..... other stuff
The above produces an msi. That msi is chained inside a bundle. The bundle is defined like this:
<Bundle Name="DIE Anwendungen"
Version="!(bind.packageVersion.The32bitMsi)"
Manufacturer="D.I.E. Software GmbH"
UpgradeCode="6DCA3BAD-77E9-41AE-8F72-B92DE136C499"
HelpUrl="https://www.die.de/impressum"
Copyright="Copyright D.I.E. Software GmbH"
HelpTelephone="0800 343 2255"
UpdateUrl="https://www.die.de/downloads.aspx"
IconSourceFile="$(var.SolutionDir)applications\xfalt\xfalt.loader\baustatik.ico"
AboutUrl="https://www.die.de">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
<bal:WixStandardBootstrapperApplication
LogoFile="res/banner.png"
ThemeFile ="res/ClassicTheme.xml"
LocalizationFile="res/ClassicTheme.wxl"
SuppressOptionsUI="yes"
LicenseUrl=""/>
</BootstrapperApplicationRef>
I have verified that
- i'm using the same upgrade code
- i'm building a new product code (*) for every update
- I'm using the same language-id (language_neutral: 0)
- !(bind.FileVersion.baustatik.exe) produces the version info that i expect
When i build the setup like this, install, increase the version number, build and install (all using wix), the major upgrade takes place.
When i install the setup for a previous version (one that was build using 'advanced installer') - where the upgrade code was the same - and next install a newer version where the setup was build using wix, the major upgrade does not work. i.e.: No files or startmenu entries from the previous version are beeing removed and i end up with 2 entries in control panel.
Any suggestions what might be causing this ?
(Edit)
I did what Bogdan suggested. The full log, however, did not have any helpful information.
FindRelatenProducts:
MSI (c) (8C:88) [17:34:20:741]: Doing action: FindRelatedProducts
MSI (c) (8C:88) [17:34:20:741]: Note: 1: 2205 2: 3: ActionText
Aktion 17:34:20: FindRelatedProducts. Nach verwandten Anwendungen wird gesucht
Aktion gestartet um 17:34:20: FindRelatedProducts.
Aktion beendet um 17:34:20: FindRelatedProducts. Rückgabewert 1.
... and later:
MSI (s) (2C:04) [17:34:24:762]: Doing action: FindRelatedProducts
MSI (s) (2C:04) [17:34:24:762]: Note: 1: 2205 2: 3: ActionText
Aktion gestartet um 17:34:24: FindRelatedProducts.
MSI (s) (2C:04) [17:34:24:762]: Skipping FindRelatedProducts action: already done on client side
RemoveExistringProducts gives:
Aktion gestartet um 17:34:24: RemoveExistingProducts.
MSI (s) (2C:04) [17:34:24:841]: Note: 1: 2205 2: 3: Error
MSI (s) (2C:04) [17:34:24:841]: Note: 1: 2228 2: 3: Error 4: SELECT Message FROM Error WHERE Error = 22
MSI (s) (2C:04) [17:34:24:841]: Note: 1: 2205 2: 3: Error
MSI (s) (2C:04) [17:34:24:841]: Note: 1: 2228 2: 3: Error 4: SELECT Message FROM Error WHERE Error = 23
MSI (s) (2C:04) [17:34:24:841]: Note: 1: 2205 2: 3: Error
MSI (s) (2C:04) [17:34:24:841]: Note: 1: 2228 2: 3: Error 4: SELECT Message FROM Error WHERE Error = 16
MSI (s) (2C:04) [17:34:24:841]: Note: 1: 2205 2: 3: Error
MSI (s) (2C:04) [17:34:24:841]: Note: 1: 2228 2: 3: Error 4: SELECT Message FROM Error WHERE Error = 21
Aktion beendet um 17:34:24: RemoveExistingProducts. Rückgabewert 1.
Concerning perUser/perMachine:
In my (wix)package (see code) i have "InstallScope='perMachine'" and in the "AdvancedInstaller" i have "Installation Type: per machine only" - i assume this is the same thing.
Any other ideas?
(EDIT 2)
I have done as PhilDW suggested and opened the upgrade tables for the old and the new msi using orca. I did find the following.
Old msi:
New msi:
However, i do not know what to make of that. Given that information, does anybody know what i have to put in my wix code in order to upgrade the old msi ?
The major upgrade could fail even if the upgradecode is the same, if the install type of the package is different (per user or per machine - this happens a lot) or if the install language is different (which you already checked).
You can install the new MSI and create a verbose log while you do this, then search the log for RemoveExistingProducts and FindRelatedProducts. Next to one of these standard actions you will find an explicit message about why the upgrade is skipped.
Bogdan is on the right track. However the log would indicate if there was a related product installed, and it would show its ProductCode and say something about the other context, and those things are not in the log. That means you'll need to look directly at the Upgrade table in the MSI file to make sure that the version checking is correct in the minimum/maximum fields. There's nothing in the posted data I can see verifying the actual version of the older product and the versions that the Upgrade will search for. It also wouldn't hurt as a sanity check to see that you actually have an Upgrade table in your MSI. Docs here:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa372379(v=vs.85).aspx
You may as well check that the languages match with the older product, and that the Attributes don't have OnlyDetect set (unlikely, but being thorough).
It's also not clear to me that you have incremented ProductVersion in the first three fields, another requirement for a major upgrade.
There are some odd things that can cause issues. WiX forces uppercase Guids at build time, as required for ProductCode. I have come across issues when the original product was installed with lowercase ProductCode or UpgradeCode, and that was because it seems that some of the searches related to these are case-sensitive. Unlikely, however.
The way I have solved it was setting the predefined REINSTALL and REINSTALLMODE properties manually like this...
<Product>
<!-- ... your code ... -->
<SetProperty Id="REINSTALL" Value="ALL" After="FindRelatedProducts">Installed AND REMOVE<>"ALL"</SetProperty>
<SetProperty Id="REINSTALLMODE" Value="omus" After="FindRelatedProducts">Installed AND REMOVE<>"ALL"</SetProperty>
<!-- ... your code ... -->
</Product>
... where omus refers to these codes:
o : Reinstall if the file is missing or is an older version.
m : Rewrite all required registry entries from the Registry Table that go to the
HKEY_LOCAL_MACHINE
or
HKEY_CLASSES_ROOT
registry hive.
u : Rewrite all required registry entries from the Registry Table that go to the
HKEY_CURRENT_USER
or
HKEY_USERS
registry hive.
s : Reinstall all shortcuts and re-cache all icons overwriting any existing shortcuts and icons.
You can also use e or a instead of o:
e : Reinstall if the file is missing, or is an equal or older version.
a : Force all files to be reinstalled, regardless of checksum or version.
(Taken from Microsofts development center here)
The answer is: For some strange reasons, the Upgrade-Code that is listed in my version of the 'Advanced Installers' UI, is NOT the actual upgrade-code. Using orca revealed the one from the UI (which I was using) as well as a different one (which was not shown in the UI).
Changing the upgrade code in the wix source so it uses the "other" Upgrade-Code worked.
Note: I could not find Orca on microsoft.com. MSDN has several references to it, and it's supposed to be part of the Windows SDK, but it's not. I used an alternative download site which still had a copy.

AtmelStudio 7 installation failed for avr8 device support package

I am trying to install AtmelStudio 7 on Windows 7, but the installation stopped after some time. The following error message is shown:
An error occured
AVR8 Device Support
What i tried so far:
I took also a quick look at Atmel-FAQ, but the suggested solution (call as-installer-*.exe SHELLCOMMAND=/NoWeb /NoRefresh /NoRestart) did result in the same error message.
I scanned the log messages, but failed to find something helpful.
Remove all Atmel components and drivers by using the Windows uninstall mechanism
Question
Has anybody an idea how to get AtmelStudio 7 installed?
Update
I solved the installation problem as follows:
The error indicated that the IDE installation is corrupt chances are the registry keys are messed up.
1) Go to a command prompt and run the following command
wmic product where "vendor like 'Atmel%'" get Name, Version
This will list the product which are part of the machine and comes from Atmel. If it lists either 'Atmel Studio IDE 7.0' or 'Atmel Studio Development Environment' chances are component is not uninstalled properly.
2) In order to clean up the above component use a third party utility(http://www.revouninstaller.com/revo_uninstaller_free_download.html) to remove the above components from the system.
Note: In order for Revo Uninstaller to list the above components go to Tools->Options->Show System components and check it.
3) After the clean up of the above component and registry to verify the clean up succeeded run the following command again.
wmic product where "vendor like 'Atmel%'" get Name, Version
If the clean up was successful it should not list 'Atmel Studio IDE 7.0' or 'Atmel Studio Development Environment'.
4) Now you can install Atmel Studio.
I also had the error after having uninstalled Atmel Studio 7.0.582.
Unfortunately, it messed up the registry, such that I could not use the "wmic" program (it just does not anything for an eternity).
After some hours of searching, I found this Microsoft tool for fixing install/uninstall issues:
https://support.microsoft.com/en-us/help/17588/fix-problems-that-block-programs-from-being-installed-or-removed
Using that is easy and the steps described above very similar:
Choose "Problems with uninstalling" (or something like that)
Find and select either 'Atmel Studio IDE 7.0' or 'Atmel Studio Development Environment'
Apply the corrections
After that, I was able to install AS 7.0.1006 sucessfully.
Here I have the same failure on a laptop running win7
When I checked the log files found the following error, but I still have not been able to fix it...
Property(S): INSTALLLEVEL = 1
Property(S): SOURCEDIR = C:\ProgramData\Package Cache\{C327F1B0-01E9-45BB-AE07-AD204C992A31}v7.0.922\
Property(S): SourcedirProduct = {C327F1B0-01E9-45BB-AE07-AD204C992A31}
Property(S): ProductToBeRegistered = 1
MSI (s) (58:48) [13:08:41:248]: Note: 1: 1708
MSI (s) (58:48) [13:08:41:249]: Note: 1: 2205 2: 3: Error
MSI (s) (58:48) [13:08:41:249]: Note: 1: 2228 2: 3: Error 4: SELECT Message FROM Error WHERE Error = 1708
MSI (s) (58:48) [13:08:41:249]: Note: 1: 2205 2: 3: Error
MSI (s) (58:48) [13:08:41:249]: Note: 1: 2228 2: 3: Error 4: SELECT Message FROM Error WHERE Error = 1709
MSI (s) (58:48) [13:08:41:249]: Product: AVR8 Device Support — Installation failed.
MSI (s) (58:48) [13:08:41:250]: Windows Installer installed the product. Product Name: AVR8 Device Support. Product Version: 7.0.922. Product Language: 1033. Manufacturer: Atmel. Installation success or error status: 1603.
MSI (s) (58:48) [13:08:41:255]: Deferring clean up of packages/files, if any exist
MSI (s) (58:48) [13:08:41:255]: MainEngineThread is returning 1603
MSI (s) (58:D4) [13:08:41:259]: RESTART MANAGER: Session closed.
MSI (s) (58:D4) [13:08:41:259]: No System Restore sequence number for this installation.
=== Logging stopped: 7/3/2016 13:08:41 ===
MSI (s) (58:D4) [13:08:41:264]: User policy value 'DisableRollback' is 0
MSI (s) (58:D4) [13:08:41:264]: Machine policy value 'DisableRollback' is 0
MSI (s) (58:D4) [13:08:41:264]: Incrementing counter to disable shutdown. Counter after increment: 0
MSI (s) (58:D4) [13:08:41:267]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1
MSI (s) (58:D4) [13:08:41:268]: Restoring environment variables
MSI (s) (58:D4) [13:08:41:269]: Destroying RemoteAPI object.
MSI (s) (58:50) [13:08:41:269]: Custom Action Manager thread ending.
MSI (c) (FC:64) [13:08:41:282]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1
MSI (c) (FC:64) [13:08:41:283]: MainEngineThread is returning 1603
=== Verbose logging stopped: 7/3/2016 13:08:41 ===</code><br/>
Maybe these resources helps you.
https://support.microsoft.com/en-us/kb/834484
http://www.avrfreaks.net/comment/1922756#comment-1922756
If anybody knows what's going wrong, please let us konw !
Thanks !
Another issue that happened to me is hanging the installation at
Atmel Studio Development Environment Applying
Details: Initializing environment
And the useful solution is killing the AtmelStudio.exe (*32) process which was apparently running in the background as part of the installation process.
The following link is where I found the solution:
http://www.avrfreaks.net/comment/1918991#comment-1918991
And finally after some seemingly scary steps...!

MSI Install Failed - Error 1723

I'm having trouble installing our software on certain machines when installing our .msi built in VS2015.
Without VS2015, I get this in the log file:
MSI (s) (24:64) [11:21:22:095]: Doing action: InstallFinalize
Action 11:21:22: InstallFinalize.
Action start 11:21:22: InstallFinalize.
MSI (s) (24:64) [11:21:22:095]: User policy value 'DisableRollback' is 0
MSI (s) (24:64) [11:21:22:095]: Machine policy value 'DisableRollback' is 0
Action 11:21:22: RollbackCleanup. Removing backup files
MSI (s) (24:64) [11:21:22:585]: Creating MSIHANDLE (13) of type 790536 for thread 8036
MSI (s) (24:74) [11:21:22:595]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIAE3F.tmp, Entrypoint: _KSTInstallSC#4
MSI (s) (24:74) [11:21:22:595]: Generating random cookie.
MSI (s) (24:74) [11:21:22:645]: Created Custom Action Server with PID 1160 (0x488).
MSI (s) (24:5C) [11:21:22:765]: Running as a service.
MSI (s) (24:5C) [11:21:22:775]: Hello, I'm your 32bit Elevated Non-remapped custom action server.
CustomAction _3F7B94EF_231A_421E_BF8B_C0760F3B266E returned actual error code 1157 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (24:74) [11:21:22:975]: Closing MSIHANDLE (13) of type 790536 for thread 8036
MSI (s) (24:64) [11:21:22:975]: Note: 1: 1723 2: _3F7B94EF_231A_421E_BF8B_C0760F3B266E 3: _KSTInstallSC#4 4: C:\Windows\Installer\MSIAE3F.tmp
MSI (s) (24:64) [11:21:22:975]: Note: 1: 2262 2: Error 3: -2147287038
MSI (c) (8C:0C) [11:21:22:975]: Note: 1: 2262 2: Error 3: -2147287038
DEBUG: Error 2835: The control ErrorIcon was not found on dialog ErrorDialog
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2835. The arguments are: ErrorIcon, ErrorDialog,
Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action _3F7B94EF_231A_421E_BF8B_C0760F3B266E, entry: _KSTInstallSC#4, library: C:\Windows\Installer\MSIAE3F.tmp
MSI (s) (24:64) [11:21:25:796]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (24:64) [11:21:25:796]: Product: KST -- Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action _3F7B94EF_231A_421E_BF8B_C0760F3B266E, entry: _KSTInstallSC#4, library: C:\Windows\Installer\MSIAE3F.tmp
I have looked in Visual Studio and there are no custom actions that match anything in the log file.
Something to note, after installing VS2015 on a test PC, the installation worked fine, so it's definitely missing a DLL or something. But installing VS2015 on all of our clients' machines isn't practical.
Is there any way I can package the files needed along with the msi? And if so, how can I find the name of the depended DLL files?
Depending on how you built this package, there's probably a better way to track this down in the project. But let's pretend we received this package and want to make it work despite it being faulty.
You know the entry point is _KSTInstallSC#4, which gives you something to look for in the Target column of the CustomAction table in the built MSI using your favorite MSI editing program. The record in that table should refer with its Source column to a row in the Binary table that contains the DLL. Once you extract that DLL, you can use any tool that shows you dependencies, such as Dependency Walker, CFF Explorer, or even dumpbin /imports.
As for how to fix it, on a single machine just install the dependency. But to fix it in the package, you will probably have to change how the DLL is being built. For instance, you might make it import the C++ runtime statically so it has no unusual external run time dependencies.
You've done something related to the KST product, it's a C++ application that apparently you're running as a custom action, either deliberately or through including a merge module. Error 1157 indicates a failure to load, so it must have a dependency on at least one other Dll that isn't installed.
Judging by the GUID appended (3F7B94EF_231A_421E_BF8B_C0760F3B266E) to the custom action name I would say you have a merge module included into your package/project, that runs this custom action, just as Phil mentioned.
I had the same issue just recently, and in my case it was Windows Defender that had a false positive on that tmp-file that is mentioned in the MSI log as the DLL that it can't find. Defender identified it as a virus and removed the file before MSI package could use it.
So, try disabling Defender/any other Antivirus software and try again.
For me helped answer by Michael Urman
I compilled library in VS2019 in Release mode so in library dependences I saw vcruntime140.dll (pic. from CFF Explorer) and this DLL I could find in C:/Windows/System32 . This librares you can install through C++ Redistributable packedges.
For more explanation of problem - in previous I compilled project in Debug mode and as dependency in DLL I saw vcruntime140D.dll - and on machine without VS I got error Error 1723 on my Custom Action

Enable feature by default in WIX

While extending a WIX-installer that I have to maintain, I ran into the following problem - when shown the tree of features and components, the product feature is not selected by default.
I tried different variations, including adding InstallDefault ='local', TypicalDefault ='install', and Absent = 'disallow', however, the feature is still disabled.
Here is the code that describes the feature:
<Feature Id="Complete" Level="1"
Display='expand'
InstallDefault ='local'
TypicalDefault ='install'
Absent = 'disallow'
Title="$(var.ProductName)">
<ComponentGroupRef Id="Required_files"/>
<?ifdef InstallDriver?>
<ComponentGroupRef Id='driver_files'/>
<?endif?>
<ComponentRef Id="ProgramMenuShortcuts"/>
<ComponentRef Id="ProductInfo"/>
<?ifdef RemoveAllRegKeys?>
<ComponentRef Id="RegRemoveAll"/>
<?endif?>
<ComponentGroupRef Id="FBmodule"/>
</Feature>
Having examined the logs, I see some entries that seem to be related to this (this is happening when I manually set the feature to "install to local hard disk").
MSI (c) (FC:90) [16:43:57:559]: PROPERTY CHANGE: Adding MsiSelectionTreeSelectedFeature property. Its value is 'Complete'.
MSI (c) (FC:90) [16:43:57:559]: PROPERTY CHANGE: Adding MsiSelectionTreeSelectedAction property. Its value is '2'.
MSI (c) (FC:90) [16:43:57:559]: PROPERTY CHANGE: Adding MsiSelectionTreeSelectedCost property. Its value is '0'.
Action 16:43:57: FeaturesDlg. Dialog created
MSI (c) (FC:90) [16:51:44:645]: Note: 1: 2727 2:
.... many repetitions of Note: 1: 2727 2:
MSI (c) (FC:90) [16:51:45:146]: Note: 1: 2727 2:
MSI (c) (FC:90) [16:51:45:630]: Note: 1: 2205 2: 3: MsiAssembly
MSI (c) (FC:90) [16:51:45:630]: Note: 1: 2228 2: 3: MsiAssembly 4: SELECT `MsiAssembly`.`Attributes`, `MsiAssembly`.`File_Application`, `MsiAssembly`.`File_Manifest`, `Component`.`KeyPath` FROM `MsiAssembly`, `Component` WHERE `MsiAssembly`.`Component_` = `Component`.`Component` AND `MsiAssembly`.`Component_` = ?
MSI (c) (FC:90) [16:51:45:630]: Note: 1: 2205 2: 3: _RemoveFilePath
MSI (c) (FC:90) [16:51:45:639]: Note: 1: 2727 2:
MSI (c) (FC:90) [16:51:45:647]: PROPERTY CHANGE: Modifying MsiSelectionTreeSelectedAction property. Its current value is '2'. Its new value: '3'.
MSI (c) (FC:90) [16:51:45:647]: PROPERTY CHANGE: Modifying MsiSelectionTreeSelectedCost property. Its current value is '0'. Its new value: '7318'.
I suspect that this could be related to the fact that there is a custom dialog in the installer - but having looked through the source I could not find anything that would indicate a relationship between the state of the feature and something else in the project.
What are the recommended troubleshooting steps?
Here is the full installation log.
I found the culprit. The installer itself is fine, the problem is in how it is started.
There is a BAT file that I use for testing purposes, it runs the MSI with some command line arguments that simulate different conditions.
The command line arguments REINSTALL=ALL REINSTALLMODE=vomus must only be applied when the installer updates the program; when started that way on a clean system - the progress bar moves and everything goes as expected, but nothing is actually installed.
In other words, the error was in the method of testing.

Resources