2017-03-09 1 views
1

사용자가 응용 프로그램 제거를 확인하면 특정 폴더의 백업 복사본을 사용자 바탕 화면에 어떻게 저장합니까?사용자가 제거를 확인하면 폴더를 저장하는 방법은 무엇입니까? (이노 설치)

내가 ... 아마 코드를 사용하지 않고 그것을 할 수있는 쉬운 방법이 ... 성공하지

을이 시도
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); 
begin 
    if CurUninstallStep = usUninstall then 
    begin 
    FileCopy('{app}\Profile\*', '{userdesktop}\Backup\Profile\', False); 
    end; 
end; 

너희들 감사합니다! :)

답변

1

CurUninstallStepChanged(usUninstall)에서 백업을 트리거하는 것이 가장 좋은 방법입니다. 당신이

문제는 다음과 같습니다 FileCopy function 폴더를 복사 할 수 없습니다

(위에서 언급 한 문제에서)을 수행 할 수 있습니다 : 근무

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); 
var 
    SourcePath: string; 
    DestPath: string; 
begin 
    if CurUninstallStep = usUninstall then 
    begin 
    SourcePath := ExpandConstant('{app}\Profile'); 
    DestPath := ExpandConstant('{userdesktop}\Backup\Profile'); 
    Log(Format('Backing up %s to %s before uninstallation', [SourcePath, DestPath])); 
    if not ForceDirectories(DestPath) then 
    begin 
     Log(Format('Failed to create %s', [DestPath])); 
    end 
     else 
    begin 
     DirectoryCopy(SourcePath, DestPath); 
    end; 
    end; 
end; 
+0

을 완벽하게 .. 감사합니다. –

관련 문제