yaP - yet another Portablizer

If you are currently developing portable freeware or planning to do so, use this forum to discuss technical implementation, seek out like-minded developers for partnership, or solicit interested users for beta testing.
Message
Author
User avatar
Midas
Posts: 6725
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: yaP - yet another Portablizer

#211 Post by Midas »

:idea: :arrow: :mrgreen:

just.odd.dude
Posts: 15
Joined: Sun Sep 15, 2013 7:55 am

Re: yaP - yet another Portablizer

#212 Post by just.odd.dude »


User avatar
tproli
Posts: 1172
Joined: Sat Sep 09, 2006 10:14 am
Location: Hungary
Contact:

Re: yaP - yet another Portablizer

#213 Post by tproli »

Thanks, added to the Examples section. I cannot check it in operation but it seems that all of its settings are covered.
I made a little modification to the REGISTRY KEYS part.

User avatar
tproli
Posts: 1172
Joined: Sat Sep 09, 2006 10:14 am
Location: Hungary
Contact:

Re: yaP - yet another Portablizer

#214 Post by tproli »

yaP was updated to 0.34:

Code: Select all

- ADDED simple encryption of config items (based on Droopy's function @ http://www.purebasic.fr/english/viewtopic.php?f=12&t=15203)
- ADDED added yaPCrypt tool to encrypt or decrypt config items
- ADDED {USERTEXT} macro: show a text input dialog to dynamically add text at runtime
- ADDED {USERFILE} macro: show a browse file dialog to dynamically add filepath at runtime
- ADDED {USERDIR} macro: show a browse directory dialog to dynamically add path at runtime
- ADDED replaceline feature to [FILES] section: replace whole lines in files (text files only, runs both on BEFORE/AFTER parts)
  Syntax:
  replaceline={FILE} ::: {beginning of line to find} ::: {replacement}

  Example:
  replaceline=Profile\WireKeys GPL.conf ::: <uint-checkForUpdates value="1"/> ::: <uint-checkForUpdates value="0"/>
- FIXED .NET check if only major version number was supplied with the required mod (e.g. 4!)

User avatar
Midas
Posts: 6725
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: yaP - yet another Portablizer

#215 Post by Midas »

Great news! 8)

Those are really useful improvements to an already essential tool -- even if yaP's exe grew from 53 to 67 KB.

A small suggestion for the future: when yaP auto-generates its INI, it would be useful for tracking purposes if the version used would appear in the file header:
; configuration file for yaP v0.34 (http://rolandtoth.hu/yaP/)
A simple addition that would greatly simplify checking for any needed launcher updating.

User avatar
tproli
Posts: 1172
Joined: Sat Sep 09, 2006 10:14 am
Location: Hungary
Contact:

Re: yaP - yet another Portablizer

#216 Post by tproli »

Yes, file size is larger but can be reduced to 31 KB using UPX.
I wonder if the size could be made smaller using another language, eg. C++ for example. I think I cannot rest in peace until I rewrite it in C++ :)

yaP does not generate the ini file but rather extracts it. But I agree that it can be useful, I will consider adding that.

User avatar
guinness
Posts: 4118
Joined: Mon Aug 27, 2007 2:00 am
Contact:

Re: yaP - yet another Portablizer

#217 Post by guinness »

The filesize is negligible really.

User avatar
Midas
Posts: 6725
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: yaP - yet another Portablizer

#218 Post by Midas »

tproli wrote:I think I cannot rest in peace until I rewrite it in C++ :)
  • Wouldn't assembly be better suited? :twisted:

    Many thanks for your awesome work, I use yaP everyday. :mrgreen:

User avatar
guinness
Posts: 4118
Joined: Mon Aug 27, 2007 2:00 am
Contact:

Re: yaP - yet another Portablizer

#219 Post by guinness »

Midas wrote:
  • Wouldn't assembly be better suited? :twisted:
Well not really, as compilers these days convert directly to machine code, so creating in Assembly is an only way to show off! :mrgreen:

User avatar
Ascend4nt
Posts: 61
Joined: Fri Nov 19, 2010 10:37 am
Location: NJ, USA
Contact:

Re: yaP - yet another Portablizer

#220 Post by Ascend4nt »

tproli wrote:Yes, file size is larger but can be reduced to 31 KB using UPX.
I wonder if the size could be made smaller using another language, eg. C++ for example. I think I cannot rest in peace until I rewrite it in C++ :)
trpoli, the file size as it is is actually better than you'd get writing a typical C++ program for Windows. I've done quite a few comparisons with different languages to try to see which produces the smallest executable size, and really there are very few languages these days that will produce small ones.

As far as C++ goes, Microsoft's compilers will produce the smallest sized executables on Windows, however in producing a bare-bones minimalist program that does nothing more than write 1 or two lines of text to the console, this is the size that results:
VC 2008: 51KB
VC 2010: 44KB
VC 2013: 71.5KB

All three executables have been statically linked to the libraries, so you'll definitely see a huge difference if you use dynamic linkage (like under 10KB). However, for a portable program you'll want to always statically link to the runtime libraries.

Going a little further.. since most C++ programs make use of the IO Streams library, you'll see that just writing one to two lines of code can further impact the file size:
VC 2008: 125KB
VC 2010: 121KB
VC 2013: 151KB

I could also add in multithreading support and you'll see an even more pronounced base filesize. This all has to do with Microsoft's intelligent module linking and, while not optimal, is still better than anything any other C++ Windows compiler can do size-wise.

Keep in mind that text and code you add is on top of the above base file sizes.

If you go the C route, however, you'll find you can make super-tiny executables. But its pretty easy to write bad and buggy code in C. You're really better off sticking with Basic or one of the other minimalist interpreter/compiler languages for size (Gentee is a pretty neat and compact language, for example).

Oh, and I don't bother with FreeBasic anymore since the file sizes produced with newer versions (something like 100KB+) makes it too bloated for me - better to use C++ or D than Basic at that point.

Anyway, just thought I'd put my 2 cents in here.. don't learn a whole new language for no benefit!

User avatar
tproli
Posts: 1172
Joined: Sat Sep 09, 2006 10:14 am
Location: Hungary
Contact:

Re: yaP - yet another Portablizer

#221 Post by tproli »

Thanks for the info. You just saved me months of sweat & headaches I guess :)

Learning C is not something I would regret but I got others tasks to do too.

User avatar
Midas
Posts: 6725
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: yaP - yet another Portablizer

#222 Post by Midas »

As a side-effect of Ascend4nt's authoritative write up above, tproli's programming language choice (multi-platform 64 bit ready non-free Pure Basic) just made it into my top ranking personal prospective learning tasks. So, currently, the programming queue comprises JavaScript, AutoHotKey, (Pure) Basic, and Python; I'm still pretty much uninitiated in all of them -- so many (cool) things to do, so little time... :mrgreen:

User avatar
tproli
Posts: 1172
Joined: Sat Sep 09, 2006 10:14 am
Location: Hungary
Contact:

Re: yaP - yet another Portablizer

#223 Post by tproli »

Why AutoHotkey and not AutoIt?

User avatar
guinness
Posts: 4118
Joined: Mon Aug 27, 2007 2:00 am
Contact:

Re: yaP - yet another Portablizer

#224 Post by guinness »

tproli wrote:Why AutoHotkey and not AutoIt?
Yeah I agree. I also agree Midas that learning JavaScript is a good choice too :mrgreen:

User avatar
Midas
Posts: 6725
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: yaP - yet another Portablizer

#225 Post by Midas »

tproli wrote:Why AutoHotkey and not AutoIt?
  • It's a philosophical stance: when given the option, I always go with free/open -- even if that means a 2nd tier choice. :roll:

Post Reply