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

[Fixed] Package Maker - Easy Program Distribution

Started by oeed, 17 March 2013 - 09:06 PM
oeed #1
Posted 17 March 2013 - 10:06 PM
Update 2015: I haven't touched this in over two years, but checkout this which replaces this and adds a bit more.

Update, 3rd April I've updated the Package Maker to support using the root folder and some crashes.

In short, what this does is it gets all the files in a folder and puts the in to one file. When you run that file is will extract all the files back in to their original file/folder structure.

Almost everyone these days is making their own fancy install script that downloads each file one by one. But what are the people that don't have the HTTP API meant to do? Or what about the people who don't know how to make an install script? Package Maker makes HTTP based installers a thing of the past.

My main 'goal' in ComputerCraft is to essentially allow non-coders/tech savvy people to use the computers. Most people either can't be bothered or don't know how to enabled the HTTP API. Nor can they be bothered/have access to copying files in to their save file. So, what is a way the we can get information to the users computer with out them having access to the internet or their save folder? The user. We simply get the user to copy and paste the package code in to their Lua prompt hit enter and Voilà! You have a new OS, etc. on your computer. Now, you can of course use Pastebin to download the package, then simply run the file.

So this makes it possible to:
  • Give users without access to their save file (Multiplayer) or the HTTP API the ability to use your program.
  • Remove the need for the developer to make a special installer.
  • Remove the need for the developer to have to host tons and tons of files.
Usage
PkgMake <path to the source folder> <name of the package>
For making a package of the root folder simply use '/'.

Download
(I recommend you save the file as 'PkgMake', but it's up to you)

pastebin get K8Bc0WB3 PkgMake

If you have any feedback/problems, give me a yell.

Also, I would like feedback on the copy and paste method. I would like to make it fool proof. Was the method above easy/did it workIt It
It has become apparent that copy and pasting will not work, any other ideas on how to do this?
Edited on 30 May 2015 - 07:57 AM
Shnupbups #2
Posted 17 March 2013 - 11:12 PM
YUS.

Imma mehbeh yoose thiss.
oeed #3
Posted 17 March 2013 - 11:15 PM
Sorry, I've just found a huge bug. I've requested this to be taken down, I'll repost when it's fixed.
1lann #4
Posted 18 March 2013 - 12:28 AM
Was the bug that you had an excrutiatingly large amount of \s? If so, I had the same problem when trying to make my own system of packaging :P/>
oeed #5
Posted 18 March 2013 - 10:02 AM
Damn they didn't take it down…
And yes, It was. I had a serialisation issue. I have fixed it now.
Kingdaro #6
Posted 30 March 2013 - 05:17 AM
This is a good idea, minus the fact that larger projects/groups of programs are bound to span at least thousands of characters long.

You should, perhaps, include some sort of compression - either obfuscate the program further (as in, replacing all variables with a,b,c and the likes, like real obfuscation) or compress it into a string, then include an uncompression algorithm in your package string.
oeed #7
Posted 30 March 2013 - 12:22 PM
What is the problem with spanning thousands of characters? If size is anything to go by, PearOS has a bit over 270000 charters in a package.

Now, I've tried copying and pasting and it doesn't really work, unfortunately. However, there's no problem when using a package.

If get around to it I will add compression.
Mackan90096 #8
Posted 31 March 2013 - 09:56 AM
Can I make it exxtract to the root folder?
MudkipTheEpic #9
Posted 31 March 2013 - 10:17 AM
Can I make it exxtract to the root folder?

Extract to "/" I think.
oeed #10
Posted 31 March 2013 - 12:54 PM
Can I make it exxtract to the root folder?
This is one thing I need to fix. If you do that it also includes all the rom files.
gamax92 #11
Posted 31 March 2013 - 07:35 PM
May I recommend trying http://www.computercraft.info/forums2/index.php?/topic/10738-compressor/ for a compressor?

It works pretty well and is easy to make into a function/API
Mackan90096 #12
Posted 01 April 2013 - 07:27 AM
This is one thing I need to fix. If you do that it also includes all the rom files.

Well.. I think I can live with that.
TeaPartyIdiot #13
Posted 31 May 2013 - 06:44 PM
I'm having a problem with compressing the Aperture Operating System (http://www.computerc...upgraded-to-v3/), which contains a number of files and folders. It will begin, but I get a serialization error, and only part of the file will be compressed. It also doesn't seem to close the created file properly, either. Thanks for any help!
nutcase84 #14
Posted 07 June 2013 - 03:18 PM
YES! I will use this for my OS…
ArchAngel075 #15
Posted 08 June 2013 - 01:45 PM
suggestion :
Perhaps a gui based packeger can be made. use a file browser to add directories and paths you wish to package. This can function to help "ignore" certain files?

suggestion2/question :
Is there away to make it ignore certain paths?
if not then request for such an option.

But overall great program and ill be abusing this for save games and game distributing with platformMe!
MCGamer20000 #16
Posted 08 June 2013 - 10:30 PM
I made a new version fixing the glitch where if a file happens to have !@#&amp; in it, it creates a new line. It also makes it so the saved file is on multiple lines and not just one. Also, unneeded white space is removed.
pastebin get rhksm0kC PkgMake
apemanzilla #17
Posted 23 September 2013 - 11:37 AM
Haven't tried this yet, but if I'm correct this takes multiple files and combines them into one abnormally long string? Sweet! I'll have to try this!

Also, I read that you can paste the code into it to use it without http, but the paste function is limited from what I can tell, only pasting the first bit of the string - is there any way I could make the paste function work?
MarioBG #18
Posted 12 February 2015 - 05:27 PM
Hello!
I run into an error when trying to unpack anything. It seems to create the package well, but when unpackaging, this happens.
I have modified the generated code to show where it fails, and it seems to be when writing. Any help would be greatly appreciated. Thanks!
Lyqyd #19
Posted 12 February 2015 - 05:46 PM
The issue may be due to the fact that this program was created back when the serialization function returned a single-line serialized table. Now that it returns a more readable multi-line table, the processing to extract the files may be choking due to being given garbage data.
oeed #20
Posted 12 February 2015 - 08:57 PM
Yea, I haven't really touched this program in almost two years. I have a program a bit like this which I've mainly been using for personal use. Instead of having to unpackage though you can simply run the package as a program, as well as being able to extract it. I might post it at some point.
RoD #21
Posted 29 May 2015 - 08:42 PM
Right now when i run the extractor the files are just blank. http://pastebin.com/kPPfaT89
Bomb Bloke #22
Posted 30 May 2015 - 01:49 AM
As mentioned on the previous page, it hasn't been updated to account for changes in ComputerCraft since it was first posted.
RoD #23
Posted 30 May 2015 - 09:51 AM
Sorry i was in haste when i posted the problem i didn't even researched before. My bad.
oeed #24
Posted 30 May 2015 - 09:56 AM
Yeah I haven't really touched this in about two years.

I made something that replaces this though, Compilr, it's not publically released as it was really just to help me get stuff from my emulator to servers.

You can check it out here: http://pastebin.com/dJd0B0V8

If I recall correctly, simply run it as: compilr your/path/here
It will save it to /build

This actually makes all the files one executable (and extractable with the argument –extrac) program as well.
Edited on 30 May 2015 - 07:58 AM
RoD #25
Posted 30 May 2015 - 11:20 AM
Thank you that would be useful as i needed your package maker to also send programs from emulator-server. :)/>