Inno如何在安裝完成時刪除指定的文件夾(下的所有文件及子目錄)??


刪除安裝目錄下的任意文件夾及下的所有文件及子目錄,
或者刪除指定目錄的文件夾,要如何做到呢?
謝謝!!

 

 

//刪除文件    用 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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM