Jump to content




Packager - Compress a folder into a single executable file

utility

21 replies to this topic

#1 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 18 March 2015 - 09:51 PM

Packager is a really useful program if you want to compress a folder into a single executable file (to publish on pastebin for example).
Usage:
packager <directory> <output file> [display name]

When you run packager it will compress a folder into a file (note that the paths are relative unless it starts with an /).
When you run the file it will ask:
Where do you want to extract <display name>?
If a file/directory with the same name already exists, it will be deleted.
Note: You can not compress files that have bytes higher than 127.

Download:
pastebin get Wy5vb6p0 packager

If you have any suggestions, bug reports or questions then please leave a reply.

Edited by CrazedProgrammer, 02 April 2015 - 12:18 PM.


#2 Lupus590

  • Members
  • 1,965 posts
  • LocationUK

Posted 18 March 2015 - 10:13 PM

Self extracting files, I've been waiting for one of these. Does it actually compress (make the files smaller) too?

Edited by Lupus590, 18 March 2015 - 10:15 PM.


#3 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 19 March 2015 - 07:02 AM

View PostLupus590, on 18 March 2015 - 10:13 PM, said:

Self extracting files, I've been waiting for one of these. Does it actually compress (make the files smaller) too?
Nope, it converts the contents to base64 so you can upload binary files to pastebin.

#4 Lupus590

  • Members
  • 1,965 posts
  • LocationUK

Posted 19 March 2015 - 07:43 AM

Feature request, file size shrinking (bonus for IRL compressed file format, .7z .zip .tar.gz - someone has made tar format)

Edited by Lupus590, 20 March 2015 - 07:56 AM.


#5 Geforce Fan

  • Members
  • 846 posts
  • LocationMissouri, United States, America, Earth, Solar System, Milky Way, Universe 42B, Life Street, Multiverse, 4th Dimension

Posted 19 March 2015 - 11:15 PM

View PostCrazedProgrammer, on 19 March 2015 - 07:02 AM, said:

so you can upload binary files to pastebin.
This allows you to upload binary files? YESSSSSSSSS I've been needing this!!!!!!!!!!!
Right now, when installing game-engine, the testing map is stored as a table and is converted by the installer. So it's a pointless fs call.

#6 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 20 March 2015 - 06:46 AM

View PostGeforce Fan, on 19 March 2015 - 11:15 PM, said:

View PostCrazedProgrammer, on 19 March 2015 - 07:02 AM, said:

so you can upload binary files to pastebin.
This allows you to upload binary files? YESSSSSSSSS I've been needing this!!!!!!!!!!!
Right now, when installing game-engine, the testing map is stored as a table and is converted by the installer. So it's a pointless fs call.

And what about Bomb Bloke's script? It does the same, and even more - compression!

#7 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 20 March 2015 - 07:49 AM

View PostMKlegoman357, on 20 March 2015 - 06:46 AM, said:

View PostGeforce Fan, on 19 March 2015 - 11:15 PM, said:

View PostCrazedProgrammer, on 19 March 2015 - 07:02 AM, said:

so you can upload binary files to pastebin.
This allows you to upload binary files? YESSSSSSSSS I've been needing this!!!!!!!!!!!
Right now, when installing game-engine, the testing map is stored as a table and is converted by the installer. So it's a pointless fs call.

And what about Bomb Bloke's script? It does the same, and even more - compression!
Wow that looks nice! But it doesn't support empty directories.
I will probably add compression in the future.

View PostLupus590, on 19 March 2015 - 07:43 AM, said:

Feature request, file size shrinking (bonus for IRL compressed file format, .7z .zip .tar.gz - someone has made tar format)
I will add compression soon!

#8 Lupus590

  • Members
  • 1,965 posts
  • LocationUK

Posted 20 March 2015 - 07:57 AM

I found that post with the .tar format archiver, I've added it to my previous post too.
http://www.computerc...ar-files-in-cc/

#9 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 20 March 2015 - 08:05 AM

View PostLupus590, on 20 March 2015 - 07:57 AM, said:

I found that post with the .tar format archiver, I've added it to my previous post too.
http://www.computerc...ar-files-in-cc/
Thanks, but the file should be executable in CC.
I'm going to search for some simple compression algorithms in lua.

#10 Mr. Bateman

  • Members
  • 98 posts
  • LocationAustralia

Posted 20 March 2015 - 11:41 PM

View PostLupus590, on 20 March 2015 - 07:57 AM, said:

I found that post with the .tar format archiver, I've added it to my previous post too.
http://www.computerc...ar-files-in-cc/
That implementation doesn't have compression, so it's useless in this regard.

View PostCrazedProgrammer, on 20 March 2015 - 08:05 AM, said:

Thanks, but the file should be executable in CC.
I'm going to search for some simple compression algorithms in lua.
Keep in mind that you have to put the decompression script in every packaged file so it can decompress itself, so stay clear of any 30kb Huffman encoding algorithms.

#11 Lupus590

  • Members
  • 1,965 posts
  • LocationUK

Posted 20 March 2015 - 11:55 PM

View PostMr. Bateman, on 20 March 2015 - 11:41 PM, said:

-snip-

The point was that someone had made a program that used a real life file format. I did reference my previous post, maybe you should have read it.

#12 Mr. Bateman

  • Members
  • 98 posts
  • LocationAustralia

Posted 21 March 2015 - 01:21 AM

View PostLupus590, on 20 March 2015 - 11:55 PM, said:

The point was that someone had made a program that used a real life file format. I did reference my previous post, maybe you should have read it.
Assuming this is the post in question:

View PostLupus590, on 19 March 2015 - 07:43 AM, said:

Feature request, file size shrinking (bonus for IRL compressed file format, .7z .zip .tar.gz - someone has made tar format)
\
You're asking for compression, and you state that it's a "bonus" if a real life format was used. The TAR implementation in CC doesn't support compression, so the first criteria is invalidated, therefore providing no fulfillment towards your request.
I don't think you've read your own post.

#13 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 21 March 2015 - 01:48 AM

It's a bit of a moot point, considering that you can only upload / download ASCII.

#14 Lupus590

  • Members
  • 1,965 posts
  • LocationUK

Posted 21 March 2015 - 10:28 AM

.tar.gz is a combined format the .gz provides compression

anyway, enough arguing.

Edited by Lupus590, 21 March 2015 - 10:28 AM.


#15 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 21 March 2015 - 11:19 AM

View PostBomb Bloke, on 21 March 2015 - 01:48 AM, said:

It's a bit of a moot point, considering that you can only upload / download ASCII.
It converts binary data to base64 so you can upload everything to pastebin.

#16 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 21 March 2015 - 01:35 PM

That's great and all, but then what are you going to do - paste that content into your compression software of choice? ;)

You'll need a go-between converter, so it doesn't matter so much as to whether the pre-base64'd file uses a "standard" format or not.

#17 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 21 March 2015 - 04:31 PM

I've updated Packager to use LZW compression and a more efficient way to make directories and files, and this can make the output file sometimes even smaller than the directory you compress.
To download it use the same command as before:
pastebin get Wy5vb6p0 packager
The usage is also exactly the same, you just see the difference in size.
Screenshot:
Spoiler


#18 minebuild02

  • Members
  • 97 posts

Posted 25 March 2015 - 09:17 AM

Can I use this in my OS?

#19 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 25 March 2015 - 10:08 AM

View Postminebuild02, on 25 March 2015 - 09:17 AM, said:

Can I use this in my OS?
Of course :D
This program was made for those kinds of things.

#20 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 29 March 2015 - 11:40 AM

Packager 70: too long without yielding.

The folder I was trying to compress is this one.

If you want to get the folder structure, type this:

pastebin run 2DMDuHci TheOS

~Creator





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users