Skip to content

File format and structure

VB PROGER edited this page Jun 12, 2023 · 6 revisions

File format

ProgramPack files are usually compressed .ZIP files. They can have (or not) shebang. If they have shebang, that means that on Linux/Unix systems they will execute as a file. This does not work on Windows.

File structure

In the following example, we can see file structure of unpacked ProgramPack file:

.
├── App
├── manifest.json
└── Resources
    └── example.txt

App file / Mainfile

Mainfile is the main program.

Manifest file

manifest.json is a file that describes our program. Here is an example of manifest file:

{
    "name": "example",
    "description": "Simple program (that does nothing)",
    "author": "Your Name",
    "version": "1.0.0",
    "mainfile": "App"
}

Here is table with definitions of these values:

Value Description
name Program name.
description Program description.
author Author(s) that created the program.
version Program version.
mainfile Main file that will be executed when using the programpack run <file-name> command.
resources_folder Name of folder with resources.
image Image encoded as Base64 data URI.

Resources

Resources is a folder that contains all the files that program needs. For example, we can load pictures, sounds or data from there. You can change the folder in manifest.json. See the table above.

Packing file

To make file executable, use the following command: python3 -m programpack convert <file-name>
To make your file virtual, use this flag: --virtual.

Unpacking file

To make file non-executable, use the following command: python3 -m programpack deconvert <file-name>
To unpack, just rename it and unzip it.

Clone this wiki locally