UseZipPacker()

Define Path$ = "C:\ProgramData\PureBasic\Examples\Sources\"
If CreatePack(0, "C:\ProgramData\PureBasic\Examples\MyCompressedFiles.zip")
	AddPackFile(0, Path$ + "Data\world.png", "Data\world.png")
	AddPackFile(0, Path$ + "Data\test.pref", "Data\test.pref")
	AddPackFile(0, Path$ + "Data\CdPlayer.ico", "Data\CdPlayer.ico")
	AddPackFile(0, Path$ + "2DDrawing.pb", "2DDrawing.pb")
	ClosePack(0)
EndIf

Path$ = "C:\ProgramData\PureBasic\Examples\test_delete\"
If OpenPack(0, "C:\ProgramData\PureBasic\Examples\MyCompressedFiles.zip")
	Debug "opened"
	If (CreateDirectory(Path$) And CreateDirectory(Path$ + "Data\")) Or FileSize(Path$ + "Data\") = -2
		Debug "created a folder"
		If ExaminePack(0)
			While NextPackEntry(0)
				Debug "Name: " + PackEntryName(0) + ", Size: " + PackEntrySize(0)
				If UncompressPackFile(0, Path$ + PackEntryName(0), PackEntryName(0)) = -1
					Debug "unsuccessful unpacking of file: " + PackEntryName(0)
				EndIf
			Wend
		EndIf
		ClosePack(0)
		RunProgram(Path$)
	EndIf
EndIf