This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
mitterdoo's profile picture

CraftPackager - Packs several files into an installer

Started by mitterdoo, 15 July 2013 - 03:49 AM
mitterdoo #1
Posted 15 July 2013 - 05:49 AM
CraftPackager


CraftPackager is a program created by me that can package a single directory (even the root directory) into an installer file. This is very useful for OS developers who want to create an installer file for their systems.


Download:

pastebin get uTApBb6h pack


Interested in how it works?

The program looks for all files and folders in the current directory it is run in. It records what each file has inside of them and what folder has what files and folders inside of them, and so on, into a table. Then the program creates a file with the table and that program unpacks the table into files and folders. Very simple, but a bit hard to program.


How to use it

All you have to do is run the program. Whatever directory you run it from it will package. Example: you are in the root directory and the program is in a directory called "hello," so you do "hello/pack." It will package everything in the root directory.

The installer dumps all files in the same way, in the directory you run it from.


I don't know what else to add. Just give credits if you use this as an installer for your load of programs and folders.
Zudo #2
Posted 15 July 2013 - 09:37 AM
HOW IS IT POSSIBLE TO DO THAT IN 65 LINES??????????????????????????????????????????
electrodude512 #3
Posted 15 July 2013 - 09:54 AM
HOW IS IT POSSIBLE TO DO THAT IN 65 LINES??????????????????????????????????????????

Recursively pack the files into a big table, then make a script that recursively unpacks the table into the filesystem.

@mitterdoo: That's very nice. About features to add, how about the ability to package multiple folders? i.e. /programs/myapp/* and /config/myapp/* and /docs/myapp/<x,y,and z>

You would run my new version like so: pack output input1 input2 …
Edited on 15 July 2013 - 07:59 AM
Leo Verto #4
Posted 15 July 2013 - 06:45 PM
That's cool, a creator for self-unpacking archives, good job!
jesusthekiller #5
Posted 19 July 2013 - 06:33 AM
"}" w/o "{" inside file will break it…


Managed to squeeze mine in 30 lines but it is a little buggy
coaster3000 #6
Posted 23 July 2013 - 09:59 PM
Wow… That is impressive work right there.
Small file size. Recursion for the win :D/>