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: 6710
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: yaP - yet another Portablizer

#316 Post by Midas »

Great! 8)

I'm a bit puzzled, though: I'll have to set variables for both 32 and 64 bit environments, assume the least denominator case (x32), and then override it with the other case (x64)?

Or can I just set a "->fileX64 ..." keyword?
  • - NEW: ini keys ending with "X64" are executed only if:
    - yaP is running on 64bit Windows, and
    - the "application" key has a second exe set (indicating that yaP is running in X64 mode)

    Example:
    application = App\App.exe :: App\AppX64.exe
    envvar = JAVA_HOME :: {YAPROOT}\jre
    envvarX64 = JAVA_HOME :: {YAPROOT}\jre64

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

Re: yaP - yet another Portablizer

#317 Post by tproli »

"->file" - both X86 and X64 (default)
"->fileX86" - only X86, when the host Windows is 64bit then this will be ignored
"->fileX64" - runs only on X64

You can use "->fileX64" alone, then on X86 will be no copy. In theory :)

The overwrite variable trick should work too, I've used somewhere.

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

Re: yaP - yet another Portablizer

#318 Post by Midas »

Ah, much better then... I'll just set different keywords for each case. Thanks. :)

User avatar
rbon
Posts: 361
Joined: Wed Mar 28, 2007 2:16 am
Location: Italy

Re: yaP - yet another Portablizer

#319 Post by rbon »

Dear tproli,
here is the launcher for wxHexEditor, an hex editor for HUGE files. It edits files with size: Multi Giga < Tera < Peta < Exabytes.
- web site: http://www.wxhexeditor.org/home.php
- Sourceforge download page: http://sourceforge.net/projects/wxhexed ... 23%20Beta/
- Softpedia: http://www.softpedia.com/get/Programmin ... itor.shtml

Code: Select all

; configuration file for yaP v0.6.5 Beta 287 (http://rolandtoth.hu/yaP/)
; application name: wxHexEditor
; version: 0.23 Beta
; website: http://www.wxhexeditor.org/home.php
; suggested by: rbon

[GENERAL]
application = App\wxHexEditor.exe

[BEFORE]
regkey = HKCU\Software\wxHexEditor
Also, I have tried others launchers (winPenPack) and its launcher requires that .ini contain the instruction for remove the keys used inside [BEFORE].
Why yaP do not requires instructions inside [AFTER]? In fact it work without remove keys and it creates properly its file "settings.reg".
Thanks
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook.

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

Re: yaP - yet another Portablizer

#320 Post by tproli »

Thanks, config added:
http://rolandtoth.hu/yaP/#examples/wxHexEditor.ini
Why yaP do not requires instructions inside [AFTER]?
This is by design. From version 0.5 yaP is smart enough to keep you DRY :)

In the docs, the definition of "regkey" is:

Code: Select all

Backup, save and restore a registry key.
So "regkey" does ALL these things automatically. You need to specify the registry key once, no need to repeat it in the AFTER section.

Such automatic (or complex) keywords are "dir", "file", "regkey", "(dir)", "(file)", "(regkey)" and "symlink".

To prevent this automatic behaviour, use "->regkey" (BEFORE and AFTER): this keyword does only one thing, copy contents of a registry key (same with "->file", "->dir").
And another trick: to reverse direction, use "<-regkey", then you can keep the same value (yaP takes care of that).

The downside of yaP's automatic operations is the order: yaP executes the AFTER part of complex keywords right after closing the main application.
This is OK in most cases, but if you need to execute something before them, use "restore = 1" in the AFTER section.
This tells yaP to execute automatic AFTER items where it finds "restore" keyword in the queue.

Hope this helps :)

User avatar
rbon
Posts: 361
Joined: Wed Mar 28, 2007 2:16 am
Location: Italy

Re: yaP - yet another Portablizer

#321 Post by rbon »

Hi tproli,
here is the launcher for Exeinfo PE a Packer, compressor detector / unpack info / internal exe tools and detect Windows / Symbian / Android / Linux / Mac OS - files .
- web site: http://exeinfo.atwebpages.com/
- direct download 1: https://exeinfo.opendrive.com/files?91262070_ezoLu
- direct download 2: http://www.exeinfo.pe.hu/exeinfope.zip
- Softpedia: http://www.softpedia.com/get/Programmin ... o-PE.shtml

Code: Select all

; configuration file for yaP v0.6.5 Beta 287 (http://rolandtoth.hu/yaP/)
; application name: Exeinfo_PE
; application type: 32 bit (for Windows XP,7)
; version: 0.0.3.7
; website: http://exeinfo.atwebpages.com/
; suggested by: rbon

[GENERAL]
application = App\exeinfope.exe

[BEFORE]
regkey = HKEY_CURRENT_USER\Software\ExEi-pe :: Settings\ExeinfoPE.reg
regkey = HKEY_CURRENT_USER\Software\ExEi-pe\Exeinfo PE - ver.0.0.3.7 :: Settings\ExeinfoPE.ver.reg
I have verified (with Win XP) that:
1. registry remains clean
2. the launcher creates the folder \Settings
3. but this folder is empty (do not contains two .reg files)
Is this launcher wrong? Some idea?
Thanks
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook.

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

Re: yaP - yet another Portablizer

#322 Post by tproli »

Just checked and I see no issues:

1. Some apps doesn't save settings (to registry for example) if you don't change any setting. This seems to be the case here too. I've set "Always on top" and ExeinfoPE.reg was created successfully.

2. You are trying to wrap a registry key plus its subkey. This won't work as you might think, because:

- the first "regkey" instruction will rename "HKCU\Software\ExEi-pe" to "HKCU\Software\ExEi-pe_backup" (only if exists in the system, of course)
- the second "regkey" will always find nothing (because it is a subkey of the registry key yaP just renamed)

Now the AFTER part:
- "HKCU\Software\ExEi-pe" will be exported to ExeinfoPE.reg (if there's anything to export), then the reg key "ExEi-pe_backup" will be renamed to "ExEi-pe" (that is, the original registry key will be restored)
- the second "regkey" command would export the subkey of the just restored registry key - which is, if exists, from a local installation.

I recommend keeping the first "regkey" command only, it will contain all the subkeys too.

If for some reason you need two separate .reg files, use the "->regkey" command (which has no automatic AFTER part). But note that this command will also contain all the subkeys, so you cannot export the registry values from the root only.

User avatar
rbon
Posts: 361
Joined: Wed Mar 28, 2007 2:16 am
Location: Italy

Re: yaP - yet another Portablizer

#323 Post by rbon »

Thank for the info.
I have modified the .ini file with your suggestions, but the following hint is not clear for me.
tproli wrote: I've set "Always on top" and ExeinfoPE.reg was created successfully.
Do You can make an example of this?
Thanks
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook.

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

Re: yaP - yet another Portablizer

#324 Post by tproli »

Start the application, click on the "Options" button (to the right), and there are the options you can set.

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

Re: yaP - yet another Portablizer

#325 Post by Midas »

Following up on my last project, yaP's latest Beta (Beta v0.6.5.287) seems to have lost the ability to run non-exe files (e.g., 'x.main').

The system throws an error whenever I try, either with 32 and 64 programs. yaP v0.6.19 ran them fine... :?

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

Re: yaP - yet another Portablizer

#326 Post by tproli »

Sad but it seems you're right, no idea where did it go wrong :(

Will check it, thanks!

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

Re: yaP - yet another Portablizer

#327 Post by tproli »

Fixed in 6.5 build 293:
http://rolandtoth.hu/yaP/bin/yaP-latest-beta.zip

When min/max/hide options were added to "application", the launch method was changed, and wasn't entirely Midas-compatible :)

Code: Select all

v0.6.5 build 293 BETA - March 30, 2015
- FIXED: launching applications with non-exe extension (thanks to Midas)
- NEW: main icon update

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

Re: yaP - yet another Portablizer

#328 Post by Midas »

:D Thanks. :)

User avatar
rbon
Posts: 361
Joined: Wed Mar 28, 2007 2:16 am
Location: Italy

Re: yaP - yet another Portablizer

#329 Post by rbon »

Dear tproli,

I am engaged about a launcher for Regshot 1.9.1 beta 313 (website: http://sourceforge.net/projects/regshot/).
This utility is portable and has version for 32-64 bit and ANSI/Unicode.
I have used yap.exe (for both 32 and 64 versions) and it works (very well).

Unfortunately I have created 2 (two) launchers (and related .ini files):
- RegshotPortableANSI.exe
- RegshotPortableUnicode.exe

Each launcher works well but I do not know how to change localization: in effect the program start in english and I do not obtain the change in Italian (or other language).

Do You think that is possible to obtain a single launcher with 2 (two) options: ANSI and Unicode?

Here is a scrap of the launcher

Code: Select all

[BEFORE]
uservar = LANG :: Italiano
iniread = {YAPROOT}\App\language.ini :: [Italiano] :: Key :: Italiano
This scrap unfortunately do not works.

Thank for Your help.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook.

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

Re: yaP - yet another Portablizer

#330 Post by tproli »

There are couple of issues with your snippet, I suggest you to read the docs again :)

Here's how you can set the language to Italian:

Code: Select all

[BEFORE]
; set language (write value to ini file)
; this will force Italian language on each start
; regshot.ini will be created if not exists
; if you change language from within the main application, it will be NOT reserved on next run
iniwrite = {EXEPATH}\regshot.ini :: Setup :: Language :: Italiano

; another solution: create ini file with yaP on first run
; this will set language to Italian only if regshot.ini doesn't exist (so on the very first run)
; if you change language from within the main application, it will be reserved on next run
; +file = {EXEPATH}\regshot.ini ::  no overwrite :: [Setup]{LINEBREAK}Language=Italiano
Do You think that is possible to obtain a single launcher with 2 (two) options: ANSI and Unicode?
How would yaP decide what version you would like to launch?

yaP does not have if(-else) conditions, it can only differentiate between 32/64bit.

Post Reply