You are here

Useful scripts

14 posts / 0 new
Last post
Ryan McCue
Ryan McCue's picture
Offline
Last seen: 14 years 6 months ago
Joined: 2006-01-06 21:27
Useful scripts

Thought these might prove useful to you.

The first, upax.bat UPXs everything within the current directory (and subdirectories) with the standard options used by John. You need to put both this and upx.exe in your path somewhere, like C:\WINDOWS\system32
The second, pangout.bat uses pngout to compress all .png files within the current directory (and subdirectories) and automatically answers yes to any questions.
The final, cleanup.bat is a companion for upax.bat and deletes all the backup files (.ex~, .dl~).

To use them, open up the command prompt, cd into the required folder (most likely BlahPortable\App\blah) and type either upax, pangout or cleanup.

Download them here:
http://cubegames.net/downloads/upax.bat
http://cubegames.net/downloads/pangout.bat
http://cubegames.net/downloads/cleanup.bat
----
Ryan McCue

m2
Offline
Last seen: 13 years 1 month ago
Joined: 2006-12-12 12:00
Why nrv2d ?

Why nrv2d ?

"Those people who think they know everything are a great annoyance to those of us who do." Asimov

BuddhaChu
BuddhaChu's picture
Offline
Last seen: 7 years 5 months ago
Joined: 2006-11-18 10:26
I've asked that question of

I've asked that question of John before with no response. nrv2e is newer/more current and --lzma packs way better. Maybe it's the most comapatable and "nicest" method of compressing the files.

Ryan: Why do you have a second file to do cleanup? Do you keep backups "just in case" and then delete them? I assume you know if you ditch the -k switch no backups are kept and then there's no cleanup step. (I now these are the default switches John posted he uses).

Additionally, the following file extensions have been included in apps available here and are executables and can be compressed with UPX also. I find it easier to send all files to UPX and it knows which files are executables or not and compresses the ones it can.

sfx irc acm ax drv qtx qts vwp so

This post isn't intended to be critical (if it comes off that way). Thanx for posting your scripts! Smile

Edit: the pngout.bat file is missing or something. Link broke. (since you're a mopd, delete this line once the link is fixed thank you...no need to put the "edited by RM" statement here either)

Cancer Survivors -- Remember the fight, celebrate the victory!
Help control the rugrat population -- have yourself spayed or neutered!

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 14 years 6 months ago
Joined: 2006-01-06 21:27
.

I've asked that question of John before with no response. nrv2e is newer/more current and --lzma packs way better. Maybe it's the most comapatable and "nicest" method of compressing the files.
Well, I only use the same as John. I think it's because it has a good mix between speed and size.

Why do you have a second file to do cleanup? Do you keep backups "just in case" and then delete them? I assume you know if you ditch the -k switch no backups are kept and then there's no cleanup step.
Correct. I've had many a time when I used the -k switch and had to redownload the app.

Additionally, the following file extensions have been included in apps available here and are executables and can be compressed with UPX also. I find it easier to send all files to UPX and it knows which files are executables or not and compresses the ones it can.
sfx irc acm ax drv qtx qts vwp so

Well, if you want to do that, just change (*.exe,*.dll) to (*.*)
I personally go through every file just to see what it is. If there's one that has an abnormal extension, I manually UPX it.
----
Ryan McCue.
Blog.
So all that Airbus-delay trouble over here in Europe is because of YOU!
Simeon.

"If you're not part of the solution, you're part of the precipitate."

BuddhaChu
BuddhaChu's picture
Offline
Last seen: 7 years 5 months ago
Joined: 2006-11-18 10:26
I tried to edit my

I tried to edit my post...you replied b4 I could.

The panout.bat doesn't exist or the link is broken. I get sent to your error page.

please delete this post once it's fixed. Thanx!

Edit: oh wait, the line mentioning panout.bat DID make it into my post...oh well.

Cancer Survivors -- Remember the fight, celebrate the victory!
Help control the rugrat population -- have yourself spayed or neutered!

yurzub
Offline
Last seen: 15 years 7 months ago
Joined: 2007-06-04 12:21
the link is shown as going

the link is shown as going to panout.bet, should be pangout.bat.

http://cubegames.net/downloads/pangout.bat work just fine (note the g)

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 14 years 6 months ago
Joined: 2006-01-06 21:27
Done

Fixed. Thanks.
----
Ryan McCue.
Blog.
So all that Airbus-delay trouble over here in Europe is because of YOU!
Simeon.

"If you're not part of the solution, you're part of the precipitate."

m2
Offline
Last seen: 13 years 1 month ago
Joined: 2006-12-12 12:00
Well, I only use the same as

Well, I only use the same as John. I think it's because it has a good mix between speed and size.
nrv2e should be as fast as d and sometimes gives better results.

"Those people who think they know everything are a great annoyance to those of us who do." Asimov

yurzub
Offline
Last seen: 15 years 7 months ago
Joined: 2007-06-04 12:21
WORD OF WARNING

WORD OF WARNING - Don't use UPX on NSIS launchers... they will become corrupt.

I upx'd my entire PA directory and almost cried when, after then running the cleaners, most of my apps stopped launching.

Zach Thibeau
Zach Thibeau's picture
Offline
Last seen: 1 year 5 months ago
Developer
Joined: 2006-05-26 12:08
I upx all my launchers it's

I upx all my launchers Wink it's a command in the nsis script you have to include and it will compile the new launcher with upx compression
-----------------------------
"I don't fear Computers. I fear the lack of them" Isaac Asimov
My Personal Blog in the making at a new address thibeaz.com Biggrin

your friendly neighbourhood moderator Zach Thibeau

BuddhaChu
BuddhaChu's picture
Offline
Last seen: 7 years 5 months ago
Joined: 2006-11-18 10:26
Heed Ryan's advice...

...and put the script in the ..\App directory to just compress the application's files and not the launcher.

Cancer Survivors -- Remember the fight, celebrate the victory!
Help control the rugrat population -- have yourself spayed or neutered!

Zach Thibeau
Zach Thibeau's picture
Offline
Last seen: 1 year 5 months ago
Developer
Joined: 2006-05-26 12:08
No

To Compress your launcher just add this to the script near the
!define section

;----UPX Compression----
!define HAVE_UPX

!ifdef HAVE_UPX
!packhdr tmpexe.tmp "UPX --best --compress-icons=0 --nrv2d --crp-ms=999999 tmpexe.tmp"
!endif

and it will compress the launcher and still be usable
-----------------------------
"I don't fear Computers. I fear the lack of them" Isaac Asimov
My Personal Blog in the making at a new address thibeaz.com Biggrin

your friendly neighbourhood moderator Zach Thibeau

Simeon
Simeon's picture
Offline
Last seen: 9 years 5 months ago
DeveloperTranslator
Joined: 2006-09-25 15:15
Or you can

disable the crc check and compress it afterwards but I dont think thats recommended.
“I can live with doubt and uncertainty and not knowing. I think it is much more interesting to live not knowing than to have answers that might be wrong.” - Richard P. Feynman

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

BuddhaChu
BuddhaChu's picture
Offline
Last seen: 7 years 5 months ago
Joined: 2006-11-18 10:26
misread

thibeaz: You misread my post. I'm talking about the commandline scripts he posted earlier. If the developer doesn't UPX the launcher your way, it can be UPXd by Ryan's script...which breaks it. If you follow Ryan's advice and only UPX the files in the ..\App directory/subdirs you won't accidentally compress the launcher in the portable software's root directory. If the developer didn't UPX the launcher using your method, the end user can compress it and screw themselves over when it breaks.

Cancer Survivors -- Remember the fight, celebrate the victory!
Help control the rugrat population -- have yourself spayed or neutered!

Log in or register to post comments