all groups > dotnet setup > september 2004 >
You're in the

dotnet setup

group:

How to avoid certain files from being overwritten during Upgrade



How to avoid certain files from being overwritten during Upgrade manpreet
9/27/2004 7:29:08 PM
dotnet setup: Hi,

I need certain files not to be overwriten during installation in upgrade
version of already installed setup. How to acheive the above tasks t in VS
..Net Setup Project?

Any other suggestion in this regard are most welcome.

Regards,
Manpreet Singh

Re: How to avoid certain files from being overwritten during Upgrade Phil Wilson
9/27/2004 7:46:34 PM
If you're talking about the RemovePreviousVersions project property, this
works by uninstalling the old version and then re-installing the new
version, so you're not overwriting anything anyway. What kind of files are
you talking about? Data files that the user may have updated?
--
Phil Wilson
[MVP Windows Installer]
Definitive Guide to Windows Installer
http://www.amazon.com/exec/obidos/tg/detail/-/1590592972/104-7044380-4696760

[quoted text, click to view]

Re: How to avoid certain files from being overwritten during Upgrade Phil Wilson
9/29/2004 8:02:33 AM
It's difficult to know what to advise.The upgrade method that Visual Studio
provides is the RemovePreviousVersions project property. This and other
settings cause a new version to uninstall the prior version and then install
the new version. So what was installed by the older version will be
uninstalled, including files that may have been updated by the user. Ideally
this is something you take into account when you design your first version.
For minor changes to an installed product, people often build patch files,
msp files, and these obey the file overwrite rules you want.
Or if you're going to be installing exactly the same files in your new
version, you can do what's called a minor upgrade by reinstalling the
product. Build the new MSI file, a new version, the same productcode, and
then install it with:
msiexec /i <new msi file> REINSTALL=ALL REINSTALLMODE=vomus.
Another general technique is for the new version to locate and copy the
updated files that you want to preserve, but this requires a custom action,
and Visual Studio's custom actions are sequenced so that they are called
after the old product is removed, so that won't work.
--
Phil Wilson
[MVP Windows Installer]
Definitive Guide to Windows Installer
http://www.amazon.com/exec/obidos/tg/detail/-/1590592972/104-7044380-4696760

[quoted text, click to view]

Re: How to avoid certain files from being overwritten during Upgrade manpreet
9/29/2004 12:35:11 PM
Yes , I am talking about the file that previous version of setup has
installed and user has updated it.
Say a lower version version of setup has installed a particluar file. The
user may or may not have updated it. Now if the user installs a
Upgrade(Higher) version on already installed lower version of setup, the
upgrade setup should not copy that file if exists in the destination
location. How to achieve it?

Also, how can i make certain files not to be removed from the system after
uninstallation ?

Regards,
Manpreet Singh

[quoted text, click to view]

Re: How to avoid certain files from being overwritten during Upgrade Mike Blake-Knox
9/30/2004 12:59:26 PM
[quoted text, click to view]
I struggled with the same problem for a while. Eventually, I wrote a
"MsiWrapper" program that grabs the original (i.e., modified by the user)
files when it is started and then runs the Windows Installer. When msiexec
exits, the MsiWrapper program takes the old and new files then uses an XSLT
transform to merge them.

It's definitly not the ideal way to prevent loosing the user changes but it
does work.

Mike
AddThis Social Bookmark Button