Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to uninstall previous version automatically?

13 views
Skip to first unread message

Andrew

unread,
Mar 2, 2005, 4:25:07 PM3/2/05
to
Hi, friends,

I created a .msi to deploy my C#.net Windows app. It works fine. However,
after a new version is created, the new .msi can not be installed. The syste
requires to uninstall previous version first. I will then have to go to
Control Panel to remove the old one, and then go back to install the new one.

Do we have a way to allow user to remove the previous version and install
the new one in one shot? Any reference documents?

Thanks a lot.

Phil Wilson

unread,
Mar 2, 2005, 10:52:05 PM3/2/05
to
In the setup project properties in the IDE, RemovePreviousVersions is what
you set True. You also need to increment the Version in that same list of
properties. When you do that, VS will prompt you to change the ProductCode
and PackageCode - say yes. The resulting MSI will automatically upgrade
older versions as long as they are installed the same way (old and new both
"Everyone" or "Just me"). It is an uninstall of the older version, not just
a replacement of newer-versioned files.
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

"Andrew" <And...@discussions.microsoft.com> wrote in message
news:92AEE958-674E-4E44...@microsoft.com...

Andrew

unread,
Mar 3, 2005, 11:53:04 AM3/3/05
to
Thanks, Phil, it worked for me. But, during installation, it did not notify
me that there was an older version installed and did not ask me if I decided
to remove the it or not. In another word, it worked as if the previous
version did not exist at all.

Do we have a way to notify a user the pre-existing version and confirm with
him/her before remove it?

Thanks again...

Phil Wilson

unread,
Mar 3, 2005, 10:46:27 PM3/3/05
to
There isn't really a good way to do this that I can find. I looked at
inserting an extra dialog into the user interface, but you can't make
displaying it conditional. If the search at the start of the install detects
an older version, it creates the PREVIOUSVERSIONSINSTALLED property,
case-sensitive. I couldn't find a good way to use this in a dialog with a
Cancel button. There are ways to do this with other tools or editing the MSI
file manually with Orca, but nothing standard exists in the IDE.

--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

"Andrew" <And...@discussions.microsoft.com> wrote in message

news:EC857473-F186-4B60...@microsoft.com...

Andrew

unread,
Mar 7, 2005, 12:19:03 PM3/7/05
to
thanks a lot...
0 new messages