We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

mayday175
Posts: 3
Joined: Fri Oct 06, 2006 12:00 am

Backup existing files

I am currently testing Advanced Installer to see if it is suitable for our environment... so yes, I am a noob (sorry).

I have sucessfully created a simple package that installs files and shortcuts exactly as I want them. However, 2 of the files installed replace existing Windows files (.htm files). When I uninstall the package, these 2 files are removed ok but the original files are not restored... so the end result is that these 2 files no longer exist after an uninstall.

Is there a way to create backups of these overwritten files so they can be safely restored to normal when the package is removed?

Thanks


Edit: Appologies if this is a duplicate thread... I havn't yet found another thread that answers my question. If such a tread exists, please advise...
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Switch to "Organization" page and mark the components associated with those files as permanent. With this flag set the component will not be removed on uninstall.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
mayday175
Posts: 3
Joined: Fri Oct 06, 2006 12:00 am

Thanks Gigi

Appologies for the confusion, but I don't think thats the solution I was looking for. I do not want to leave my packaged files behind after uninstall. I'd like the original files (replaced by my package) to be reinstated when the package is removed... such that the system is restored to its original state b4 my package was installed.

Thanks for your help...
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

This can be done with two VBS custom actions. One scheduled on install that copy the file in a temp location and one scheduled on uninstall that copy back the file from the temp location.

Here is the VBS code for the first custom action:

Code: Select all

Dim oFS
Set oFS=CreateObject(" Scripting.FileSystemObject" )
oFS.CopyFile "C:\Windows\file.txt"  , _
"C:\Windows\Temp\file.txt" 	
Set oFS=Nothing
Here is the VBS code for the second custom action:

Code: Select all

Dim oFS
Set oFS=CreateObject(" Scripting.FileSystemObject" )
oFS.CopyFile "C:\Windows\Temp\file.txt"  , _
"C:\Windows\file.txt" 	
Set oFS=Nothing
Hope this helps.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
mayday175
Posts: 3
Joined: Fri Oct 06, 2006 12:00 am

Aha! Thats sweet...

I added a line "oFS.DeleteFile..... " to remove the temp backup(s) and it runs just fine.

Thanks Gigi :)

Return to “Common Problems”