AWarn
Posts: 17
Joined: Wed Sep 14, 2016 11:32 am

Backup files before installation

Hi,
I would like to backup a directory before installation if the [APPDIR] that was chosen by the user during the installation already contains files and folders. I tried several things but nothing worked for me, yet. Last I tried similar actions as described in this previous post: http://www.advancedinstaller.com/forums ... hp?t=27901.
I created a registry entry, a new folder e.g. on [Windows Volume]/backup and set-up a copy/move file operation for that folder to copy/move the whole [APPDIR] folder.
The folder is created but nothing inside although a few files and folders are still existing in [APPDIR] before installation.

What can be my problem or is another way better to fulfil my task?

Thanks in advance,
Andre
korr
Posts: 48
Joined: Tue Sep 09, 2014 3:13 pm

Re: Backup files before installation

Make sure you copy/move action is done after [APPDIR] is set (Seems to be 750 in all my sequences) during the install sequence.


I have ran into issues before when using APPDIR in a xml search, where we didnt find the xml file purely because APPDIR is set _AFTER_ the searches are performed.
AWarn
Posts: 17
Joined: Wed Sep 14, 2016 11:32 am

Re: Backup files before installation

That was also my thought that this action is carried out somewhere at the wrong time in the sequence. But I used the built-in File copy/move operation feature in "Files and Folders" tab and not a custom action. In this case it must be executed on my chosen component installation. And from the tree it should be the first components that will be installed.
Question is why this operation is not executed anyway because there are files available during any time of the install sequence. In the verbose file I cannot see any information about a file copy.

I used these options for my operation

Source File Name: *.*
Source File Folder: APPDIR

Destination File Name:
Destination File Folder: APPDIR\Backup

Component: Backup's component
Execute On: Component install
Operation: Copy
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Backup files before installation

Hi Andre,

The "File Copy/Move" operation is performed during the "Add Resources -> MoveFiles" standard action of the new version of your product. However, the old version have already been removed at that point because during the upgrade of an application the old version is first removed and then the new version is installed.

In order to backup your files you can create your own custom action with this functionality and execute it before the "Remove Resources" action group. You can take a look on the "How to uninstall an existing application" thread which describes how you can backup a file through a BAT file added as a custom action.

Let me know if this helped, otherwise give me more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AWarn
Posts: 17
Joined: Wed Sep 14, 2016 11:32 am

Re: Backup files before installation

Finally got it after a lot of testing. Thanks for the impulse.

Best regards,
Andre
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Backup files before installation

You're welcome Andre. I'm glad you got this working.

Just let us know anytime you need help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”