FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   Problem with Wpi script (https://fileforums.com/showthread.php?t=99148)

Sebazz 24-04-2017 09:28

Problem with Wpi script
 
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

You may try this
 
Quote:

Originally Posted by Sebazz (Post 458375)
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.
Quote:

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

Quote:

Originally Posted by ffmla (Post 458427)
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

Quote:

Originally Posted by pakrat2k2 (Post 458433)
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

Code:

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

Quote:

Originally Posted by Sebazz (Post 458445)
This code not worked :(

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

Script Upload

Sebazz 27-04-2017 06:43

1 Attachment(s)
Quote:

Originally Posted by Simorq (Post 458448)
Script Upload

Ok.

Simorq 27-04-2017 10:26

Quote:

Originally Posted by Sebazz (Post 458449)
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.

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;


-XCX- 28-04-2017 11:48

~~~~~~~~~~~~~~~
 
1 Attachment(s)
Solved

Sebazz 28-04-2017 12:39

Quote:

Originally Posted by -XCX- (Post 458494)
Solved

Oh Man Thanks, Now Works.


All times are GMT -7. The time now is 07:33.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com