Domingo
Posts: 7
Joined: Tue Jan 20, 2004 3:17 am

How do I restore a backup?

I have written 2 .exe Attached actions that go with my package.
backup.exe
restore.exe

backup.exe makes a backup of some files that my package will replace. If the user decides to remove the application, the AI uninstaller will delete the replaced files. I need to replace those files with the backup copy I made.

I put backup.exe as an Attached action with the BEGIN standard action to which I pass the [TARGETDIR] to determine the path.

The problem I'm having is that the uninstaller seems to be running my restore.exe BEFORE it AI actually deletes the file.

Which standard action should I choose to ensure my restore.exe runs ONLY after the uninstaller has finished removing the files.?

Thanks.
Domingo.
UdreaMihai
Posts: 90
Joined: Wed Mar 23, 2005 8:13 am

Hello Domino,

A good ideea is that your Custom Action be the last action that Windows Installer will perform. In order to do that you must insert your Custom Action under InstallFinalize. So the answer at your question is: InstallFinalize.

Also, you must make your custom action run only on Uninstall by setting the Execution Condition to: REMOVE="ALL"

Let me know if you have any other questions.

Best,

Mihai
Udrea Mihai
Advanced Installer Team
http://www.advancedinstaller.com
Domingo
Posts: 7
Joined: Tue Jan 20, 2004 3:17 am

Ah great, I will try with REMOVE="ALL". I actually tried it without it but it was running during install/uninstall. Will update the post with my results.

Thanks.
Domingo
Posts: 7
Joined: Tue Jan 20, 2004 3:17 am

It works great!!
Thanks Mihai.

Domingo.

Return to “Common Problems”