Visual studio installer msi is not updating UI - visual-studio-2010

Strange issue, but it is bothering me.
When I tried to deploy msi package is not completely updating the previous version. but the version is been updated in control panel but not UI (changes made in UI is not reflecting).
DetectPreviousVersion = True;
RemovePreviousVersion =True;
Installallausers=true;
The product version is higher number than previously installed version, and changed the product code for each higher version.
upgrade code of the previous installed version and new version are same.
If I remove the previous version manually and then install the latest version then I could see the changes in UI.

Proper versioning of your DLL's and EXE's would prevent this.
File Versioning Rules
At the core of any installer is the actual installation of files.
Determining whether to install a file is a complex process. At the
highest level, this determination depends on whether the component to
which a file belongs is marked for installation. Once determined that
a file should be copied, the process is complicated if another file
with the same name exists in the target folder. In such situations,
making the determination requires a set of rules involving the
following properties:
•Version
•Date
•Language

possibly duplicate question:
but for viewers the answer is adding an extra property to msi package using orca.
REINSTALLMODE=amus
amus-updates the all files on upgrade
omus- updates files that are only changes as installer identifies
refer to original answer here

Older versions of Visual Studio setups used to effectively uninstall all the old files and then install the product and it's files. VS 2008 and later require you to update the file version of files that you want to overwrite in the upgrade.

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 2010 Setup Project is NOT removing previous versions

I am using a setup project in VS 2010 to install a windows form application I have created. The setup project works great, however, if I update the application and change the version number and upgrade code of the setup project it does not update the application on the user's machine when the setup project is run again. It will go through the install steps and say that the installation was successful, however, the application that is on the user's computer remains exactly the same and is not the newer version. Oddly enough, if you were to run the setup project again an error will come up saying that this version of the application is already installed and that you must use the add/remove programs to remove the current version to continue with the installation. Has anyone else experienced this issue before. I have heard that this may not be possible using the setup project in VS 2010, but I am hoping that is not the case as this method has worked great for me with the exception of this issue.
You should not be changing the UpgradeCode property, this will have exactly the effect that you are seeing:
Caution
The UpgradeCode should only be set for the first version; it should never be changed for subsequent versions of the application, nor should it be changed for different language versions. Changing this property will keep the DetectNewerInstalledVersion and RemovePreviousVersions properties from working properly.
( via https://wayback.archive.org/web/20121029130031/https://msdn.microsoft.com/en-us/library/465253cd(v=vs.100).aspx )
Assuming you want to remove the old version and replace it with the new one (as opposed to having them installed side-by-side, which is actually what you're doing) you should change the Version (of both the MSI and the file(s) being updated) and the ProductCode (of the MSI) and set RemovePreviousVersions to True.
I encountered same problem.
and I resolved with changing those four.
(I used Visual Studio Community 2019)
[setup project]
・Version
[.Net project]
・Assembly Version
・Assembly File Version
・GUID

DetectNewerInstalledVersion Problem

I'm using vs 2010, and i generate a setup file, i do have RemovePreviousVersion true and DetectNewerInstalledVersion true, at the start i had problem to remove previous version but with a hack in the MSI file it is working, not if I try to install a setup file where I have a higher one already installed on my machine, it won't be detected and will be installed separately. I'm not sure why it is not working, is it because the older version setup file was created by VS2008 ?? and didnt have the option of detectingNewerinstalledVersion true.
who will check for the newer version the older setup version or the newer version will prevent it.
thank you for you help in advance
Jp
In order for two setup projects to be considered the same application they should have different product codes, identical upgrade codes, and different version numbers.
It's hard to tell from your question if this affects you, but there is a serious issue in the way Visual Studio 2010 setup projects handle "upgrade" installations. If an assembly in the older setup has the same AssemblyFileVersionAttribute as the one in the newer setup, the installer assumes the file has not changed and will not replace it with the newer file.
One possible workaround for this problem is to include the [ProductVersion] in your installation directory.

Web setup project removes files after upgrade from VS2008 to VS2010

I have a web setup project built using VS2008. I've converted my solution to VS2010 and now when I build my new installer and run the install from the MSI it installs fine, then at the last step, removes all the files it's just installed.
I have RemovePreviousVersions set to true. If I turn this off the files remain in place (but I get multiple instances in the Programs and Features in the control panel).
If I run the install again, the files reappear. From then on, the files always remain, even when installing another version. So, the problem seems to be with running an installer built using VS2008 and then running the same installer built by VS2010. The upgrade GUIDs on each installer are the same.
What is the cause and how can I fix this?
I haven't tried porting a setup from VS2008 to 2010, but having the same upgrade code for different build versions will cause problems; simple explanation is the msiexec installer fails when it tries to remove the old components because the older components have the same upgrade version as the newer components being installed. There is a VS project setting where you can automatically generate a new upgrade code each time you rebuild your .msi; I generally select this and saves a lot of these versioning headaches.
Uninstall all copies of your app using
add/remove programs
Delete the contents of your %TEMP% folder ( to
get rid of any "old" (VS2008) copies
of your .msi)
Update the GUID for the VS2010 version (I think you do this by right clicking on the
GUID in the properties window and clicking "genereate new GUID")
rebuild the project and try again!
I just encountered this error. Had the exact problem when upgrading. I tried the solution at:
https://connect.microsoft.com/VisualStudio/feedback/details/559575
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.
That solved my problem.
What I've discovered is that changing the UpgradeCode will prevent the files from being removed, however it's then treated as a separate installed program - i.e. in the control panel (Programs and Features) my program appears twice. Logically, I think, this is because it's not the same program.
My only option seems to be to programmatically uninstall the old version in the installer of the new version by writing a custom action.
I've submitted a bug to Microsoft Connect and they've confirmed it's reproducible.

Can we instruct Visual Studio Setup to keep existing files for re-install?

I have a Windows Forms application with an installer (.msi) already created with Visual Studio. I am now creating a new installer for version 2.0 with the property RemovePreviousVersions set to true.
Now, when I install 2.0 over 1.0 it removes 1.0 and installs 2.0 completely.
Is there a way that I can tell the installer if you find some files already installed (like .xml files used for data) then don't override them?
I am trying to have my 2.0 installer serve the 2 purposes:
Install from scratch for new users
Existing users will upgrade but not lose their customizations
The deployment project in VS does not overwrite files. What happens is that since you have RemovePreviousVersions set to true, when you change your program file version and the ProductCode GUID of the setup project, it will first uninstall the previous version and then will do a clean install of the new version.
To make sure some files don't get overwritten, I usually exclude them from the Content or Primary output files (wherever they are located) and then add them separately to the setup project. Doing this, you can individually set properties for those files. The property you are looking for is called Permanent" that if set to true will never uninstall the file in question, and therefore will never overwrite it with a new version. The only drawback with this is that when you uninstall the product, the Permanent files will not get removed from their target locations, but in my case (usually local DB files), that's a good thing ;)
Cheers!
[edit] The above is true for VS 2008 SP1. Haven't tried it on other versions, so hopefully you are using the same VS version or it works for the version you use.
[edit2] Oh, also you could also use the "Condition" property to achieve something similar. If you do that, make sure that "Transitive" is set to True so the Condition is always evaluated. Haven't tried it with Conditions, but that's another option you could look at. Other than these 2, I think that's pretty much it for VS deployment projects.
When I was in a similar situation what I did was:
The files that were customized by each user and should NOT be touched by the installer were NOT included in the MSI (NOT in the Visual Studio Setup Project). When the app was run for the first time I generated the XML files through the code.
The files that were static (e.g. data that was used to populate Dropdownlists) I included in the MSI and I can update those by building a new MSI with Visual Studio.
Basically don't include customizable files in your MSI project. Create them in code for new users.
I never looked into telling the MSI not to update certain files that are included in the MSI file. The solution I came up with was perfect for me. I don't know if it can be done.
I hope this helps.

Resources