mirror of
https://github.com/PhoenixPE/PhoenixPE.git
synced 2025-09-16 18:18:04 +02:00
PhoenixAPI.script - Refactor InnoExtract command.
This commit is contained in:
@@ -32,8 +32,8 @@
|
|||||||
Title=PhoenixPE API
|
Title=PhoenixPE API
|
||||||
Author=Homes32
|
Author=Homes32
|
||||||
Description=PhoenixPE scripting support library.
|
Description=PhoenixPE scripting support library.
|
||||||
Version=1.11.0.0
|
Version=1.11.1.0
|
||||||
Date=2024-11-01
|
Date=2024-11-02
|
||||||
Level=0
|
Level=0
|
||||||
Selected=None
|
Selected=None
|
||||||
|
|
||||||
@@ -1049,17 +1049,41 @@ If,#2,Equal,"",Halt,"InnoExtract Syntax Error: You must specify the destination
|
|||||||
|
|
||||||
GetParam,1,%SetupFile%
|
GetParam,1,%SetupFile%
|
||||||
Getparam,2,%DestDir%
|
Getparam,2,%DestDir%
|
||||||
Getparam,3,%Arg3%
|
Set,%argc%,#a
|
||||||
Getparam,4,%Arg4%
|
|
||||||
Getparam,5,%Arg5%
|
|
||||||
|
|
||||||
Set,%Password%,""
|
Set,%Password%,""
|
||||||
Set,%CurrentDir%,""
|
Set,%CurrentDir%,""
|
||||||
Set,%ListFile%,""
|
Set,%ListFile%,""
|
||||||
|
|
||||||
Run,%API%,__PhoenixAPI_InnoExtract_Process_Arg,%Arg3%
|
If,%argc%,>,2,Begin
|
||||||
Run,%API%,__PhoenixAPI_InnoExtract_Process_Arg,%Arg4%
|
// Process additional arguments
|
||||||
Run,%API%,__PhoenixAPI_InnoExtract_Process_Arg,%Arg5%
|
Math,Add,%argMax%,%argc%,1
|
||||||
|
ForRange,%i%,3,%argMax%,1,Begin
|
||||||
|
GetParam,%i%,%Arg%
|
||||||
|
|
||||||
|
StrFormat,Split,%Arg%,"=",1,%ArgKey%
|
||||||
|
|
||||||
|
If,%ArgKey%,Equal,"PASSWORD",Begin
|
||||||
|
StrFormat,Split,%Arg%,"=",2,%Password%
|
||||||
|
Set,%Password%," -p#$q%Password%#$q "
|
||||||
|
Continue
|
||||||
|
End
|
||||||
|
|
||||||
|
If,%ArgKey%,Equal,"CDIR",Begin
|
||||||
|
StrFormat,Split,%Arg%,"=",2,%CurrentDir%
|
||||||
|
Set,%CurrentDir%," -c#$q%CurrentDir%#$q "
|
||||||
|
Continue
|
||||||
|
End
|
||||||
|
|
||||||
|
If,%ArgKey%,Equal,"LIST",Begin
|
||||||
|
StrFormat,Split,%Arg%,"=",2,%ListFile%
|
||||||
|
Set,%ListFile%," #$q@%ListFile%#$q"
|
||||||
|
Continue
|
||||||
|
End
|
||||||
|
|
||||||
|
Halt,"InnoExtract SYNTAX ERROR: Invalid Argument [%Arg%] at position [%i%]."
|
||||||
|
End
|
||||||
|
End
|
||||||
|
|
||||||
ShellExecute,Hide,"%Tools%\x86\Innounp.exe","-x -b -y -a -d#$q%DestDir%#$q %Password%%CurrentDir%#$q%SetupFile%#$q%ListFile%"
|
ShellExecute,Hide,"%Tools%\x86\Innounp.exe","-x -b -y -a -d#$q%DestDir%#$q %Password%%CurrentDir%#$q%SetupFile%#$q%ListFile%"
|
||||||
If,Not,%ExitCode%,Equal,0,Begin
|
If,Not,%ExitCode%,Equal,0,Begin
|
||||||
@@ -1117,37 +1141,6 @@ If,Not,%ExitCode%,Equal,0,Halt,"InnoRename Error: Failed to cleanup files. [%Exi
|
|||||||
|
|
||||||
System,EndLocal
|
System,EndLocal
|
||||||
|
|
||||||
[#__PhoenixAPI_InnoExtract_Process_Arg#]
|
|
||||||
// ===============================================================================================================================
|
|
||||||
// Name...........: __PhoenixAPI_InnoExtract_Process_Arg
|
|
||||||
// Description....: Process InnoExtract optional arguments
|
|
||||||
// Syntax.........: __PhoenixAPI_InnoExtract_Process_Arg,<Arg>
|
|
||||||
// Parameters.....: #1 Arg - The argument to process
|
|
||||||
// Return values..:
|
|
||||||
// Author.........: Homes32
|
|
||||||
// Remarks........: Internal Function
|
|
||||||
// Do not call System,SetLocal here. We need this function to run in the same scope as PhoenixAPI_InnoExtract
|
|
||||||
// Related........: _PhoenixAPI_InnoExtract
|
|
||||||
// ===============================================================================================================================
|
|
||||||
[__PhoenixAPI_InnoExtract_Process_Arg]
|
|
||||||
|
|
||||||
StrFormat,Split,#1,"=",1,%ArgKey%
|
|
||||||
If,Not,%ArgKey%,Equal,"",Begin
|
|
||||||
If,%ArgKey%,Equal,"PASSWORD",Begin
|
|
||||||
StrFormat,Split,#1,"=",2,%Password%
|
|
||||||
Set,%Password%," -p#$q%Password%#$q "
|
|
||||||
End
|
|
||||||
Else,If,%ArgKey%,Equal,"CDIR",Begin
|
|
||||||
StrFormat,Split,#1,"=",2,%CurrentDir%
|
|
||||||
Set,%CurrentDir%," -c#$q%CurrentDir%#$q "
|
|
||||||
End
|
|
||||||
Else,If,%ArgKey%,Equal,"LIST",Begin
|
|
||||||
StrFormat,Split,#1,"=",2,%ListFile%
|
|
||||||
Set,%ListFile%," #$q@%ListFile%#$q"
|
|
||||||
End
|
|
||||||
Else,Halt,"InnoExtract SYNTAX ERROR: Invalid Argument [#1]."
|
|
||||||
End
|
|
||||||
|
|
||||||
[#_PhoenixAPI_Innounp#]
|
[#_PhoenixAPI_Innounp#]
|
||||||
// ===============================================================================================================================
|
// ===============================================================================================================================
|
||||||
// Name...........: Innounp
|
// Name...........: Innounp
|
||||||
@@ -1839,8 +1832,8 @@ Set,%NoErr%,False
|
|||||||
|
|
||||||
If,%argc%,>,2,Begin
|
If,%argc%,>,2,Begin
|
||||||
// Process additional arguments
|
// Process additional arguments
|
||||||
Math,Add,%argTo%,%argc%,1
|
Math,Add,%argMax%,%argc%,1
|
||||||
ForRange,%i%,3,%argTo%,1,Begin
|
ForRange,%i%,3,%argMax%,1,Begin
|
||||||
GetParam,%i%,%Arg%
|
GetParam,%i%,%Arg%
|
||||||
|
|
||||||
If,%Arg%,Equal,"NOERR",Begin
|
If,%Arg%,Equal,"NOERR",Begin
|
||||||
|
Reference in New Issue
Block a user