How can I save a backup copy of an specific folder to user desktop, when user confirms application uninstall?
I tried this without success... Maybe there is an easier way to do it without using code...
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usUninstall then
begin
FileCopy('{app}\Profile\*', '{userdesktop}\Backup\Profile\', False);
end;
end;
Thank you guys! :)
Triggering the backup on
CurUninstallStepChanged(usUninstall)
is the best solution.The problems you have are:
The
FileCopy
function cannot copy folders.For that see Inno Setup: copy folder, subfolders and files recursively in Code section.
You have to use the
ExpandConstant
function to resolve the{app}
and the{userdesktop}
constants.You have to create the target folder.
With use of the
DirectoryCopy
user function (from the question referenced above), you can do: