You are here

TinyResMeter - keeping the PAF build as small as possible

20 posts / 0 new
Last post
computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
TinyResMeter - keeping the PAF build as small as possible

I'm currently talking to the TinyResMeter developer about making a PAF-compliant build of it.
For those who aren't familiar with TinyResMeter, here's a quote from the homepage:

TinyResMeter is a small tool that displays useful information about system resources in real time, but it also gives much more detail when you right-click on the displayed fields !

BONUS built-in function that redirects the original PrintScreen key and makes it save screenshots into .BMP files with automatic file renaming. Press PrintScreen as many times as you want, and you'll get instant screenshot files you can work on later...

The use of KOL Delphi library and direct API programming permitted very small code size.

At only 116 kb, TinyResMeter lives up to its name. It's also packed full of functionality, which makes it a good candidate for portabilization; it's also natively portable, so all I need to do is have the launcher move a single INI file back and forth from App\TinyResMeter to Data.

However, the TinyResMeter developer has some reservations, especially filesize. He made a valid point: one of the strongest points TinyResMeter has is its tiny filesize, and that's going to get blown up with a bunch of "window dressing" (remember, TRM is already completely portable - another sticking point here). I just looked at a blank PAF build (actually the template PA build from UUPADA), and it's 179 kb. There's no way I can get the TinyResMeter developer to accept having the filesize more than doubled just for the sake of having PAF compliance; is there any way I can get that shrunk?
I'm going with a custom launcher, since PAL is 383 kb (sorry Chris!), but that's about all I can think of. Perhaps AppCompactor would be beneficial here, but compression triggers some AV programs. Is it worth it? Any other ideas?

Thanks!

OliverK
OliverK's picture
Offline
Last seen: 3 years 6 months ago
Developer
Joined: 2007-03-27 15:21
Remove most of the ini

Remove most of the ini options, you won't need them. Apps like geany portable and pnotes portable don't support them anymore :p.

As far as passed parameters section, if the app doesn't support passed parameters then you don't need that either.

The real problem is the splash screen, that's what inflates the size the most.

As far as code, just do,

Rename $SettingsDirectory\.ini $ProgramDirectory\settings.ini
Execwait $ProgramDirectory\$progamExectuable.
Rename $ProgramDirectory\settings.ini $SettingsDirectory\.ini

You could probably save more space by using native nsis variables ($0-$9), but I don't know for sure, so please don't quote me Blum

As far as compression, most of the apps here use it. PNotes doesn't, but its one executable, and I figured it wasn't worth the extra testing required. (Well, my build wasn't. JTH may have changed that.:() Alot of the other apps do. Geany is compressed, and its never caused any problems (that I know of :P). I think I compressed most of GTK as well.

Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Thanks for the suggestions

Thanks for the suggestions!
I just finished a "standard" build of TinyResMeter, and it's 341 KB (191 KB for just the PAF files; the extra size is after I include the TinyResMeter files) - I've been pulling out my hair for a couple of hours over how to shrink that.
Even compression did no good - AppCompactor couldn't get rid of even a single KB.

OliverKRemove most of the ini options, you won't need them. Apps like geany portable and pnotes portable don't support them anymore :P.

There only are 3 options left; I was able to get rid of AdditionalParameters (see below). I don't think it's a good idea to ditch TinyResMeterExecutable, TinyResMeterDirectory, or DisableSplashScreen.

OliverKAs far as passed parameters section, if the app doesn't support passed parameters then you don't need that either.

hmm, you're right about passed parameters - I don't think TinyResMeter supports any. *snip snip*
Shoot, only 1 KB saved.

OliverKThe real problem is the splash screen, that's what inflates the size the most.

Yeah, you're right. I just ran the splash through Photofiltre and compressed the splash as far as I could without making it look bad; it went from 35 KB to 12.2 KB.

Just ran WinDirStat on the TinyResMeterPortable folder - dang it, the confounded launcher is bigger than TRM itself. No way the dev is going to accept that; time to put that launcher on a diet again.
EDIT: finally got the launcher down to 82.9 KB, with more trimming to come.

OliverKAs far as code, just do,

Rename $SettingsDirectory\.ini $ProgramDirectory\settings.ini
Execwait $ProgramDirectory\$progamExectuable.
Rename $ProgramDirectory\settings.ini $SettingsDirectory\.ini

You could probably save more space by using native nsis variables ($0-$9), but I don't know for sure, so please don't quote me Blum

No, I can't trim the launcher that far, or can I?
Here's what I've got atm: http://pastebin.com/m38d6d0bc
I have to leave in the DefaultData copying, since that saved me 13KB on an INI file. (I have to have a default INI file, since TRM supports 5 different spots for one - with a default, I can specify exactly where I want the INI to go)

hmm, I wonder.
I have a few more ideas I'm going to go try; if I can get the whole build, TRM files and all, down to 200 KB I'll be satisfied.

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

OliverK
OliverK's picture
Offline
Last seen: 3 years 6 months ago
Developer
Joined: 2007-03-27 15:21
Try this:

Try this: http://pastebin.com/XrrkUw81

I didn't clean everything up, its just something I whipped together. I would suggest checking out GeanyPortable 18.1 for some nice code having to do with multiple launcher.

Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Thank you!

Thanks, that clipped the launcher by another 5 KB!

The Rename call wasn't working properly, probably due to the wildcards, so I had to replace it with CopyFiles and Delete.
Here's the final product: http://pastebin.com/vZyP7aE0
Final size: 243 KB, including the TinyResMeter executable and a 13 KB data file in DefaultData.
Final size, without TinyResMeter or a data file: 114 KB.

Incidentally, guys, keep an eye on the TRM homepage - there's some interesting things going on.
I've been authorized to "leak" a little bit, so here's some screenshots of 0.98:

http://i45.tinypic.com/15ywt8i.png

http://i45.tinypic.com/2rcojfp.png

http://i50.tinypic.com/majf60.png

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

OliverK
OliverK's picture
Offline
Last seen: 3 years 6 months ago
Developer
Joined: 2007-03-27 15:21
You may have to issue the

You may have to issue the rename command to exact file names. This is better then copy\delete Smile

Also, maybe he'll make it so you could do a call and tell the program where the files are, like in FileZilla Portable Smile

Also, you might be able to dump lines 61-63. Unless the read w\ default needs it. Comment it out and try to compile. If it doesn't, then you know went wrong Wink

Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Rename = too rigid

OliverKYou may have to issue the rename command to exact file names. This is better then copy\delete Smile

TinyResMeter has a rather unique settings-saving method: 0.98, the soon-to-be-released version I'm working with, saves its settings in a file named "TinyResMeter0.98.0.1.ini". I imagine 0.99 will use "TinyResMeter0.99.0.0.ini", etc., which means a hard-coded Rename call will break whenever a new version of TRM comes out. This way, it handles any INI - significantly more flexible. Wink

OliverKAlso, maybe he'll make it so you could do a call and tell the program where the files are, like in FileZilla Portable Smile

hmm, worth asking.

OliverKAlso, you might be able to dump lines 61-63. Unless the read w\ default needs it. Comment it out and try to compile. If it doesn't, then you know went wrong Wink

Lines dumped, compile successful, run successful. Thanks!

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

OliverK
OliverK's picture
Offline
Last seen: 3 years 6 months ago
Developer
Joined: 2007-03-27 15:21
So how small is the package

So how small is the package (in total) now?

Also, most of the apps are compressed. It might be worth it (though I don't use it because of the large number of files in my apps.)

Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Without the TinyResMeter

Without the TinyResMeter files onboard, the loose files are 110 KB; that changes to 272 KB once I put them in the installer.
With the TinyResMeter files onboard, the "loose" (not in an installer) files are 239 KB; that changes to 384 KB once I put them in the installer.

Not at all bad, and a very interesting exercise in compression. Smile
(Incidentally, we got things so far down that AppCompactor did exactly nothing!)

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

OliverK
OliverK's picture
Offline
Last seen: 3 years 6 months ago
Developer
Joined: 2007-03-27 15:21
So you're

So you're slightly-less-then-doubling with the PAF Format Smile

Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world

Mark Sikkema
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-07-20 14:55
Just for some inspiration !

What about leaving all the Variables out:
http://pastebin.com/eAz26d2T

Formerly Gringoloco
Windows XP Pro sp3 x32

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Thanks anyway, but that takes

Thanks anyway, but that takes out a fair amount of flexibility without changing the launcher's filesize (56.7 KB).
I think we've gone as far down as we can without taking out part of the launcher's functionality; I'll play with the compression settings and see what I can get, but then AV apps are liable to jump on it. This is probably as good as it gets.

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

Mark Sikkema
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-07-20 14:55
I'm not sure how much

I'm not sure how much difference there will be in the launchers file size, but there definitely will be in the amount of memory it will take when running.

As well I'm quite sure it wouldn't take functionality, as you weren't using portable.ini file, parameters or anything like that !

[edit:what functionality??? https://portableapps.com/node/22481#comment-143761]

Formerly Gringoloco
Windows XP Pro sp3 x32

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
I'm referring to the

I'm referring to the launcher's ability to use executables other than TinyResMeter.exe (via TinyResMeterPortable.ini) - could be quite useful where TinyResMeter.exe is blocked (per the readme) - and a different directory as well. Hard-coding everything breaks that.
nvm - I just checked and that capability was removed from the launcher. I'll switch to yours, since it probably will use less RAM.

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

Darkbee
Darkbee's picture
Offline
Last seen: 4 years 7 months ago
Joined: 2008-04-14 09:41
Freaky Coincidence

Wow, isn't that funny. I was using this handy little tool the other day. I wanted to see if it had system temperature monitoring (I don't think it does, at least I couldn't find it). Nonetheless, a handy tool and like its name, it's tiny!

I didn't think about portable app though, because it appeared to be dead project and I couldn't understand why a never version required registration to download.

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
NOT dead

Nope, it's not dead in the slightest. I can promise that; I can't say more at the moment, except that you might be surprised by upcoming events. Better keep an eye on the TRM homepage.

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Getting desperate

I'm getting a bit desperate here; nothing seems to be taking this to 200 KB.
I got rid of the splash screen and all associated code; that only took me down to 249 KB. I tried getting rid of LogicLib; one less library = one less thing to build in = a smaller filesize, right? Wrong. The filesize stayed at 249 KB, and that was the last thing I can think of.
I still think the dev is going to have a hard time accepting this; TRM is 116 KB, TRM with an INI file is 129 KB, and the PA files are 120 KB. Depending on how you look at it, putting TRM in PAF more than doubles its filesize or slightly less than doubles its filesize. Either one is bad.

Does anybody know how to compress icons? At 24.4 KB, AppIcon.ico is pretty big; I tried compressing it in GIMP but didn't get anything but a corrupted icon with bad sizes (e.g. 15x12).

PNG compression would be good too; at 11.8 KB, they could stand some compression.
PNGCrush ftw! Now if only I can compress the Help images, the PNG's will be as compressed as they can get.

Does anybody know if I can legally compress the Help images? help_logo_top.png is 8.37 KB, but I'm sure I can take that down to around 1 KB if I can compress it. Problem is, the PA icons are all trademarks; since IANAL, I have no idea if I can compress them without violating the trademarks.

(Dang it, this feels like stories I've read of the era when people fought to get their program inside 1 K, and the person who added a single byte answered to the dev. I thought we left that era... oh well, it's good to see somebody who's actively fighting software bloat.)

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Another update: breaking all the rules

Well, I just pushed everything to the wall.
I compressed all the PNG images (including the Help ones) and even help.html. I also deleted all the icons in AppIcon.ico except one (48x48, 32-bit), then recompiled the launcher to apply the icon shrink to the launcher as well.
End result: 93.9 KB of PAF files and 223 KB when TRM is bundled. Still not beautiful, and completely against the Format. John, I'm going to need special permission on a couple of things here, or this one's going to be at least 250 KB.

Also, why doesn't the ExtractIcon setting in appinfo.ini work? I tried using it, got an error from NSIS, had to comment out the Icon section entirely, and ended up with a generic installer icon. What goes on here?

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

John T. Haller
John T. Haller's picture
Online
Last seen: 24 min 34 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Nope

You need to follow the standard guidelines. AppIcon must include all required formats. And the PNG icons should remain as is unless you're going to test them in all browsers. ExtractIcon is a menu directive that isn't yet used. You still have to include an icon for the installer.

I understand having fun with this as an exercise, but it's a bit pointless in reality. As an example, taking a file from 7KB to 4.5KB saves 0KB on disk since it has 4KB clusters. Plus, no matter how small you get it, it will show up as 1MB download and 1MB installed if it goes official as we use whole numbers and round up everything under 1MB to 1MB.

Sometimes, the impossible can become possible, if you're awesome!

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Re:

John T. HallerYou need to follow the standard guidelines. AppIcon must include all required formats. And the PNG icons should remain as is unless you're going to test them in all browsers. ExtractIcon is a menu directive that isn't yet used. You still have to include an icon for the installer.

OK, I'll add them back in.

John T. HallerI understand having fun with this as an exercise, but it's a bit pointless in reality. As an example, taking a file from 7KB to 4.5KB saves 0KB on disk since it has 4KB clusters. Plus, no matter how small you get it, it will show up as 1MB download and 1MB installed if it goes official as we use whole numbers and round up everything under 1MB to 1MB.

Actually, it's not just having fun or an exercise - it's a very real attempt to shrink the size of the PAF build as much as possible. The TinyResMeter developer seemed to be primarily concerned about size (TRM is only 116 KB), and he's given me no guarantees or permission yet. The deal is far from done, and I'm trying to oblige him as much as possible without breaking the format.
EDIT: finally decided to add this quote from the TRM developer.

The only problem I see with PortableApps is that TinyResMeter will not
be ~100KB anymore Sad keeping TinyResMeter as small as possible is one
of its main goal, how many KB is the PAF header ?

Rounding isn't a problem, and I'm not worried about clusters as much as I am actual file size. TRM has gained the most fame for being tiny but potent, and I'm trying to match that.

Is it OK with you if I compress the Help images and omit the splash screen? (it's lossless compression, since they're in PNG format)
If I can't omit the splash screen, can I at least compress it? I got it from 35 KB down to 12 KB without noticeable loss, and every little bit helps here.

Thanks!

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

Log in or register to post comments