?
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
Medium Priority
?
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

801 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