UniPKG


To build a UniPKG package you will need

And a good bit of patience..

1 // Preparing files


UniPKG depends a lot on file names, for this I will use 'example' as the package name.

In your package's directory, create 3 files
I recommend placing all the files you want to install into a seperate directory called 'data'

If you followed the guide correctly, your package directory should look like this.
*These 3 files need to be at the root directory of the package

2 // Package information (.pkginfo)


UniPKG reads package data (like the package version, name and autor) from .pkginfo files.
Using simple prefixes you can write down data like the example below.

Name=Example package file
PackageVersion=v1
Author=.pawel
UniCMDVer=5.4r
Description=Example package description

The description prefix can only be used as of UniPKG 1.5 (UniCMD 8.2r) and up, it also supports the \n newline prefix

If using UniDKIT you can parse this file using the package information parser
([Toolbar] UniPKG > Package information parser)

3 // Installation script (.inst)


Using .inst files you can tell UniPKG where to move your files
This is where the 'data' folder we created earlier comes into play.

.inst files let you use 3 prefixes
[->] - Move file
[=>] - Move directory (Only version 'Stardust' (6.0) and up)
[CR] - Create directory

UniPKG first unpackages your package into the UniCMD.data\UniPKG\TEMP\ directory
and second executes the .inst file

Example:
UniCMD.data\ExamplePKG.data [CR]
UniCMD.data\UniPKG\TEMP\data\exampledir [=>] UniCMD.data\ExamplePKG.data\exampledir
UniCMD.data\UniPKG\TEMP\data\examplescript.unsc [->] UniCMD.data\ExamplePKG.data\examplescript.unsc
UniCMD.data\UniPKG\TEMP\data\examplemacro.unsc [->] UniCMD.data\Macros\examplemarco.unsc

4 // Removal script (.uninst)


Once the user executes 'unipkg /uinst' with your package name, in this case 'unipkg /uinst example' every file path included in this file will be deleted
This is essentially the same job as the .inst file, except without prefixes

Example:
UniCMD.data\ExamplePKG.data\
UniCMD.data\Macros\examplemarco.unsc

Using UniDKIT you can verify the 3 main package files (.pkginfo, .inst, .uninst) using the package verifier, once you have finished all the above steps
([Toolbar] UniPKG > Package verifier)

5 // Post-install script (.postinst)


As of UniPKG 1.5 (UniCMD 8.2r) you can add a optional .postinst file to your package that executes as an UniScript file when your package finishes installing.
For this guide the post-install script would be named 'example.postinst', and just like the required 3 files would be placed in the root of the package directory.

6 // Creating the package file


To create the package file, select all the files in your package directory and compress/add them to a zip file.
Once the zip file is created change the extension from .zip to .unipkg

If using UniDKIT you can use the packager tool to make your package file
Set your main package directory as the input and save the output via browse button, and make sure its set on packager mode and the output filename is right
([Toolbar] UniPKG > Packager/Depackager)

You can install the file using 'unipkg /dpkg example.unipkg' in a current directory
Incase errors occur, change 'showExceptions' to y in the UniCMD config in order to get exception information

When using UniDKIT you can use the temporary install environment (TempENV) to test your package
([Toolbar] UniPKG > Temporary install environment)

If someone actually followed this guide and your package works (and isnt malicious) I will gladly submit it to the UniPKG repository
Submit your package via Discord here