刪除安裝目錄下的任意文件夾及下的所有文件及子目錄,
或者刪除指定目錄的文件夾,要如何做到呢?
謝謝!!
//刪除文件 用 DeleteFile 只能刪除一個文件,不能使用通配符來刪除多個文件
DeleteFile(ExpandConstant('{app}\abc.exe'));
//刪除所有文件及文件夾
DelTree(ExpandConstant('{app}'), True, True, False);
//或者
[code]
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usUninstall then
if MsgBox('您是否要刪除用戶配置信息?', mbConfirmation, MB_YESNO) = IDYES then
//刪除 {app} 文件夾及其中所有文件
DelTree(ExpandConstant('{app}'), True, True, True);
end;
[InstallDelete]
Name: {app}; Type: filesandordirs
[UninstallDelete]
Name: {app}; Type: filesandordirs