View Full Version : Backing up files prior to install of new files.

01-03-2005, 03:56 PM
IS 10.5 Pro
Basic MSI
Dev box is Win XP SP1
Test box is Win XP SP2

Ok, I have tried to write an InstallScript CA to backup some original files. But, the backup folder is not created. I have put it in the Execute sequence after InstallInitialize action. Execute only once. No conditions.

Does anyone have a way of backing up files on the target machine in a Basic MSI project?

Here is the script:

#define BKUPDIR "c:\\Erics\\"

function UserBackupFiles(hMSI)

BOOL bvOpt1, bvOpt2;
string szTitle, szMsg1, szMsg2, szOpt1, szOpt2, svResult, szCaption;

svOrigDir1 = "c:\\program files\\Rational\\SoDAWord\\SoDAWord*.dll" ;
svOrigDir2 = "c:\\program files\\Rational\\RequisitePro\\requisitepro.exe" ;

XCopyFile (svOrigDir1, BKUPDIR , COMP_NORMAL);
XCopyFile (svOrigDir2, BKUPDIR , COMP_NORMAL);


Christopher Painter
01-03-2005, 05:17 PM
You might want to capture the return code of XCopyFile like

nResult = XCopyFile( .... )

Then run the InstallScript debugger, step through and see what nResult =. This is assuming your custom action is configured propertly and is even running.