I'm working on an old Visual Studio 2008 project which had a setup project. I have upgraded everything to VS2019 made the changes in the code, increased the version, added a few files and made the setup.
A clean install is working perfectly.
When I first install the old version using the setup build in VS2008 and then run the new setup to upgrade this, things go freaky.
The new setup will install all new files, and just before ending it removes all files that were overwritten. Only the files that did not exist will remain.
For example, the old setup places these files in the program file folder:
- program.exe v1.0
- lib.dll v1.0
Then the new setup will install these files, overwriting the old ones:
- program.exe v2.0
- lib.dll v2.0
- other.dll v1.0
- info.txt v1.0
Just before ending the install and enabling the [close] button, the folder contents changes to:
- other.dll v1.0
- info.txt v1.0
I have checked this on multiple computers (Win 10 down to Win 7) and used a filemon tool to make sure that the new files are actually installed and then removed. The Event log only shows a successful install.
Starting the new setup again and choosing 'repair' will work and leave the files. So that is a workaround, but not the nicest one for many users.
A test with two VS2019 setup builds with different versions work correctly. The old VS2008 setups also worked correctly. So it appears to be an issue when upgrading a setup build with VS2008 with a setup build with VS2019.
Does anybody know how to fix this so that installation does not remove the files?
Okay, I had seen some VS2010 questions which looked the same. Solutions there seemed to be manually editing the msi file after the build. Far from optimal and I would assume that it was fixed by MS in VS2019.
Turns out that they have not "fixed" it, but allows Backward Compatible IDs to be used. I suddenly saw this option when going through the options panel again. Change to True:
And this does solve my issue.
More info in this answer
This question can be deleted if someone thinks it's a duplicate. When you think it's helpfull I'll accept my own answer here for archive sake.
Related
Hello Guys
I got an issue when switching my Xamarin.Forms project from VSMac to VsWindows!
"java.exe" exited with code 2 when deploying.
I already try:
delete bin/ obj/ folders
remove all packages and re-add them
MultiDex
Verify the path (removing special char "!##$%ˆ&*(-_" etc..)
If you got an idea, tell me ;)
Regards,
If G Clovs solution doesn't work, then:
make sure the netstandard on your mac is exactly the same on your Windows pc.
Make sure you have the same Android SDK downloaded on your Windows - through Tools Menu > SDK manager.
If you are using stable channel for vs for mac updates, then make sure you are not suing the preview of budget packages on your Windows.
Apply the same logic in 3 for preview channel.
To avoid all these issues:
Simply go to vs for mac 2019, change to stable build and update the vs for mac to latest.
Update all android SDK and build tools to say v28
Update all nugget packages for the two projects and build successfully.
Go to vs 2019 and update vs to latest.
Repeat step 2 for vs.
Deselect preview in nugget package manager, and update nugget packages in the two projects.
Build successful.
Try the below steps, it was working for me.
Open Visual Studio in Windows
Open your Solution
Find for "Resource.designer.cs" file in Android Project and delete it
Remove obj and debug folders form PCL and Android project
Clean and Rebuild
Happy Coding :)
Kishore Kumar
With turning third page of google, I didn't find any answer.
But I found the answer by my own.
The issue was comming from the Android.csproj and the Keystore Path.
It was set to my Mac Path even if I had already changed it on
VSWindows AndroidProject => Properties => Signin
So I removed this lines on Android.csproj (edited with third text editor):
<AndroidKeyStore>True</AndroidKeyStore>
<AndroidSigningKeyStore>YourMacPath/Alias.keystore</AndroidSigningKeyStore>
<AndroidSigningStorePass>Password</AndroidSigningStorePass>
<AndroidSigningKeyAlias>Alias</AndroidSigningKeyAlias>
<AndroidSigningKeyPass>AliasPassword</AndroidSigningKeyPass>
On debug & release Part.
Then you can edit them on VS Windows.
Hope I helped someone.
See ya
I am trying to build a large Visual Studio 2010 solution that contains some setup projects from the command line using the following:
devenv.com mySolution.sln /rebuild "Debug|Mixed Platforms" /out E:\myUser\Desktop\build.txt
The MSI files are generated fine. They actually work and install the application as they should be doing it. But here comes the problem: When a change is made on the code and then the solution is rebuilt following the process described before, the application installed by the new MSI does not contain any of the changes made in the code.
Do you have any comment that could help me understand what is happening?
Thanks in advance.
You can't just rebuild an MSI file and install it when that MSI setup has already been installed. You need a RemovePreviousVersions upgrade (increment the version of the setup project in its properties window and say yes to the answers).
This might be useful:
https://www.simple-talk.com/dotnet/visual-studio/updates-to-setup-projects/
it still applies except that you must also increment the file versions of the binaries in your setup for them to be updated during the upgrade.
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
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.
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.