Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make the msi overwrite program if a previous version exist?

I am using Visual Studio 2010, I am working on a windows application and while trying to make an automatic updater for it faced a serious problem.

When the program find a new version and trying to install it, it couldn't because of two reasons:

1- the application is exist in my program files. so that window appears enter image description here

2- the application is already opened "the form that performed the update process".

The problem doesn't have any relation with the version number.

It's about the program existence and the ability to install a new version although the previous version is opened.

like image 367
Hassanation Avatar asked Aug 31 '12 08:08

Hassanation


People also ask

How do I customize an MSI installer?

Similar to Orca, to edit your MSI package, right-click it and select “Open with Advanced Installer”. Once the MSI database has loaded in Advanced Installer, you will notice a left menu pane where you will find all the options you need to directly edit your MSI.

Which of the following switch will reinstall all existing shortcuts?

s - Overwrites all existing shortcuts. v - Runs from source and re-caches the local package. Do not use the v reinstall option for the first installation of an application or feature.

Which command line is used to trigger the repair of an MSI?

Msiexec.exe Command Line.


2 Answers

To enable the automated major upgrade mechanism you need to increase the ProductVersion and change the ProductCode. This is done through the project Properties pane.

You can read more about upgrades here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa370579(v=vs.85).aspx

like image 142
rmrrm Avatar answered Oct 03 '22 04:10

rmrrm


Cosmin is correct, but if you want more specific steps, try following the steps outlined in this other Stack Overflow post:

  • How do I ensure my winform application deployment overwrites old versions?
like image 40
JohnB Avatar answered Oct 03 '22 05:10

JohnB