Solved

How to make this happen in setup project?

Posted on 2008-06-22
8
827 Views
Last Modified: 2013-11-13
Hi,

I have a c# windows application project to be released. a setup project has been done for this and the msi file works correctly. The only thing pending is: If I reinstall the application over existing installation, I want to see a warning message to remind uninstallation the existing one first.

How to do this in setup project? I am using setup project in visual studio 2005

thanks
0
Comment
Question by:viola123
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 16

Assisted Solution

by:MikeMCSD
MikeMCSD earned 50 total points
ID: 21843172
>> If I reinstall the application over existing installation, I want to see a warning message to remind uninstallation the existing one first.

If you change the release/revision number (in project properties) the new one will
automatically overwrite the old one, so you don't need to do this.
0
 
LVL 40

Assisted Solution

by:Vadim Rapp
Vadim Rapp earned 150 total points
ID: 21843212
>  If I reinstall the application over existing installation

please clarify what is "existing installation".  Same product, previous version? or same version?
0
 
LVL 6

Author Comment

by:viola123
ID: 21843301
hi, vadimrapp1:

"existing installation" means previous version

thx
0
 
LVL 6

Author Comment

by:viola123
ID: 21843304
hi, MikeMCSD:

I want to avoid automatically overwriting, this is why I have to check this.

thx
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 4

Accepted Solution

by:
cavehop earned 300 total points
ID: 21843895
The trick is to check the undocumented public property PREVIOUSVERSIONSINSTALLED. Probably what you will need to do is create a custom action whose "Condition" property is set to PREVIOUSVERSIONSINSTALLED. This way, if this value is True, the custom action will run. In the custom action, simply prompt the user with an appropriate message and return the code to cancel installation if necessary.

Note: Just FYI, this property is created by Visual Studio not my MSI.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 21849131
Instead of the custom action, you can add Launch Condition:

NOT PREVIOUSVERSIONSINSTALLED

and appropriate message.



Also, in setup project properties, you have to specify RemovePreviousVersions=True, otherwise PREVIOUSVERSIONSINSTALLED property is not created.
0
 
LVL 4

Expert Comment

by:cavehop
ID: 21849386
vadimrapp1,

I thought about using the Launch condition also, but the problem with that is that I think it will not prompt the user to decide whether or not to continue with the install. It will simply say something like, "Sorry, no installing for you."

Good catch with making sure the RemovePreviousVersions = True. I completely forgot about that.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 21849531
> I think it will not prompt the user to decide whether or not to continue with the install. It will simply say something like, "Sorry, no installing for you."

Right.

I suggest that you learn best practices with major, minor, and small upgrades, for example here:
http://msdn.microsoft.com/en-us/library/aa370579.aspx
http://helpnet.acresso.com/robo/projects/installshield12helplib/MajorMinorSmall.htm

You probably have to consider the possibility that the user won't uninstall old version, but install the new one into the same directory :-(
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Code works but I need to redo it and assign values to Model 7 31
Allow User To Arrange Columns At Datagridview 3 19
SQL Login 17 37
Help with Syntax 9 24
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

937 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

10 Experts available now in Live!

Get 1:1 Help Now