Solved

Has anyone used .NET to detect previous installations and allow the users to decide if they would like to upgrade?

Posted on 2004-10-04
4
193 Views
Last Modified: 2009-05-29
I have a .NET deployment project in which I would like to give the users the option to upgrade if a previous version of the project is detected.  Here is the problem at hand:

A .NET deployment project allows a developer to set the RemovePreviousVersions property in an install package, which (when set to True) automatically uninstalls a previous version prior to installing the current version.  When set to False, the user is presented with a message box stating that an existing version of the application is installed, and the install exits.

How can/does one add a dialog box to the deployment project which:
a) only shows up if a previous version is detected
b) allows the user to upgrade (i.e., remove the previous version) or exit the install

Any information on how to set this up will be most appreciated!

Thanks a bunch!
0
Comment
Question by:dangerwill
  • 2
4 Comments
 
LVL 9

Expert Comment

by:glsac
ID: 12218953
I did this in VB :) Do you need it in .NET?
0
 

Author Comment

by:dangerwill
ID: 12218981
Yes.  This is a .NET install only, and the wrapper is .NET.  If the developers would use Installshield or Wise, this would be easily accomplished.  We know we can place a dialog box in, the problem is how to set it up conditionally during the installation and tweak it from there.

Thanks!
0
 
LVL 16

Accepted Solution

by:
RobertRFreeman earned 500 total points
ID: 12222137
That's a tough one.  I don't think there is a priorVersionExists property available for a conditional command.  It looks as if it's all or nothing with the RemovePreviousVersion property.

If you need to do this, you could check for existing files in the install directory or check for existing entries in the registry (better).
When deploying, copy the msi file to the deployment directory.
Then if you find the entry in the registry or the msi file in the directory, you would prompt the user, then run a custom action to uninstall the prior version.  (Use the setup.msi /x command).
0
 
LVL 16

Expert Comment

by:RobertRFreeman
ID: 12222453
Should be setup.exe /x /qb instead of setup.msi.  (You will need the setup.exe file as well in your install directory for this.)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Automated testing suggestions? 2 47
VB.Net Report Printing Issue 3 36
Moving code from one TFS branch to another 3 25
start a process from a service 3 24
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question