Set DSQbit `RequestChoice "DiskSqueeze Message" "WARNING!*nCould not find 'DSQ' file in your ENV: or ENVARC: dir...*nUsing default T: directory (= RAM) for temporary storage" "Choose Other Path" "Continue (T: is fine)"`
RequestChoice >NIL: "DiskSqueeze Error Message" "WARNING!*nYour default temporary-storage*npath is non-existant ..." "Choose Other Path"
Skip PathSelect BACK
Endif
LAB MEMCHK
Set DSQbit `Avail flush total`
If NOT $DSQbit VAL GT 2000000
If "$DSQ" EQ "T:"
RequestChoice >NIL: "DiskSqueeze Message" "WARNING!*nMemory too low to use T: (RAM) as temporary storage directory!*nRead docs carefully to use DiskSqueeze anyway..." "Choose Other Path"
Skip PathSelect BACK
else
If "$DSQ" EQ "RAM:"
RequestChoice >NIL: "DiskSqueeze Message" "WARNING!*nMemory too low to use RAM: as temporary storage directory!*nRead docs carefully to use DiskSqueeze anyway..." "Choose Other Path"
RequestChoice >NIL: "DiskSqueeze Memory Error (only $DSQbit2 bytes allocated)" "Sorry, not enough RAM available to use device 'RAD:'!*nTry using a disk based temporary storage to free RAM." "Back"
RequestChoice >NIL: "DiskSqueeze Memory Error (only $DSQbit2 bytes allocated)" "Sorry, not enough RAM available to use device 'RAD2:'!*nTry using a disk based temporary storage to free RAM." "Back"
If $DSQact EQ "1"
Skip Pack BACK
EndIf
If $DSQact EQ "2"
Skip UnPack3
EndIf
EndIf
EndIf
LAB RAD2ok
Set DSQdrv RAD2:
Skip DEX
EndIf
If $DSQbit EQ "7"
If NOT EXISTS ENV:DSQusr
RequestChoice >NIL: "DiskSqueeze Error Message" "Sorry, you have not defined a custom device (see docs)" "Choose Other Device"
If $DSQact EQ "1"
Skip Pack BACK
EndIf
If $DSQact EQ "2"
Skip UnPack3
EndIf
EndIf
Set DSQdrv $DSQusr
Skip DEX
EndIf
Set DSQbit2 `Eval $DSQbit - 1`
Set DSQdrv DF$DSQbit2:
LAB DEX
Assign >NIL: $DSQdrv EXISTS
If WARN
RequestChoice >NIL: "DiskSqueeze Error Message" "Sorry, your Amiga cannot allocate the specified device...!" "Choose Other Device"
If $DSQact EQ "1"
Skip Pack BACK
EndIf
If $DSQact EQ "2"
Skip UnPack3
EndIf
EndIf
If $DSQact EQ "2"
Skip UnPack4
EndIf
LAB MIX
$DiskType $DSQdrv
Set DSQflip $rc
If $DSQflip EQ 10
Echo "No Disk!"
Set DSQflip `RequestChoice "DiskSqueeze - Urgent Question :-)" "Please Insert a Disk in Device $DSQdrv NOW!" "Ok" "Re-select"`
If $DSQflip EQ 0
Skip Pack BACK
EndIf
Skip MIX BACK
EndIf
If $DSQflip EQ 5
; Requestchoice >NIL: "dsq" "NDOS!" "OK"
Set DSQbit 1
Skip SWEETY
EndIf
Set DSQbit `RequestChoice "DiskSqueeze - Packing Question" "Is the disk using a mixed filesystem ?" "Yes" "No" "Help" "Back"`
LAB SWEETY
If $DSQbit EQ "0"
If $DSQact EQ "5"
Skip Convert
else
Skip Pack BACK
EndIf
EndIf
If $DSQbit EQ "1"
Set DSQpdf ALL
EndIf
If $DSQbit EQ "2"
Set DSQpdf "NV"
EndIf
If $DSQbit EQ "3"
RequestChoice >NIL: "DiskSqueeze Info" "A mixed filesystem means that the disk (which*nis about to be packed) is using a combination*nof normal AmigaDOS (directories & files)+AND+*ntrackdisk instructions (fastloader or special*nbootblock which contain specific instructions*nto load a menu, intro or data). Simply check*nthe contents of the disk, and if there's only*nfew bytes used, although the program is quite*nbig, it's almost certainly such a rare 'mixed*nfilesystem' disk. Read docs for further info." "Back"
Echo "» Remember to press CTRL-C to abort current actions! «"
Echo ""
Echo "Reading and storing disk image from the $DSQdrv drive ... Please wait!"
$PackDev $DSQdrv Image.dsq NC F TN $DSQpdf >RAM:ErrLog
If ERROR
Type RAM:ErrLog
RequestChoice >NIL: "DiskSqueeze Error (see output)" "Sorry, a disk read-error has occured...*nIs the disk readable and/or present in the drive ?" "Abort"
If $DSQact EQ "5"
Skip Convert
else
Skip Pack BACK
EndIf
EndIf
If NOT EXISTS Image.dsq
Set DSQbit `RequestChoice "DiskSqueeze Error Message (CTRL-C pushed?)" "Couldn't load the image from the disk ! *n*nIs there really a disk in device $DSQdrv ?*n*n AND/OR*n*n Is the disk readable on your system ?" "Retry" "Abort"`
If $DSQbit EQ "1"
Skip Beavis BACK
else
Skip Pack BACK
EndIf
EndIf
If NOT $DSQbit2 EQ Y
Set DSQbit `RequestChoice "DiskSqueeze Question" "Do you want add a filelist to the archive?" "Yes" "No"`
If $DSQbit EQ "0"
Echo "No filelist added to archive..."
Skip txtfile
else
$DiskType $DSQdrv >NIL:
If NOT WARN
Echo "Adding filelist to archive... Hold on !"
Set DSQbit `$DiskType $DSQdrv `
$DirII >Files.dsq all sizes width=64 "$DSQbit:"
Echo "Done..."
else
Echo "No standard DOS disk : no filelist added to archive..."
EndIf
EndIf
EndIf
If EXISTS Files.dsq
Set DSQbit `$DirII Files.dsq LFORMAT %l`
If $DSQbit VAL EQ 0
Delete >NIL: Files.dsq FORCE
Echo "(Empty) filelist removed from archive..."
If NOT $DSQpdf EQ "ALL"
Set DSQbit `RequestChoice "DiskSqueeze IMPORTANT Reminder Message" " ! ! ! ! ! W A R N I N G ! ! ! ! !*n*nSince this disk is probably using a mixed filesystem,*nyou should've selected the 'Mixed FileSystem' option,*n This option is currently NOT enabled !!*nThe archive WILL be faulty if option isn't selected !*n*nShall I re-read the disk as a mixed filesystem-disk ?" "YES, please do!" "NO, ignore this"`
If $DSQbit EQ "1"
Set DSQpdf "ALL"
Set DSQbit2 Y
Skip Beavis BACK
EndIf
EndIf
EndIf
EndIf
LAB txtfile
Set DSQbit `RequestChoice "DiskSqueeze Question" "Do you want add a File_ID.DIZ to the archive?" "Yes" "No"`
If $DSQbit EQ "0"
Echo "No File_ID.DIZ added to archive..."
Skip ReqDSQfile
else
Set DSQbit2 ":"
Set DSQbit2 `RequestFile DRAWER "$DSQload" NEGATIVE Abort TITLE "Select File_ID.DIZ"`
If "$DSQbit2" EQ ":"
Set DSQbit `RequestChoice "DiskSqueeze Confirm" "Are you sure to abort packing ?" "YES, main menu" "NO, continue !"`
If $DSQbit EQ "1"
Skip Init BACK
else
Skip txtfile BACK
EndIf
EndIf
Type $DSQbit2 >File_ID.DIZ
EndIf
Echo "File_ID.DIZ added to archive..."
LAB ReqDSQfile
Set DSQdst ":"
Set DSQdst `RequestFile DRAWER "$DSQsave" FILE ".dsq" PATTERN "~(#?.info)#?.dsq" NEGATIVE Abort TITLE "Select Destination File"`
If "$DSQdst" EQ ":"
Set DSQbit `RequestChoice "DiskSqueeze Confirm" "Are you sure to abort packing ?" "YES, main menu" "NO, continue !"`
If $DSQbit EQ "1"
Skip Init BACK
else
Skip ReqDSQfile BACK
EndIf
EndIf
If EXISTS $DSQdst
RequestChoice >NIL: "DiskSqueeze Error Message" "Sorry, that name already exists, try another one!" "Ok, sorry for that!"
Skip ReqDSQfile BACK
EndIf
Set DSQsave `$PathName "$DSQdst"`
Set DSQbit `Avail total flush`
If $DSQbit VAL GE 3000000
If NOT $LZXr EQ 0
$LZX -m -3 -bo930 -X0 -U0 -Qf af "$DSQdst" (Image.dsq|Files.dsq|File_ID.DIZ)
else
$LZX -m -3 -bo930 -X0 -U0 a "$DSQdst" (Image.dsq|Files.dsq|File_ID.DIZ)
EndIf
else
If NOT $DSQbit VAL GE 1000000
If NOT $LZXr EQ 0
$LZX -m -3 -bo32 -X0 -U0 -Qf af "$DSQdst" (Image.dsq|Files.dsq|File_ID.DIZ)
else
$LZX -m -3 -X0 -U0 a "$DSQdst" (Image.dsq|Files.dsq|File_ID.DIZ)
EndIf
else
If NOT $LZXr EQ 0
$LZX -m -3 -bo256 -X0 -U0 -Qf af "$DSQdst" (Image.dsq|Files.dsq|File_ID.DIZ)
else
$LZX -m -3 -bo256 -X0 -U0 a "$DSQdst" (Image.dsq|Files.dsq|File_ID.DIZ)
EndIf
EndIf
EndIf
If WARN
RequestChoice >NIL: "DiskSqueeze Error Message" "Problems packing disk image...*nIs your LZX keyfile valid?" "Main Menu"
Skip Init BACK
EndIf
If $DSQact EQ "5"
Skip ConvertEnd
EndIf
Set DSQbit `$DirII "$DSQdst" LFORMAT %l`
If NOT $DSQbit VAL GT 10
RequestChoice >NIL: "DiskSqueeze Error Message (did you push 'CTRL-C' ?)" "Something went definitely wrong while packing or saving !*nSuggest you check the output window + involved devices...*n Also make sure you have enough free RAM (read docs)" "Main Menu"
else
RequestChoice >NIL: "DiskSqueeze Result" "The disk was squeezed into $DSQbit bytes!" "Ok"
EndIf
Echo ""
Skip Init BACK
LAB UnPack
Set DSQdst ":"
Set DSQdst `RequestFile DRAWER "$DSQload" FILE " " PATTERN "~(#?.info)#?(.dsq|.DMS)" NEGATIVE "Main Menu" TITLE "Select DSQ/DMS archive"`
If "$DSQdst" EQ ":"
Skip Init BACK
EndIf
If NOT EXISTS "$DSQdst"
RequestChoice >NIL: "DiskSqueeze Error Message" "Sorry, couldn't find that file...*nMake sure you enter the right name!" "Choose Other"
Set DSQbit `RequestChoice "DiskSqueeze Error (see output)" " Couldn't write the image to disk !*n*nMake sure there is a disk in drive $DSQdrv" "Retry" "Abort"`
If $DSQbit EQ "1"
If $DSQpdf EQ ".dsq"
Skip UnPack4 BACK
else
Skip DMSwrite BACK
EndIf
else
RequestChoice >NIL: "DiskSqueeze Error Message" " Some obscure error occured...*n*nSuggest you test your media & the archive" "Abort"
Skip Init BACK
EndIf
EndIf
else
RequestChoice >NIL: "DiskSqueeze Error Message" " Some obscure error occured...*n*nSuggest you test your ram hardware & ramdrive.device" "Abort"
Skip Init BACK
EndIf
else
RequestChoice >NIL: "DiskSqueeze Error Message" " Some obscure error occured...*n*nSuggest you test your ram hardware & ramdrive.device" "Abort"
Skip Init BACK
EndIf
EndIf
LAB Finished
Echo "Unpacking process finished..."
Skip Init BACK
LAB View
Set DSQdst ":"
Set DSQdst `RequestFile DRAWER "$DSQload" FILE ".dsq" PATTERN "~(#?.info)#?.dsq" NEGATIVE "Main Menu" TITLE "VIEW: Select DSQ Archive"`
If "$DSQdst" EQ ":"
Skip Init BACK
EndIf
If NOT EXISTS "$DSQdst"
RequestChoice >NIL: "DiskSqueeze Error Message" "Sorry, couldn't find that file...*nMake sure you enter the right name!" "Choose Other"
Skip View BACK
EndIf
Set DSQload `$PathName "$DSQdst"`
If NOT "`$GetChars "$DSQdst" 46 4`" EQ ".dsq"
If NOT "`$GetChars "$DSQdst" 46 4`" EQ "ID.D"
RequestChoice >NIL: "DiskSqueeze Error Message" "Sorry, that's not a DiskSqueeze archive!" "Choose Other"
Skip View BACK
EndIf
EndIf
$LZX -q -X0 -m x "$DSQdst" (Files.dsq|File_ID.DIZ) $DSQ
If NOT EXISTS Files.dsq
If EXISTS File_ID.DIZ
Echo ""
Type File_ID.DIZ
EndIf
RequestChoice >NIL: "DiskSqueeze FileList Information" "No filelist was found in the archive." "Choose Other"
Skip View BACK
else
If NOT EXISTS ENV:More
Set More `Which More`
If WARN
RequestChoice >NIL: "DiskSqueeze Error Message" "Sorry, unable to locate the 'More' textviewer !" "Main Menu"
Skip Init BACK
EndIf
else
$More Files.dsq
EndIf
EndIf
If EXISTS File_ID.DIZ
Echo ""
Type File_ID.DIZ
Delete File_ID.DIZ
EndIf
Delete #?.dsq >NIL:
Skip View BACK
LAB Test
Set DSQdst ":"
Set DSQdst `RequestFile DRAWER "$DSQload" FILE ".dsq" PATTERN "~(#?.info)#?.dsq" NEGATIVE "Main Menu" TITLE "TEST: Select DSQ Archive"`
If "$DSQdst" EQ ":"
Skip Init BACK
EndIf
Set DSQload `$PathName "$DSQdst"`
If NOT EXISTS "$DSQdst"
RequestChoice >NIL: "DiskSqueeze Error Message" "Sorry, couldn't find that file...*nMake sure you enter the right name!" "Choose Other"
Skip Test BACK
EndIf
If "`GetChars "$DSQdst" 46 4`" EQ "ID.D"
Skip Begin
else
If "`GetChars "$DSQdst" 46 4`" EQ ".dsq"
Skip Begin
EndIf
EndIf
RequestChoice >NIL: "DiskSqueeze Error Message" "Sorry, that's not a DiskSqueeze archive!" "Choose Other"
Echo "» Remember to press CTRL-C to abort current actions! «"
Echo ""
Echo "Pass 1 ... " NOLINE
$LZX -F -X0 t "$DSQdst" >RAM:ErrLog
If ERROR
Echo "FAILED"
Type RAM:ErrLog
RequestChoice >NIL: "DiskSqueeze Error Message" "LZX encountered difficulties while testing compressed disk-image...!*n Check DiskSqueeze output window for error-description(s)*n*n If you simply pressed CTRL-C, forget about this error report" "Oops!"
Skip Test BACK
else
Echo "completed - archive LZX integrity OK"
EndIf
Echo ""
Echo "Pass 2 ... " NOLINE
If $DSQmav VAL GT 4000000
$LZX -q -m -X0 -bo930 x "$DSQdst" $DSQ Image.dsq
else
$LZX -q -m -X0 x "$DSQdst" $DSQ Image.dsq
EndIf
$PackDev TESTFILE Image.dsq NC TN >RAM:ErrLog
If ERROR
Echo "FAILED"
Type RAM:ErrLog
RequestChoice >NIL: "DiskSqueeze Error Message" "PackDev encountered difficulties while testing uncompressed disk-image...!*n Check DiskSqueeze output window for error-description(s)*n*n If you simply pressed CTRL-C, forget about this error report" "Oops!"
else
Echo "completed - disk-image integrity OK"
Echo ""
Echo ""
Echo Archive $DSQdst was tested successfully.
EndIf
Skip Test BACK
LAB Convert
Set DSQbit ":"
Set DSQbit `RequestFile DRAWER "$DSQload" PATTERN "~(#?.info)#?(.DMS)" FILE " " NEGATIVE "Main Menu" TITLE "CONVERT: Select DMS Archive"`
If "$DSQbit" EQ ":"
Skip Init BACK
EndIf
Set DSQload `$PathName "$DSQbit"`
If NOT EXISTS "$DSQbit"
RequestChoice >NIL: "DiskSqueeze Error Message" "Sorry, couldn't find that file...*nMake sure you enter the right name!" "Choose Other"
Skip Convert BACK
EndIf
If NOT "`Getchars "$DSQbit"`" EQ "DMS"
RequestChoice >NIL: "DiskSqueeze Error Message" "Sorry, archive-type not supported" "Ok"