sabarnett
10-08-2007, 05:54 AM
I have a line in the OnPreInstall event that sets my backup file location as follows:
-- Set the location of backup files
_BackupFolder = SessionVar.Expand("%AppFolder%\\sufBackup");
That works fine and the files listed in the archive are backed up to this folder when the approriate option is ticked. I also have the following code in the On Post Install event:
local result = File.Install(appPath .. sourceFile,
appPath .. destFile,
FILE_INSTALL_SAMEOLDER,
true,
false,
nil,
nil);
File.Delete(appPath .. sourceFile, false, false, false, nil);
This installs a file with a new name, so allowing me to effectively rename a file during the install. In the options to File.Install I have requested that the file be backed up before the copy. This gives me two issues:
The backup is placed in the same folder as the file, NOT the backup folder I requested.
The backup is of the SOURCE file, not the one I'm overwriting. That seems a little pointless as, surely, the file to be backed up should be the one you're about to overwrite.
Any way I can change this behaviour?
Thanks
Steve
-- Set the location of backup files
_BackupFolder = SessionVar.Expand("%AppFolder%\\sufBackup");
That works fine and the files listed in the archive are backed up to this folder when the approriate option is ticked. I also have the following code in the On Post Install event:
local result = File.Install(appPath .. sourceFile,
appPath .. destFile,
FILE_INSTALL_SAMEOLDER,
true,
false,
nil,
nil);
File.Delete(appPath .. sourceFile, false, false, false, nil);
This installs a file with a new name, so allowing me to effectively rename a file during the install. In the options to File.Install I have requested that the file be backed up before the copy. This gives me two issues:
The backup is placed in the same folder as the file, NOT the backup folder I requested.
The backup is of the SOURCE file, not the one I'm overwriting. That seems a little pointless as, surely, the file to be backed up should be the one you're about to overwrite.
Any way I can change this behaviour?
Thanks
Steve