I am currently working on a Excel 2010 add-in and I've managed to create a Windows Installer project for it which is installing the add-in successfully on any machine. However, I am facing an issue: in order to install a new version of the add-in I have to first uninstall the previous one...
In the Windows Installer project I've set the RemovePreviousVersions property to True, but this didn't help in any way...
In order to create the MSI I've used this guide which doesn't mention anything about updates... http://msdn.microsoft.com/en-us/library/ff937654.aspx
Any ideas and suggestions would be appreciated!
Thank you!
You probably get the message "Another version of this product is already installed"?
Usually, this message is showed if you created a package, installed it, modified its contents and then you tried to install it again without uninstalling the original one. Basically, Windows Installer can upgrade the original package only if the modified one has a higher version and a different Product Code. If you don't want to create a new version of the package, you need to uninstall the original MSI before installing the modified one.
A simple method would be to create a small batch file in which you call msiexec with the /x option to remove the old version, than you call it with /i option to install the new one.
Every MSI package has UpgradeCode. With help of it you can manage upgrades.
In your case, if you have previous MSI, need take this code and add it to UpgradeTable of your new MSI. More information on MSDN
Related
I've written a Visual Studio extension which installs using an MSI. The install puts a extension.vsixmanifest file in the right place, and the extension appears in the Extension Manager as expected:
The problem is, when I publish a new version on the Visual Studio Gallery, the Extension Manager does not report it. I add the new version by creating a new installer and editing the existing page. Each new installer has a new ProductCode, PackageCode and ProductVersion (I update the MSI setup project and the version number in the included extension.vsixmanifest), but the same UpgradeCode; an example 'upgrade' commit can be found on GitHub here.
The issue appears to be that when Visual Studio Extension Manager queries the extensions service for the latest version of my extension, it returns a blank string - the same result as if you query with an invalid extension identifier:
The two extensions successfully queried in the example are the NuGet client tools for VS2015 and the SQL Server Compact/SQLite Toolbox.
What am I missing?
OhhhhhhKAY. I've solved this, and it turned out to be a problem with the Visual Studio Gallery page editor.
When you add an extension, you're shown a VSIX ID box:
When you edit an extension (I'm using Chrome), that box has disappeared!
It's still in the DOM, but it's hidden from view. Because of this, I never entered my extension's VSIX ID into the form, it didn't have a value associated with it, and the extensions service therefore didn't return a version number for that ID. The Extension Manager uses the extensions service to find out the latest versions of installed extensions, so it wasn't reporting new versions of mine.
The VSIX ID box reappears if you deselect then reselect one of the extension's supported Visual Studio versions, so I've been able to assign the ID that way. The service now returns a version number, and the Extension Manager therefore shows available updates:
Probably you may need to raise ProductVersion as well and mind correct version conditions in Upgrade Table in installer project. If this will not help try investigating this issue installing with full verbose log (msiexec /i installer.msi /l*v logfile.log) this may give some clues. The worst case you may want to add an entry to RemoveFiles table to delete this file (during install before deploying your file) but that sounds nasty and i would prefer to avoid it.
I don't think this is a problem with your installer configuration, assuming your installer does, in fact, upgrade your product. If I understand your question correctly, this is an issue with Extension Manager.
Have you tried removing the trailing .0 from your new version string? There might be an poor/unexpected comparison result when comparing a 3-dot version to a 4-dot version.
You could also try doing a more extreme version number change (upping the major version) to see if Extension Manager picks that up.
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.
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.
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.
Excel AddIn, VS2010, C#, Windows Installer
VS2010, Setup project, RemovePreviousVersion: True, DetectNewerInstalledVersion: True, InstallAllUsers:True
I have some install, uninstall codes in Custom Action
When I do a upgrade install, I notice, install is called first, which installs newer version, and then uninstall is called, which uninstalls the newer version. The end result is not-working AddIn left.
If I do a new install (i.e. no earlier version of AddIn), then only install is called and addin installs successfully
Installer used to work fine when I built it in VS2008, and I just converted projects to VS2010 and then the issue comes up.
Anyone know why ? thanks
You likely have RemoveExistingProducts scheduled incorrectly - I don't know if this can be changed in VS Setup Packages, but that will be the action that is causing all your pain.
I already answered in comment under my question. Now answer it explicitly for convenience in search.
I edited my MSI-file in Orca resequenced RemoveExistingProducts right after InstallInitialize (sequence number 1501). This was found in the InstallExecuteSequence table. This was originally sequence number 6550.
Pls refer Web setup project removes files after upgrade from VS2008 to VS2010