Add
[Files]
; Backup Function_Template
Source: "{app}XXX.txt"; DestDir: "{app}"; DestName: "XXX.txt.bkup"; Flags: external skipifsourcedoesntexist uninsneveruninstall
That would move the existing file, and the flags will prevent from uninstalling it. Now in the code you can put
[Code]
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
OldFile: string;
begin
case CurUninstallStep of
usPostUninstall:
begin
OldFile := ExpandConstant('{app}XXX.txt.bkup');
if FileExists(OldFile) then
RenameFile(OldFile, ExpandConstant('{app}XXX.txt'));
end;
end;
end;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…