View Single Post
Old 15 May 2017, 11:21   #82
Registered User

Join Date: Feb 2016
Location: Denmark
Posts: 230
To improve making packages on Windows for HstWB Installer, I have found a way of converting a zip file to Amiga. This makes it appears as if it was created on an Amiga and can successfully be extracted with system files. Previously I had to create zip files with SYS: or Workbench system files on an Amiga for it to work properly when extracting it again on an Amiga. This was a bit cumbersome having to start en emulator each time to make a zip.

I have done this using two scripts:
1. create_zip_from_directory.ps1 -inputDir [inputDir] -outputZipFile [outputZipFile]
2. convert_zip_to_amiga.ps1 -zipFile [zipFile] -outputZipFile [outputZipFile]

First script creates a zip file from a directory in a proper format that can be extracted correctly on Amiga. Basically, it ensures that each directory is added to the zip file. Powershell zip compression or 7za command line tools only includes empty directories. The script was needed, so I can create zip files from command line, but 7-Zip file manager, WinRAR and Windows build-in zip compression does also create zip files in proper format.

The second script converts a zip file to Amiga for it to extract properly with added protection bits. It reads the zip file, patches zip entries and writes a new zip file. The zip entries ‘VersionMadeBy’ is changed to 279 (Amiga) and ‘ExternalFileAttributes’ is set to 135200784 for directories and 68091904 for files. This means protections bits will be set to '----RWED', when extracted on Amiga. Surely these numbers represent flags in an enum, but I haven’t found more details about what they actually mean. I only found the external file attributes by examining zip files created on Amiga and would be nice if someone has more details about protection bit flags to make more clear code in the scripts.

Anyway, if someone finds this useful, they can be downloaded here

Back to documentation the last bits and pieces for HstWB Installer and HstWB Package...
cyberhead97 is offline  
Page generated in 0.04077 seconds with 11 queries