cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
PatricioVidal
Level 2

How to restore overwritten files at uninstall?

Hello,

I'm a new at InstallShield. I been looking for a couple of days how to solve my issue but with no results.

I'm using InstallShiled 2008 Premier. Developing in Windows XP, and deploying in Vista.

My package installs an extra feature to an already installed application. At installation overwrites a couple of DLLs with newer versions and adds some additional files.

When I uninstall the addtional files are removed, but the overwritten DLLs remain. I need to restore the original DLLs so that the already installed application can run. How do I do that?

Thank you in advance for your help,. Regards,
Patricio.
Labels (1)
0 Kudos
(5) Replies
alegerlotz
Level 7

You could write 2 custom actions to do it...

The first one would be called at INSTALL time of you app to backup the old files.

The second one would be called at UNINSTALL time of your app to restore the old files.

InstallScript would be quick and easy for this.
0 Kudos
PatricioVidal
Level 2

Thank you alegerlotz for your answer.

Yes, it seems that custom actions could do it, but it seems that it should be an easier way to do it. The installer is already going to the process of detecting which files will be overwriten, so that I though it would be a matter of a setting to have the option to recover the original files on uninstall.

I am using the Visual Studio integration so that the DLLs I'm installing are not referenced by name but instead as .Primary_Output. I will have to find out how to get the target DLLs names at runtime in the custom action, see which ones are going to be replaced, and copy them to a backup folder.

Thank you,
Patricio.
0 Kudos
sjaug20
Level 2

Yeah I would also like know the answer to this one without scripting
0 Kudos
KathyMorey
Level 10

The installer is already going to the process of detecting which files will be overwriten, so that I though it would be a matter of a setting to have the option to recover the original files on uninstall.

Except that the installer doesn't save the original files. You have to do that if you want to restore them.
0 Kudos
retzcat
Level 6

I had to do this as well.. I ended up creating batch files that run in the back ground to back up the files, then on uninstalll, put the original files back...

Only problem is - now my uninstall takes files away that it didn't install ....
:eek: :mad:
0 Kudos