How to upgrade via msi - installation

I want to upgrade my product via msi setup.
The Upgrade Code of both msi remains the same because it's the same product family. Even if I change Version/Product Code of the msi for updating it just tells me the product is already installed or asks me to repair it. it doesn't ever provide an update option that replaces the current installation.
I'm using Visual Studio 2008 Pro to generate the msi setup

When you change the Version property in your Setup project, Visual Studio should prompt you to also change the ProductCode. You must do this. Then, you must also set the RemovePreviousVersion property to true. Make sure the UpgradeCode stays the same.
This is probably the easiest way and, from reading your question, what you are looking for. Note that this is more of an uninstall, then reinstall, than an "upgrade" per se.

Related

VisualStudio 2010 setup project to InstallShield seamless transition

I just installed VS2013. As there is no longer the Setup Project, I installed InstallShield LE. I used integrated import wizard and hoped any newer build would automatically update older versions created with VS Setup project. Well, I used to alter the Product Version, which prompted me to alter the Product Code, and that was it. Now I thought this should work with InstallShield as well, so I updated the product version and manually generated the product code. I had the older application installed and tried to reinstall it with this new IS LE setup. And the result is: There are two applications installed, which have exactly the same name and path (it installed in the same directory), but different version. I can really see 2 programs with the same name in "Programs and Features". I checked the upgrade code, it is the same for both. What did I do wrong?
Thanks
Check the installation type, i.e. per user or per machine. It must be the same for both versions, otherwise Windows Installer will skip removing the old versions and you will end up with both versions on your machine.
A verbose log created when you install the new version should also be helpful, you can search for FindRelatedProducts and RemoveExistingProducts standard actions in it, to see why the old version is not removed.
Well finally we were able to solve the problem. You need to place an entry to the Upgrades Path section. Oddly enough You need to do this manually and it's not done automatically by the IS import wizard.

VS 2008 Setup changed, having two installations in Control Panel

My Visual Studio 2008 setup project is changed so that merge modules for MFC and VC have replaced DLL's that were installed manually in the installation folder. I'm okay with merge modules, but there is a problem. In previous setup user could choose between "Everyone" and "Just me". In new setup this choice has no effect, and installation is always for everyone because of merge modules, which must be installed for everyone. So, if previous installation was "just for me" then new installation does not remove DLL's of previous installation, and in Control Panel there are two installations with the same name.
In setup project of new version ProductCode is changed, UpgradeCode is not, RemovePreviousVersion is set to true, and Version is higher than it was before.
If I exclude merge modules from setup, and install new version "just for me" then all is well. Old files are removed, and there's only one installation in Control Panel. But I would rather not burden users with separate installation of redistributable packages.
How can I in Visual Studio 2008 setup have both merge modules, and instruct setup to remove previous version, even though previous version was "just for me", and new is for "everyone"?
Mаybe better question would be what would you do in my place to resolve this issue?
Windows Installer (handler of MSI files) will not uninstall one product during the installation of another. Also, the same installation is viewed as two different products when installed both per user ("just me") and per machine ("everyone"). It is therefore nothing you can do from .msi to uninstall old per user installation if new is to be installed per machine.
Options are, ordered by preference:
Make bootstrapper installation (.exe) that would seek and uninstall all that needs uninstalling. Bootstrapper is also preferred way to install prerequisites, instead of doing with merge modules.
From .msi you can just detect that something is wrong, and stop the installation. I've done this, but will work on first option as well.
Ignore the problem, say it's by design, and do nothing. It's all in the hands of the user.

OCX file does not deploy from MSI generated with Visual Studio 2003 on Windows 7

I have an legacy installation from a DotNet 1.1 application (with Visual Studio 2003) that will not deploy the msflxgrd.ocx file on the FIRST installation on Windows 7. If I uninstall the MSI and then run the same MSI again, (and future installations on the same laptop), the msflxgrd.ocx file deploys. At first I suspected that it was a regsvr32 issue, but since there is no file to register, it seems to be more of a deployment issue. I have administrative rights on the machines.
I have links to the MSI logs here:
Is anyone able to help?
Thanks!
My previous answer was to explain what was going wrong. This answer will be how to fix it.
InstallShield distributes a Merge Module for this control that contains version 6.0.84.18. However, it seems that this merge module is old and doesn't include a security update that was released by Microsoft a few years back. See the thread:
Updated Merge Modules for MS08-070 Security Bulletin
In the thread Mike Marino tried to get updated merge modules from Microsoft but was told:
Microsoft will not be providing Merge Modules for these. They
recommended that users either build their own MSMs or include these
files in their own MSIs.
So here is what I would do. Make sure the msflxgrd.dll is the latest version from MS08-070 (6.1.98.14) or newer. Author it into your installer in the SystemFolder directory. Mark it as Permanenet = true. Set the Register attribute to vsdraCOM and set the SharedLegacyFile = true.
Rebuild your installer and test your upgrade scenario again. You should be good to go.
From what I see in Log 1, the machine is not as clean as you think. FindRelatedProducts is finding a previous installation of your product and telling RemoveExistingProducts to uninstall it before installing your new version.
I've seen situations when the component rules are violated that MSI thinks a file doesn't need to be installed but the file then gets uninstalled by the removal of the product being upgraded and the file ends up not being installed. By uninstalling and reinstalling you break that up into two steps so that when the second install evaluates the need for the file it comes back as yes and gets installed.
The fact that this is an OCX COM server is just a coincidence and not really relevant to the real problem.
I'd need the MSI already installed and the MSI upgrading to give you specific remedys.
Action start 14:55:44: FindRelatedProducts.
MSI (s) (A0:18) [14:55:44:119]: PROPERTY CHANGE: Adding PREVIOUSVERSIONSINSTALLED property. Its value is '{08D8BF6E-E399-4B8A-8B8D-7DFF68F81131}'.
MSI (s) (A0:18) [14:55:44:119]: Skipping action: ERRCA_CANCELNEWERVERSION (condition is false)
MSI (s) (A0:18) [14:55:44:119]: Doing action: VSDCA_VsdLaunchConditions
Action ended 14:55:44: FindRelatedProducts. Return value 1.

Visual Studio: How to automatically uninstall previous installed version?

I have a simple Web Setup project that reads from a Deployable Project.
Even though I have set the Setup to DetectNewerInstalledVersion to false I always get that annoying alert box that a previous installation exists and I need to go to the Control Panel and find the software to remove it...
Is there a way to add a script in a new new installation Dialog that could say A previous version was found, press NEXT to uninstall it. ?
Older versions are uninstalled automatically if you increase your Product Version and change the Package Code. This needs to be done each time you modify the setup project and build a new package.
If you keep the same version and Product Code, older builds cannot be uninstalled automatically. They are detected by Windows Installer before your new package is actually launched. So you need to uninstall them manually.
In my case I found out that the setup project wasn't part of the configuration manager.
Therefore, it wasn't rebuld on solution rebuilds and setup file with the new version and ProductCode wasn't generated.
The solution is simply to right click on the setup project and click rebuild.
Hope this help to future readers :)
The answer is not to use the Visual Studio setup project that's already integrated. I'm having the exact same problem: it won't remove previous versions even though I up the version, set it to remove previous version, check for previous version and rebuild, I can install but the files aren't updated. There are some good tools for this out there, check out bitrock, inno setup or wix.
Also Visual Studio 2010 was the last version with setup project support. It's not included in 2012.
I struggled with this for a long time but it is very simple.
Go to manage VS Extensions (VS2019) and install 'Microsoft Visual Studio Installer Project' v0.9.9
Right click on your installer project and go to properties. Keep the UpgradeCode variable in the properties window the same for different versions of the same product.
Change your ProductCode variable between different builds.
Now when you install the product with the same UpgradeCode already on the system, the installer will upgrade your existing product and you will only have one program in the Add/Remove window.
Create a .bat file
Write this code:
wmic product where name="SetupProgramName" call uninstall /nointeractive
cd Debug
setup.exe
Put this file in installer directory.

How do I allow msi installers to install older versions over newer ones?

I'm setting up an automatic deployment scheme. It would be really handy for us if we could put older msis on the server and have all the clients roll back to previous versions if one of our new releases turns out to be too bug riddled.
Right now, the msi is bitching at me "Unable to install because a newer version of this product is already installed". What kind of property can I set to turn this behavior off? I will gladly do so in my post build vb script.
Thanks
Isaac
Are you using a group policy on your
domain to deploy the msi?
Do you have
a setup project for your msi in
Visual Studio?
Anyhow, I see a solution but not sure if that's right for you...
You need the code matching the old msi that you want to deploy back.
Open the solution matching the code of the old msi.
Using <F4>, open the properties window of the setup project matching the msi,
Increment the Version to a higher number then the one currently deployed. It will ask if you want to change the product code, click Yes.
Rebuild the setup project then deploy.
Since the built msi has a higher version number, it will update the one deployed.
I solved this by changing the DetectNewerInstalledVersion property to false.
It doesn't bitch anymore about this.
Now, with the script that sets the REINSTALLMODE to amus and this setting, my msi will overwrite anything regardless of version.

Resources