Code: Alles auswählen
Structure FILE_IN_CABINET_INFO
NameInCabinet.l
FileSize.l
Win32Error.l
DosDate.w
DosTime.w
DosAttribs.w
FullTargetName.s{260}
EndStructure
Procedure PSP_FileCallback(Context.l, Notification.l, Param1.l, Param2.l)
Protected *CAB_INFO.FILE_IN_CABINET_INFO
Protected Path.s
If Notification = $11
*CAB_INFO = Param1
Path = PeekS(Context)
Path + PeekS(*CAB_INFO\NameInCabinet)
MakeSureDirectoryPathExists_(GetPathPart(Path))
*CAB_INFO\FullTargetName = Path
ProcedureReturn 1
EndIf
ProcedureReturn 0
EndProcedure
Procedure CAB_Extract(ArchivName.s, ExtractPath.s)
If Right(ExtractPath, 1) <> "\" : ExtractPath + "\" : EndIf
ProcedureReturn SetupIterateCabinet_(@ArchivName, 0, @PSP_FileCallback(), @ExtractPath)
EndProcedure
ArchivName.s = "MyCab.cab" ; Achtung: absoluten Pfad angeben
ExtractPath.s = "C:\windows\temp"
If CAB_Extract(ArchivName, ExtractPath)
Debug "Alles okay my Friend"
Else
Debug "ERROR, das ist nicht gut"
EndIf