- Why Online Dating Doesn T Work
- Installer Remove Previous Versions Does Not Work
- Doesn't And Don't
- Doesn't Meaning
Active1 year ago
I have a MSI build using WiX version 3.
All previous installers for the product we are deploying worked fine with the configuration specified (that is: if previous version exists, remove, then install the new version) - however, the new MSIs we build don't install all files when it runs through the 'remove first' path.
If we manually remove the existing installation and then run the new version all the files are installed - and when I examine the MSI file in Orca the files and features are shown and seem to be fine.
We have tried running with verbose and extra logging turned on (
/l*vx
) however all we can see if that the files are not being registered & then installed.RemovePreviousVersions doesn't exactly work, since it's a different installer, unless I'm misunderstanding something. My current idea, which will probably work, is to add code in the OnBeforeInstall method to rename the old Client.exe.config to a. There is nothing you can run in your install to uninstall the previous version - that's RemovePreviousVersions and it does work, but why can't you analyze the problem. If the right Dll is on the system, then why doesn't Excel find it? I guess that the install process checks the sequence nubmer of the FindRelatedProducts prior to removing previous versions. If it detect the sequence number is smaller than the current one, the install process doesn't attempt to uninstall previous versions. This is a bug, and other people have reported it recently. Basically, Windows Installer doesn't have access to the per-user locations of another user (the HKEY_CURRENT_USER hive, some folders under 'Documents and Settings' etc.). Therefore, a per-machine installation cannot upgrade a per-user installation (it cannot remove the original files). Return code details: Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel. MSI does not install all files when RemovePreviousVersion is run. But setting to amus doesn't being on. Visual Studio Installer Project: RemovePreviousVersions.
Any thoughts or suggestions? This is driving us up the wall.
saschabeaumont20.4k4 gold badges56 silver badges83 bronze badges
Matthew SavageMatthew Savage2,0209 gold badges38 silver badges51 bronze badges
4 Answers
Why Online Dating Doesn T Work
Based on the default custom action sequence, Windows Installer determines which files need to be installed/overwritten before removing any existing versions of software. Windows Installer uses the value of the REINSTALLMODE property to tell it how to make decisions about when to overwrite files. If REINSTALLMODE contains an 'o', then it will only install files where the version is different or the file doesn't already exist; non-versioned files will only be installed if the Modified Date of the file is <= the Created Date (i.e. the file is not modified). If the REINSTALLMODE contains an 'a', it will always install the file, regardless of any version or date information attached to existing files.
What is happening in your scenario is most likely the following:
- Windows Installer determines which files to install. It decides that some files don't need to be installed (possibly because they already exist and are of the same or newer versions as the ones in the MSI).
- The previous version of software is removed, including the files Windows Installer determined didn't need to be installed.
- Windows installer installs files for the new installation, but does not install files that it determined did not need to be installed.
The end result is that a bunch of files are missing after upgrading the software. Setting REINSTALLMODE=amus instead of omus will likely fix your problem, but you should make sure you know how this affects the rest of your installation. If there are any files that you don't want to be overwritten, you will need to mark those components to 'Never Overwrite'.
Kevin KiblerKevin Kibler10.6k8 gold badges32 silver badges58 bronze badges
OK, well talking to someone else where I am helped me find a solution to the problem.
Installer Remove Previous Versions Does Not Work
We added the property
REINSTALLMODE
and set it to amus
. What does this mean?By default the property is set to
omus
which means: Reinstall if the file is missing or older, rewrite registry for machine and user hives, reinstall shortcuts. Changing this to amus
basically says: Reinstall all files.Doesn't And Don't
So, not 100% sure what the cause was - I suspect there may have been strange locks or something, but setting to
amus
doesn't being on any adverse effects, so we'll stick with that.Thanks for the suggestions.
(Also, more details on this property can be found here: MSDN: REINSTALLMODE Property
Matthew SavageMatthew Savage2,0209 gold badges38 silver badges51 bronze badges
What does your
<RemoveExistingProducts After='>
step look like? It could be that the removeexisting is running after the install -- and removing all files that were the same in the previous and current versions.I have my installer set to
<RemoveExistingProducts After='InstallInitialize'>
to make sure it's done before anything else. I don't know if it's right or not, but it seems to work.Doesn't Meaning
Dave NeeleyDave Neeley
I know this is an older thread, but I encountered a similar problem that was not covered by the solutions. In my case, I had a DLL that was actually a lower number version than its predecessor. This DLL would never appear on an upgrade install. Running
and checking the log showed that the file never was installed. It just did not appear in the log as one of the files installed. The MSI definitly contained the file, the best evidence being that a Repair would place the file. Mpp to mpx converter. Also, exploding the MSI with various tools showed the file present. A straight install on a clean machine would always work.
This did not help:
I am building the MSI with Wix, and I have been using this script for many years. Most recently we set the script to completely delete the old directory in our 5.3 version. This had worked to 5.2 -> 5.3 and 5.3 -> 5.4 upgrades. But with the 5.5 version, the DLLs were all rebuilt with new versions of the DLLs. The DLL projects were hosted in GitHub. The build script for this particular DLL was set to be an assembly version of '10.0.0.{git rev-list --count HEAD}'. The project had been moved, causing the HEAD count to go from 444 to 30.
The wixscript include has this,
so we update the product guid (not the product upgrade guid) on each release.
The remedy was to slightly change the build script of this dll to set the assembly version to go to '10.0.1.{git rev-list --count HEAD}', presumably being treated as a higher numbered version.
Why this worked, I am unable to explain.
Ben ButzerBen Butzer
Not the answer you're looking for? Browse other questions tagged installerwixwindows-installerwix3 or ask your own question.
RemovePreviousVersions problems
RemovePreviousVersions problems
I've created a program and using a setup and deployment project, I've created an msi file to use for installation. I'm including the Crystal Reports merge module, so the installation takes quite a while. The install works fine, it's when I create a new version that I'm having problems. I have a database that I don't want to get removed when the user installs an update. If I set RemovePreviousVersions to true, then it removes it. Also, it has to take the time to uninstall the CR merge modules, and then reinstalls it, which takes forever! So, because of those, I don't want it to actually remove the previous versions. I want it to just overwrite the exe and such. If I set RemovePreviousVersions to false though, I get two entries in my Add/Remove Programs list. Is there an easy solution for this? Is the only way to do this to create a self-extracting zip that copies a new exe and leaves everything else alone?Thanks - Todd