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
188 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now