Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installer not removing previous versions

I have an app. In-order to install the app I'm using a simple Deployment Project with parameters like this:

DetectNewerInstalledVersion = true  
InstallAllUsers = true  
ProductCode = GUID (changing with version)  
RemovePreviousVersions = true  
UpgradeCode = GUID (Allways the same)  
Version = 1.0.5 (changing with each deployment).

Problem is, this installer(Deployment Project) never removes previous versions. It installs on top and windows shows that, I have 2 versions of my program(i.e, app which I installed) but none of theme work correctly.


EDIT
I added one line to assemblyInfo: but it still changes nothing. After analyzing my problem more deeply, i realized that installer changes most of the files in Program Files folder, but it removes icon from Desktop and record from registry. After installing on top, i can't even remove application, because i cannot see it in Control Panel -> Programs -> Programs and Features.
If i install on top, i am not able to use program. But if i run it from program files folder it works (newer version). If i install it twice, everything is ok (while installing it second time, wizard asks to repair or remove program).
Maybe this time somebody has something else to suggest?
Solutions for MSI files does not suit me, because final installer is EXE file.

like image 984
JNM Avatar asked Jan 21 '13 08:01

JNM


1 Answers

I struggled with this for a long time but it is very simple.

  1. Go to manage VS Extensions and install 'Microsoft Visual Studio Installer Project' v0.9.9
  2. 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.
  3. Change your ProductCode variable between different builds.
  4. 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.
like image 80
Anton Esterhuizen Avatar answered Nov 11 '22 00:11

Anton Esterhuizen