liorafar
Level 6

How to Backup Existing Files while Installing Hotfix in Custom Action

Hi, i want to backup files in custom action while installing hotfix/patch
I want to do this in managed code custom action using InstallShield.Interop.Msi dll or any other dll. However i dont know how to get the installed files in run time(while installing) in my cutom action.
Does anyone know a function or something else that can get me the installed files(for example the path and thier name or something like that) in run time from Basic msi project?
Thanks!
Labels (1)
0 Kudos
1 Reply
DandamanAUS
Level 6

This might be a bit late for you but for anyone else that comes here.

In the InstallScript section create a new function with something like this:

function BackupSQLites(hMSI)
begin
// for 32 bit
XCopyFile ("C:\\Program Files\\YOUR APP\\YOURFILE.txt" , "C:\\Backups", EXCLUDE_SUBDIR);
// for 64 bit
XCopyFile ("C:\\Program Files (x86)\\YOUR APP\\YOURFILE.txt" , "C:\\Backups", EXCLUDE_SUBDIR);
end;

Then in Create a New InstallScript in Custom Actions and Sequences for this.
And then add it into the Sequences->Installation->UserInterface.

I put it before the Welcome windows.
0 Kudos