CabX plug-in

From NSIS Wiki
Jump to navigationJump to search
Author: Anders (talk, contrib)



Plug-in information

  • Version: 1.0
  • Type: Runtime plug-in (Unicode)
  • Minimum OS: WinNT4 (IE4+), Win2000+
  • Minimum NSIS version: 2.45
  • License: Freeware
  • Download: CabX.zip (8 KB)

Examples

.CAB file extraction

CabX::FromFile "" "$ExeDir\Data.cab" "$InstDir"

Internal extraction

CabX::FromSelf "" "$InstDir"
!finalize 'cmd /C copy /B "%1"+"c:\myinstaller\Data.cab"' ; Append .CAB file


Callback

!include LogicLib.nsh
 
Function CabCallback
${If} $0 == "FILE"
	DetailPrint "$1 ($3 bytes)" ; Source file (might begin with a relative path)
	DetailPrint "->$2" ; Destination (change this if desired)
	;StrCpy $0 "" ; Abort entire operation
	;StrCpy $2 "" ; Skip this file
${ElseIf} $0 == "ERROR"
	DetailPrint "$0 $1 ($2)" ; Error in $1, path in $2
${ElseIf} $0 == "CAB" ; Split .CAB file not found
	DetailPrint 'Needs CAB "$2" in $1'
	;StrCpy $0 "" ; Abort entire operation (If not aborted, plug-in will ask the user)
${EndIf}
FunctionEnd
 
Section
GetFunctionAddress $0 CabCallback
CabX::FromFile $0 "$ExeDir\Data.cab" "$InstDir"
SectionEnd


History

1.0 - 20190704 - Anders

  • Initial release