View Single Post
  #11  
Old 27-04-2017, 17:59
Sebazz Sebazz is offline
Registered User
 
Join Date: Mar 2016
Location: Terra
Posts: 60
Thanks: 24
Thanked 7 Times in 6 Posts
Sebazz is on a distinguished road
- No, any code dont work for delete folder with all extracted files from Program Files when i cancel during instalation.
I tried this and any worked.

Code:
Exec(ExpandConstant('{uninstallexe}'),'/verysilent','',SW_HIDE, ewWaitUntilTerminated, ResultCode);

or/and

DelTree(ExpandConstant('{app}'), True, True, True);
- Searching in the web i found this code, but i dont know how implement this in the CancelButtonClick Code or if can work

Code:
function deleteDir(): Boolean;
var
ResultCode: Integer;
begin
//allow to delete completely installation folder
Exec('cmd', ExpandConstant('/c RMDIR /S /Q "{app}"'), '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
Result := True;
end;

Last edited by Sebazz; 27-04-2017 at 18:11.
Reply With Quote