Log in

View Full Version : Problem with Wpi script


Sebazz
24-04-2017, 09:28
i have a problem. Actually i use wpi installer by razor, but in the instalation during extraction files, when i click to cancel the program closes but not delete the extracted files (only when appear some error). Also, when i use pzlib v3, the setup not closes the program, it keep running in task manager and the instalation not be canceled. How to fix this ?. I need to add some code to my scrip ? Thanks

ffmla
26-04-2017, 08:20
i have a problem. Actually i use wpi installer by razor, but in the instalation during extraction files, when i click to cancel the program closes but not delete the extracted files (only when appear some error). Also, when i use pzlib v3, the setup not closes the program, it keep running in task manager and the instalation not be canceled. How to fix this ?. I need to add some code to my scrip ? Thanks
Hi,
I didn't use WPI.
But You may try this code.! It may be helpfull.

Under cancelbutton click section You need to add this.
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
var
ResultCode: Integer;
begin
SuspendProc;
Confirm:=False;
if ShowCancelBox = mrYes then
Cancel:=True
else
Cancel:=False;
if Cancel then
InstallLabel4.Caption:='Rolling back changes...';
if CurPageID=wpInstalling then
begin
if Cancel then
begin
ISDoneError:=True;
ISDoneCancel:=1;
WizardForm.CancelButton.Enabled:=False;
ButtonSetEnabled(NextBtn,False);
Exec(ExpandConstant('{sys}\taskkill.exe'), ' /F /IM pZLib.exe', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
DelTree(ExpandConstant('{app}'), True, True, True);
end;
end;
ResumeProc;
end;

Sebazz
26-04-2017, 15:48
Hi,
I didn't use WPI.
But You may try this code.! It may be helpfull.

Under cancelbutton click section You need to add this.

Thanks for your reply. Appear this error and the other option not work :(. Help

https://k61.kn3.net/D94214B3B.jpg

pakrat2k2
26-04-2017, 18:36
try reading the script portion ffmla posted? answer is right there lines 2 & 3
you need those 2 lines before your line 2 section.

Sebazz
26-04-2017, 19:49
try reading the script portion ffmla posted? answer is right there lines 2 & 3
you need those 2 lines before your line 2 section.

Yes, i add this lines.

var
ResultCode: Integer;

pzlib problem worked but the script dont deleted the extracted files after cancel :(

Simorq
27-04-2017, 00:59
Exec(ExpandConstant('{sys}\taskkill.exe'), ' /F /IM pZLib.exe', '', SW_HIDE, ewNoWait, ISDoneCancel);

Sebazz
27-04-2017, 06:04
This code not worked :(

DelTree(ExpandConstant('{app}'), True, True, True);

Simorq
27-04-2017, 06:40
This code not worked :(

DelTree(ExpandConstant('{app}'), True, True, True);

Script Upload

Sebazz
27-04-2017, 06:43
Script Upload

Ok.

Simorq
27-04-2017, 10:26
Ok.

Full Script Upload

Sebazz
27-04-2017, 17:59
- 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.


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


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;

-XCX-
28-04-2017, 11:48
Solved

Sebazz
28-04-2017, 12:39
Solved

Oh Man Thanks, Now Works.