目前我已經使用下面的代碼來刪除我的應用程序的舊版本目錄,下面的代碼通過找到具有應用程序名稱的應用程序工作正常。我想用它找到應用程序UNIQUE APPID,有人可以幫我解決這個問題。如何使用inno setup中的AppId刪除已安裝的應用程序?
procedure DeleteExistingVersion(); begin
MsgBox('Deletion Starts',mbInformation, MB_OK);
if (DirExists (ExpandConstant('{pf}\APPLICATION NAME'))) then
begin
DelTree(ExpandConstant('{pf}\APPLICATION NAME'), True, True, True);
MsgBox('Deletion Ends', mbInformation, MB_OK);
end;
end;
你可以稱之爲'舊版本{uninstallexe}' - 例如[這裏](http://stackoverflow.com/questions/ 2000296/innosetup-how-to-automatically-uninstall-previous-installed-version),甚至更好的[這裏](http://stackoverflow.com/questions/11739317/how-to-detect-old-installation-and- offer-removal) – RobeN
您應該將其卸載。不只是刪除文件夾樹。 – TLama
感謝您的寶貴意見@Raybe,TLama [這](http://stackoverflow.com/questions/2000296/innosetup-how-to-automatically-uninstall-previous-installed-version)幫助我解決這個問題。現在我的應用程序在安裝新版本之前徹底卸載現有版本。 – Santhosh