You are here

[Obsolete] Portable Application Template 2.7.3 released

115 posts / 0 new
Last post
Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
[Obsolete] Portable Application Template 2.7.3 released

Do not use this. Use the PortableApps.com Launcher instead.

What ist it for?
It helps you to create a clean portable application. This means no traces are left on the host computer and the application doesn't (normally) have to be changed in any way. (Maybe some configuration files)

Where can I get it?
http://www.loncarek.de/downloads/ApplicationPortableTemplate.nsi
use "Save As..." in your browser.
The license and more information could be found at the end of the source.

What to do to make an application portable?
1. You install the application you want to make portable on your computer.
2. You monitor which files, folders, and registry keys are generated. (There are several helper apps for that task).
3. You insert the monitored information into the constants at the beginning.
4. Then create a correct directory structure and compile the script with NSIS. Create an launcher icon.
5. Copy your application to the appropriate APP folder and also the launcher.
6. Run the launcher.
That's it...
It might happen that some applications need some additional handling, but that should be left to intermediate/advanced users as some routines would have to be added.

How does it work?
Existing Application files and folders are renamed. Registry keys saved. Then the files/folders/registry keys of the portable application are applied. Finally the Application is launched.
When the application is closed all files/folders/registry keys are saved within the data directory of the portable application and all original files/folders/registry keys are restored.
The users profile folder could redirected to the portable data directory.

Which application can I make portable?
Almost every application as far it does not implement itself too deep in the system. Also some commercial applications could get portable. But then respect the license or offer only the source to others.

What is this standalone launcher/installer thing mentioned in the history?
When I started creating this template I had in mind to create launchers especially for commercial applications. As you sure know most commercial applications do not allow to sher them with others. Now you can simply distribute your compiled launcher. It then will create the default directory structure, optionally files for PAF compatbility, copy the locally installed application into the portable apps folder and optionally compress it with UPX. Also some default files are extracted. So an end user wanting to create a portable version of his favorite commercial application doesn't have to do anything special. Simply start the launcher.

What license?
The license is a 2-clause BSD-style license. (see source for details)

What is needed?
In order to compile this script with NSIS you need the following Plugins:
- NewAdvSplash
- Registry
- FindProc
- Dialogs
Those Plugins can be found here: http://nsis.sourceforge.net/Category:Plugins
Last tested with NSIS 2.46
Alternatively use NSIS portabel which comes with all needed Plugins already.

Where can I find more informations about all the possible settings/constants?
This is easy. Simply open the script with your favorite editor/reader an go to the end of the source. There is plenty of explanation and documentation. If I forgot something please tell me, so I can add it.

History (since version 2.3):
Discussion/History until version 2.3:
https://portableapps.com/node/6709
2.4
- added extraction/creation of several stuff to get PAF compatible portable applications
- added some error handling and messageing
- fiexd: is now also capable of reading registry files (unicode) created from regedit version 5 and up (used since WinXP Before they were deleted.
- added more options for creating a standalone launcher/installer
2.5
- changed cleanup of newadvsplash to reflect changes to newest version
- fixed some wording in docs
- fixed commandline parameters being given as one string
2.6
- added: check for required write access to registry,if not possible the launcher exits
- updated PAF compatibility (creation of appinfo.ini)
- added additional variable for long application name (for descriptions)
- Registry keys are now stored in file ".reg", e.g. TestApp.reg
- added some missing freeing of the registry DLL
- added additional input checking
- added enhancement/bug fix for VISTA as suggested (HKCU and registry)
2.7
- removed alternative directory structures so it conforms better to PAF
- fixed registry checking bug which always required admin rights
- changed cleanup when some errors occur
- added two empty functions "InitCustom" and "CleanCustom" which can be used for own settings/manipulations
- added possibility to add the portable applications directory to the PATH environment variable
- added possibility to add own directories to the PATH environment variable

Any comments/bug reports are welcome.

quicky
Offline
Last seen: 14 years 11 months ago
Joined: 2006-10-26 13:12
Great template!

Your template works perfect! Very cool! Thanks alot!

quicky

eresele
Offline
Last seen: 5 years 8 months ago
Joined: 2007-10-28 18:21
Some postings that might be of interest to PAT 2.4 users

Since Portable Application Template 2.4 is now out in the wild, and I don't expect people to read through the 2.3 thread, I'm allowing myself to publish a few direct links to posts, that I posted there after the release of 2.4 (which I at that time hadn't yet been made aware of), which I assume are still valid and therefore of might be of interest to PAT users (including myself, and hopefully the developers of PAT).

https://portableapps.com/node/6709?page=1#comment-59128
NSIS 2.33, plugins and newadvsplash::wait

https://portableapps.com/node/6709?page=1#comment-59145
Specifying ICON?

https://portableapps.com/node/6709?page=1#comment-59146
parent v.s. child registry keys

https://portableapps.com/node/6709?page=1#comment-59228
EXEPARMS are passed to application as ONE string - NOT tokens

https://portableapps.com/node/6709?page=1#comment-59238
Java support and Portable Application Template 2.3 [/2.4]

Hope You don't mind, me "reposting" these here.

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
Thanks for pointing to it

I wasn't aware of this stuff (hadn't the time to monitor this forum all the time).

Regarding ICON:
I haven't found any way to do so. Maybe there is a plugin. At least haven't found one yet.

Regarding Java Support (Copied from docs within):
...
Which directory will be scanned for the JAVA/GTK version that will be used
(highest priority first):
A. "App\JAVA" or "App\GTK"
B. "CommonFiles\JAVA\" or "CommonFiles\GTK\"
C. "CommonFiles\JAVA" or "CommonFiles\GTK"
D. on the host computer installed JAVA or GTK

Remarks: When the above A and B do not exist C will be used regardless of the
installed version. It is highly recommended to use B as far as possible if you
want to share it with other portable applications. If your application does not
require a special GTK/JAVA version it is recommended to use C with the newest
available version of GTK/JAVA. should be only the version number
e.g. "1.6.0_01", otherwise it won't be found. A message will appear when the
hosts JAVA/GTK will be used.
...

So already there is support for multiple version in some respect.
You could have a java version together with your application in folder "App\JAVA". If it's not there you could have a different version in "CommonFiles\JAVA\" if the required is not found the version within "CommonFiles\JAVA" will be used. If still there is no Java the host computers java will be used.

So I hope this is clear now.

But it is not intended to make Java itself portable. It is only used to give a portable application access to java it might need.

eresele
Offline
Last seen: 5 years 8 months ago
Joined: 2007-10-28 18:21
Java support and Portable Application Template 2.5

Hi Klonk,

I'm fully aware that one cannot monitor everything all the time. I can't, and I don't expect You to be able to do that either. No problem!

Thanks for Your explanation about how Java is supposed to be supported in PAT. Your description matched exactly what I had managed to understand by "reverse engineer" PAT, and from the documentation that found in PAT itself.

The current implementation implements the concept You describe.

Unfortunately, IMHO, the conception of how Java works is not correct (no offense). I beg You to re-read what I wrote in my post with subject Java support and Portable Application Template 2.3 [/2.4].

In a nutshell, what's needed is to be able to just specify 'java[.exe]' or 'javaw[.exe]' in the !define EXE statement.

If one has specified an executable w/o an absolute/relative path, your template needs to look for 'java[.exe]' or 'javaw[.exe]' in the "allowed" places and, if found, "canonicalize" the path to the java[w] executable and substitute the specified executable (w/o an explicit path) with the canonicalized path.

Let me know if You need more information to get this right.

dramsey30
Offline
Last seen: 14 years 11 months ago
Joined: 2007-11-20 21:29
Location of the Registry.reg file?

Karl,
I was unable to get the Registry.reg manipulating code to work with the .reg file stored as "portableappdir\Data\Registry\Registry.reg". The file was not found at all. I put in some MessageBox printouts and learned that the code wanted the Registry.reg file stored in the Data directory itself, as "portableappdir\Data\Registry.reg". I may have misunderstood your directory setup instructions at the bottom of the file but I think they say that the Registry.reg file is supposed to be put into the "portableappdir\Data\Registry" directory. If the code is supposed to work with the Registry.reg file in this directory then I think your code needs to have this modification:
(using as an example one of the lines that manipulate the Registry.reg file:)
IfFileExists "$DATADIR\Registry.reg" 0 InitRegUseVar
changes to:
IfFileExists "$DATADIR\Registry\Registry.reg" 0 InitRegUseVar
Did I misunderstand where the Registry.reg file is supposed to be placed?
-- Don

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
Ahem

thanks for pointing to that. Formerly for each key an own file was created. But now only one Registry.reg file is created. Thus the subdirectory "registry" is not needed anymore.

Therefore the documentation at the end is wrong. I'll update it and upload it again, but I will not use a new version number as only some text was changed.

eresele
Offline
Last seen: 5 years 8 months ago
Joined: 2007-10-28 18:21
Error in PAT 2.5 concerning the handling of USEGTK (and USEJAVA)

Hi Klonk,

while using Your PA Template 2.5 with an application making use of GTK I noticed that You're adding the path of the "portable" GTK to the end of the PATH environment variable. This is fine as long as the user doesn't have a path to a GTK installation in his PATH. If (s)he already has one, that version would be used instead of the "portabe" GTK. To remedy this situation one should prepend the path, to the "portable" GTK installation, to PATH instead of appending it (as it's done in 2.5 - and in earlier versions too, I assume). This will make the PAT-based portable application pick up the right installation of GTK.

To accomplish this one has to change line 594 from reading:

System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("PATH", "$R0;$GTKDIR\bin").r0' ; set new path

to read:

System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("PATH", "$GTKDIR\bin;$R0").r0' ; set new path

This will give the "portable" GTK installation higher precedence.

The same is true for USEJAVA, 5 lines higher up in the template.

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
Thanks

you are right, I fixed this and uploaded 2.5.1

digitxp
digitxp's picture
Offline
Last seen: 11 years 2 months ago
Joined: 2007-11-03 18:33
How does NSIS work?

How does NSIS work?

Insert original signature here with Greasemonkey Script.

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
See here:

http://nsis.sourceforge.net
hier you should find more information about nsis.

NSIS is intended to create installers. IN fact the launcher you could create with this template is kind of "abuse" of NSIS, but works.

digitxp
digitxp's picture
Offline
Last seen: 11 years 2 months ago
Joined: 2007-11-03 18:33
I mean how do you compile

I mean how do you compile it?

Insert original signature here with Greasemonkey Script.

Simeon
Simeon's picture
Offline
Last seen: 8 years 1 month ago
DeveloperTranslator
Joined: 2006-09-25 15:15
Use

Smithtechs NSIS Portable.
You might have to add some plugins though.

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

digitxp
digitxp's picture
Offline
Last seen: 11 years 2 months ago
Joined: 2007-11-03 18:33
Oh, I found an NSIS Portable

Oh, I found an NSIS Portable on Sourceforge

Insert original signature here with Greasemonkey Script.

digitxp
digitxp's picture
Offline
Last seen: 11 years 2 months ago
Joined: 2007-11-03 18:33
And I meant how do you

And I meant how do you compile it as in every time I click compile it says there is a bug

Insert original signature here with Greasemonkey Script.

Simeon
Simeon's picture
Offline
Last seen: 8 years 1 month ago
DeveloperTranslator
Joined: 2006-09-25 15:15
could you post the bug?

maybe youre just missing a plugin...but I know, NSIS errors can be difficult to decipher Smile

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

digitxp
digitxp's picture
Offline
Last seen: 11 years 2 months ago
Joined: 2007-11-03 18:33
The NSIS portable I got from

The NSIS portable I got from sourceforge says it comes with all the plugins.

Insert original signature here with Greasemonkey Script.

Simeon
Simeon's picture
Offline
Last seen: 8 years 1 month ago
DeveloperTranslator
Joined: 2006-09-25 15:15
well...

maybe a plugin got updated and the template too but you still have the old one?
The one I found at Sourceforge is from nov. 07 and since then at least the newadvsplash-Plugin got updated. And if you want to compile the latest PortableApps-installers you have to download the MoreInfo plugin.

So check which plugin gives you the error and update that.

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

Ledanalf
Offline
Last seen: 9 years 8 months ago
Joined: 2006-09-15 20:50
Sorry for that...

I have not had enough time to update it, I'll check the plugins that have new version to add them, and NSIS (I think it's in version 2.34) when I make it I'll post it here.

Rochey
Offline
Last seen: 3 years 5 months ago
Joined: 2007-08-07 15:48
Path Variable Setting

Is there any chance of having a setting at the begining of the script that can add folders to the Path?

It would be handy to be able to add a sub folder, in the App directory, to the Path so that the portable app can get access to it.

Cheers Rochey

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
Hmm

would be possible..
Do you think of relative paths or simply subpaths of the Apps folder?

Rochey
Offline
Last seen: 3 years 5 months ago
Joined: 2007-08-07 15:48
I was thinking of the apps

I was thinking of the apps folder itself and sub folders of the apps folder.

I was trying to make zenmap portable but when the zenmapPortableLauncher launches zenmap.exe in the apps directory, zenmap.exe opens but can't find nmap.exe which is in the same directory. So I am assuming that local directory is where zenmapPortableLauncher is and not the apps directory.

Hope that makes sense.

Rochey

sahak
Offline
Last seen: 14 years 10 months ago
Joined: 2008-01-16 14:00
A request

Hi Klonk,

I posted the following request today and am requesting you seperately to assist me if you can.
QUOTE:

I do not understand anything in apps development and will be very grateful if someone can help me in making a portable version of "LockLizard Safeguard Viewer 2.5.65".

The software version of the software is available at the website: http://www.locklizard.com.

UNQUOTE

Rgds,
Sahak

mstinaff
Offline
Last seen: 12 years 9 months ago
Joined: 2006-10-01 10:58
registry.reg

After some days of reading code and forum posts I have a question and a request.

Scenario: I am trying to use this fantastic template to portablize WinPT. The registry keys are put into registry.reg as such


REGEDIT4

[HKEY_CURRENT_USER\Software\WinPT]
"Extensions"="1"
"nKeys"="0"

[HKEY_CURRENT_USER\Software\WinPT\Keyserver]
"Default"="http://wwwkeys.nl.pgp.net"

[HKEY_CURRENT_USER\Software\GNU]

[HKEY_CURRENT_USER\Software\GNU\GnuPG]
"HomeDir"="E:\\PortableApps\\CommonFiles\\gpg\\Data"
"gpgProgram"="E:\\PortableApps\\CommonFiles\\gpg\\App\\gpg.exe"
"OptFile"="E:\\PortableApps\\CommonFiles\\gpg\\Data\\gpg.conf"

program loads and runs fine, however on exit the registry.reg gets overwritten with.


REGEDIT4

[HKEY_CURRENT_USER\Software\GNU]

[HKEY_CURRENT_USER\Software\GNU\GnuPG]
"HomeDir"="E:\\PortableApps\\CommonFiles\\gpg\\Data"
"gpgProgram"="E:\\PortableApps\\CommonFiles\\gpg\\App\\gpg.exe"
"OptFile"="E:\\PortableApps\\CommonFiles\\gpg\\Data\\gpg.conf"

The GnuPG keys are properly removed from the registry, but the WinPT key is left behind.

Question: Any notion as to what I am doing wrong?

Request: Would it be possible to use variables in the registry.reg so that it may look something more like


[HKEY_CURRENT_USER\Software\GNU\GnuPG]
"HomeDir"="{PORTDRIVE}:\\PortableApps\\CommonFiles\\gpg\\Data"
"gpgProgram"="{PORTDRIVE}:\\PortableApps\\CommonFiles\\gpg\\App\\gpg.exe"
"OptFile"="{PORTDRIVE}:\\PortableApps\\CommonFiles\\gpg\\Data\\gpg.conf"

I would think using WordReplace in the RegFileToStack could take care of the replacing it on the way into the registry, but I have no idea how to have it do the reverse when exiting.

Thank you very very very much.

Key ID: 0xDAE3095F
Fingerprint: 5D98 65D2 1844 21A5 76C1 F0F6 4BE6 D689 DAE3 095F

jeffm
Offline
Last seen: 13 years 7 months ago
Joined: 2007-12-13 01:58
is there

that can shed some light on using this as I get errors when I try it and as I'm just starting to learn, have no idea what some of them mean?

And also, does this create the installer for you? Or is that done by something else?

Wernight
Offline
Last seen: 9 years 1 month ago
Joined: 2008-02-12 22:20
Portable Template

What about making this a portable tool? After all most of us, even those using NSIS, may not keep or keep up to date most of the stuff required by this template.

What I'm suggesting is to create a compressed file with NSIS, UPX, plugins... and the template. People would simply need some editor (VIM, EclipseNSIS) additionally.

That's just a suggestion.

Wernight
Offline
Last seen: 9 years 1 month ago
Joined: 2008-02-12 22:20
Delete registry keys

The registry keys can be save and restored which is very nice but just not that clean. After settings some REGKEYS "HKCR\Foo||HKCU\Software\Classes\Foo" those two keys remained after closing the application. Is there a way in the template to delete them after closing the application, just like the files.

Most applications here don't use the template. Strangely? Anyway my point is: There are not many examples.

ZachHudock
ZachHudock's picture
Offline
Last seen: 4 years 10 months ago
Developer
Joined: 2006-12-06 18:07
The template is unofficial,

The template is unofficial, and major overkill in most cases because it tries to give a small example of each possibility (settings in APPDATA, registry handling, etc.) Your best bet would be to look at the 7-Zip, Sumatra, Notepad++ and Firefox launchers for examples. 7-zip for registry, Firefox for APPDATA, Sumatra for simple moving of files, and Notepad++ for updating the current drive letter in a settings file.

The developer formerly known as ZGitRDun8705

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
Strange

here it works fine.
BTW: Deleting at the end of application is done in Funtion "Cleanreg" quite at the bottom look for "${registry::DeleteKey}"

And yes this template is not official, I created it to have something "universal" that should work for most applications. I had especially in mind that it could be used to make commercial applications portable.
Another goal was to give maximum flexibility but it should still be usable by persons new to NSIS.

Of course there might be always applications that require some very special settings.

I optimized the code so only the really needed stuff is compiled by NSIS and the rest is ignored.

BTW: There is extensive documentation at the end of the file.

Wernight
Offline
Last seen: 9 years 1 month ago
Joined: 2008-02-12 22:20
Still it has many good

Still it has many good features and doesn't slow down much. The coding style is also way cleaner than the spaghetti code of the official releases.

I'm currently changing to remove the extra stuff that I believe is not needed: Copy app files, creation of INI, copy source files, etc. and I split the file in two. The launcher and the settings which are application specific (with some callbacks for advanced stuff possible). I also fix some issues:
- Terminate only after the last process quit.
- Clean registry and faster by renaming registry keys.
- Other stuff.
This way the launcher can be updated (to fix something for example) while keeping the script settings untouched.

I may post it here if people are interested.

Nathan9222
Nathan9222's picture
Offline
Last seen: 1 year 2 months ago
Developer
Joined: 2007-12-06 22:35
question

Where in the script does it delete user defined registry keys. i got most of my program i am scripting portable but the registry wont delete for me, and ive tried a lot of things to get it to work. Any help on this would be appreciated

An eye for an eye makes the whole world blind.
Mahatma Gandhi,
Indian political and spiritual leader (1869 - 1948)

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
Look

at function "cleanreg" quite at the bottom

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
I'm interested

Well in fact, when the code is changed you normally only have to copy the few lines with your config at the beginning of the file.

How do you do terminating after last process quits?
Do you rename registry keys and later rename them back for faster operation?
My intention was that existing registry keys could be used for very first usage.

Stevoisiak
Stevoisiak's picture
Offline
Last seen: 3 years 3 months ago
Joined: 2008-02-05 11:22
PAT vs PAC

Cool! But, which is better, portable app creator, or this. Actually, maybe you two should team up. Also, to make it more portable, is it ok to use both applications on a program I want to make portable?

Edit: Now that I look at it, PAC looks a bit more user friendly.

Simplifying daily life through technology

ZachHudock
ZachHudock's picture
Offline
Last seen: 4 years 10 months ago
Developer
Joined: 2006-12-06 18:07
PAT is simply a template

PAT is simply a template script, PAC attempts to create a portable app, but by the author's own admission, it doesn't really make the app portable, the paths are hard coded, so if you move the app, it will fail. Also, PAC creates the launcher using AutoIt, where PAT is an NSIS script, and NSIS is the "official" language used for PortableApps.com launchers.

The developer formerly known as ZGitRDun8705

Stevoisiak
Stevoisiak's picture
Offline
Last seen: 3 years 3 months ago
Joined: 2008-02-05 11:22
huh?

I dont get what the difference is. Can you explain it a bit more.

Simplifying daily life through technology

ZachHudock
ZachHudock's picture
Offline
Last seen: 4 years 10 months ago
Developer
Joined: 2006-12-06 18:07
PAT is a template. It is

PAT is a template. It is only code, you must replace some values in it to set it up for a specific app.

PAC is an application. It monitors the app that you are attempting to make portable, collects the reg keys and settings dirs that it creates, then automatically puts them into the script for you. It also uses a different scripting language, and the author said it doesn't actually make the app portable anyway.

The developer formerly known as ZGitRDun8705

Stevoisiak
Stevoisiak's picture
Offline
Last seen: 3 years 3 months ago
Joined: 2008-02-05 11:22
Well...

Acrording to a post in OAC, this doesn't allow full portability either.

Simplifying daily life through technology

ZachHudock
ZachHudock's picture
Offline
Last seen: 4 years 10 months ago
Developer
Joined: 2006-12-06 18:07
That would be up to the

That would be up to the user, they must accurately enter the info for which directories and reg keys to clean up. If the user can do that, it will allow full portability. This template does need an update though in order to comply with the latest PAF specifications.

The developer formerly known as ZGitRDun8705

quackstar
Offline
Last seen: 11 years 5 months ago
Joined: 2008-02-19 10:41
will it work w/o access to registry?

ok, on this specific computer i can't access the ragistry at all. regedit dosn't work. saving a .reg fiole and merging it dosn't work. i thingk its a group policy thing, so theirs no way around it. will the program still work?

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
Depends

very much on your application. The template itself will.
But if you r application requires access to the registry then I'm pretty sure you will have problems.
I'll add checking for this into 2.6.

paleozogt
Offline
Last seen: 14 years 6 months ago
Joined: 2008-04-13 01:31
a tiny nit

This template is great. Very helpful. The code is also very readable (as another user commented). Kudos.

I have one tiny nit: the template should have a 'long name' and a 'short name' macros. For example, some apps may have spaces in their official, 'long' name (e.g., "Mozilla Firefox, Portable Edition"), while the exe and folders should probably not have spaces and use a 'short' name (e.g,, "FirefoxPortable").

In the current template (2.5), I got around this by changing the DESCRIPTION macro (line 88) to be the 'long' version and then changing lines 226 and 230 from this

VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APP} Portable"
VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "Allow ${APP} to be run from a removeable drive. This launcher is based on the Portable Application Template created by Klonk (Karl Loncarek)."
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Launcher created by ${AUTHOR}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "by ${AUTHOR}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${APP} Portable"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VER}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "OriginalFilename" "${PNAME}.exe"

to this

VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${DESCRIPTION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "Allow ${APP} to be run from a removeable drive. This launcher is based on the Portable Application Template created by Klonk (Karl Loncarek)."
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Launcher created by ${AUTHOR}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "by ${AUTHOR}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${DESCRIPTION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VER}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "OriginalFilename" "${PNAME}.exe"

e.g., they use "${DESCRIPTION}" rather than "${APP} Portable".

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
In fact it

has to be changed in some more places. I'll add this, but name it LONGAPP. Additionally I'll correct generation of appinfo.ini to be compliant to the lates PAF format draft. Version 2.6 is coming..

Devo
Offline
Last seen: 2 months 2 weeks ago
Joined: 2007-09-04 14:55
I have 2 comments/changes

I have 2 comments/changes that I think would help with PAF compatibility.

1. The registry entries should be saved as ${APP}.reg

2. All the settings should go under ${App}Portable\Data\settings\

I think this is the way all the apps on this site are headed if they aren't already formatted this way. Hopefully you can update this for the next version.

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
OK

I change this. Look out for version 2.6.1...

edit:
after looking into it I do not see the need for creating a settings directory. The only thing that is created is the registr.reg file or now ${APP}.reg file. So I haven't changed that yet.

I'm against creating another directory for only one file! This simply does not make sense. Sure if it were more files, then I'll agree...

Devo
Offline
Last seen: 2 months 2 weeks ago
Joined: 2007-09-04 14:55
The backup function of PAM

The backup function of PAM uses this file structure and most apps are moving towards this, that's the reason I suggested it.

Shawn Faucher
Shawn Faucher's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2007-10-23 22:14
settings

Settings is not in the spec, it is just a convention. John commented on this in his spec post. As long as the reg is beneath Data it will get backed up as PAM backup works on the entire Data directory, not just settings.

formerly rayven01

eresele
Offline
Last seen: 5 years 8 months ago
Joined: 2007-10-28 18:21
Hi, again, Klonk! * First of

Hi, again, Klonk!

* First of all, maybe you should mention that the current release of APT is 2.6.1, in the history section of this topic (and the ApplicationPortableTemplate.nsi itself) to make it easier to be spotted by visitors to this topic at a first glance, w/o having to read the responses. I myself found it out from the "version 2.6.1 - 2008/05/06" stamp in the template.

* Another issue I've noticed is that, when compiling the template w/ NSIS, it complains about "unknown variable/constant "{COMMERCIALUSE}" detected, ignoring", which might be a remnant of the past, or not yet included idea? After launching the ${APP}Portable, the appinfo.ini file will contain an entry "CommercialUse=${COMMERCIALUSE}". Is that intended behaviour?

* JFYI, in the appinfo.ini file it says also says "Type=PortableApps.comFormat". Is this the intended formating, or is there a space missing in front of Format?

* JFYI, I also get a warning about "label "LaunchEXE" not used".

* Finally, I've noticed that (in the case having commented out INSTALLSOURCES) the "Current Working Directory" (CWD) of the application seems to be App/DefaultData !? If on the other hand leave it at it's default (uncommented), then the CWD is Other/${App}PortableSource. This can't be the intended behaviour, can it? I'd expect the CWD to be the directory of the launcher, USERPROFILE, etc. NOT DefaultData, ${App}PortableSource, etc. You can easily verify this by putting a batch file in App/${App}/${App}Test.bat displaying the directory content, and launch it from your launcher.

Maybe I'm just missing something essential here?

BTW, compiling w/ NSIS v2.33 on Windows XP sp2

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
Thanks

#1 I can do that, yes.
#2 seems like i deleted the COMMERCIALUSE in the header accidently, added it again
#3 INtended thsi way, found it the same way in other appinfo.ini files. If I'm worng, please tell me and I'll correct it.
#4 moved LaunchEXE one line up, error message should be away now
#5 Well in fact the current working directory is not set at all (nowhere in the nsi source). OK found it is done by setoutPatch. OK, the CWD is the applications directory.

Version 2.6.2 released.

ledoctom
Offline
Last seen: 13 years 3 months ago
Joined: 2008-04-21 04:46
problem

Hello,

I got this problem with the last version

Function: "Init"
Invalid command: ${registry::CreateKey}
Error in script "D:\Portabilizer\portabilization\GnumericPortable.nsi" on line 524 -- aborting creation process

You can help me or should I post all the compilator log ?

Thank you

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
Have

you installed the registry plugin??

Nathan9222
Nathan9222's picture
Offline
Last seen: 1 year 2 months ago
Developer
Joined: 2007-12-06 22:35
Since you are using

Since you are using ${registry::CreateKey}, then make sure to include the registry.nsh in your script and the actual file in that same directory as GnumericPortable.nsi.

So in the beginning of the script plug this in,

!include "Registry.nsh"

Without that in your script, you will always get that error message, if you still cant get it then you will have to revert to the normal way of dealing with the registry. You can find the "Registry.nsh" in the "Nsis\Include" folder.

An eye for an eye makes the whole world blind.
Mahatma Gandhi,
Indian political and spiritual leader (1869 - 1948)

Stevoisiak
Stevoisiak's picture
Offline
Last seen: 3 years 3 months ago
Joined: 2008-02-05 11:22
How to?

How do I use this?

Simplifying daily life through technology

BrianAll
Offline
Last seen: 4 years 5 months ago
Joined: 2008-02-13 13:44
It's

an .nsi (NSIS) script that basically tells you what to put where, to get the launcher to work properly. Set it up in a PAF directory like all the other offical apps, and compile it with NSIS once you have put everything in for the app you want to make portable. This template simplifies the portabilzation process, so you only put in a few variables at the beginning. It also explains what to put in the variables.
Try NSIS Portable, in development testing, to use with this.

ledoctom
Offline
Last seen: 13 years 3 months ago
Joined: 2008-04-21 04:46
Problem with the script (again)

Hello, (again)

I got this problem with the last version

Function: "Init"
Invalid command: ${registry::CreateKey}
Error in script "D:\Portabilizer\portabilization\GnumericPortable.nsi" on line 524 -- aborting creation process

You can help me or should I post all the compilator log ?

I forgot to precise that it's happening whatever is the Application : Gnumeric, ImageJ, Inkscape 0.46....

I have full administrator rights.

Do I miss a plugin or ?

Thank you

digitxp
digitxp's picture
Offline
Last seen: 11 years 2 months ago
Joined: 2007-11-03 18:33
I think you need

the registry plugin...

Insert original signature here with Greasemonkey Script.

ledoctom
Offline
Last seen: 13 years 3 months ago
Joined: 2008-04-21 04:46
Eh no it's present, but

Edit : Ok in fact it was the registry.nsh that was not correct. But now after compilation, the program says that I have no right to access registry. But without NSIS compilation, gnumeric is portable natively, since I can use it without installing. So why now i need access to the registry ? Before i didn't !

digitxp
digitxp's picture
Offline
Last seen: 11 years 2 months ago
Joined: 2007-11-03 18:33
Hm...

I think that gnumeric is 'just works' and not 'portable'.
Did you try regshot?

Insert original signature here with Greasemonkey Script.

ledoctom
Offline
Last seen: 13 years 3 months ago
Joined: 2008-04-21 04:46
Edit : Report

Here is the regshot report :

Regshot 1.8.2
Comments:
Datetime:2008/6/6 13:16:13  ,  2008/6/6 13:17:15
Computer:XXXX-SCION01 , XXXX-SCION01
Username:xxxxxxxxx , xxxxxxxxx

----------------------------------
Values added:1
----------------------------------
HKU\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{75048700-EF1F-11D0-9888-006097DEACF9}\Count\HRZR_EHACNGU:G:\GQ\Cbegnovyvmre\cbegnovyvmngvba\tahzrevp\1.9.1\ova\tahzrevp.rkr: 2A 00 00 00 06 00 00 00 80 B8 C4 84 D7 C7 C8 01

----------------------------------
Values modified:17
----------------------------------
HKLM\SOFTWARE\Microsoft\Cryptography\RNG\Seed: 00 77 8B CF 6E B0 DD 08 ED D6 B0 BA 82 09 EF 12 B9 A1 13 FD 82 C6 4D 3B CA 9D 92 B5 00 25 CD B2 3C 4E 57 AA EE B8 FA 14 12 77 89 8B 68 8B C8 AD 0E B5 C9 B9 C3 8A 77 DA 21 35 F1 4F 19 25 9B B5 1B FD A2 A5 C6 F2 FD 06 1F 55 74 19 47 E2 92 B3
HKLM\SOFTWARE\Microsoft\Cryptography\RNG\Seed: 43 CA 28 DF 35 82 DB C9 FF A2 4C 0E 3A 30 E4 49 8D 31 64 13 7E B2 C4 86 50 B6 76 C9 29 28 51 18 B1 10 31 C3 D9 1F 2A 5E 42 BD 29 7A EC E9 6D DD 31 F8 51 58 C1 00 B5 12 70 2F 69 63 A9 D6 08 C4 CF 0E F0 94 6A 95 FE 8A CA 97 00 35 B5 BE EC A4
HKLM\SOFTWARE\Network Associates\TVD\Shared Components\On Access Scanner\McShield\szLastScanned: "C:\Documents and Settings\xxxxxxxxx\Local Settings\Temporary Internet Files\Content.IE5\desktop.ini"
HKLM\SOFTWARE\Network Associates\TVD\Shared Components\On Access Scanner\McShield\szLastScanned: "C:\Documents and Settings\xxxxxxxxx\.recently-used.xbel.V6UZBU"
HKLM\SOFTWARE\Network Associates\TVD\Shared Components\On Access Scanner\McShield\dwFilesScanned: 0x00001F1E
HKLM\SOFTWARE\Network Associates\TVD\Shared Components\On Access Scanner\McShield\dwFilesScanned: 0x00001F3F
HKLM\SOFTWARE\Network Associates\TVD\Shared Components\On Access Scanner\McShield\dwLastModified: 0x0003D8C0
HKLM\SOFTWARE\Network Associates\TVD\Shared Components\On Access Scanner\McShield\dwLastModified: 0x0003D8C3
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\gnumeric\plugins\active: "Gnumeric_xbase
Gnumeric_sylk
Gnumeric_sc
Gnumeric_QPro
Gnumeric_psiconv
Gnumeric_plan_perfect
Gnumeric_paradox
Gnumeric_OpenCalc
Gnumeric_oleo
Gnumeric_numtheory
Gnumeric_mps
Gnumeric_lotus
Gnumeric_html
Gnumeric_GnomeDB
Gnumeric_gdaif
Gnumeric_fnstring
Gnumeric_fnstat
Gnumeric_fnrandom
Gnumeric_r
Gnumeric_fnmath
Gnumeric_fnlookup
Gnumeric_fnlogical
Gnumeric_fninfo
Gnumeric_fnfinancial
Gnumeric_fnerlang
Gnumeric_fneng
Gnumeric_fndate
Gnumeric_fndatabase
Gnumeric_fncomplex
Gnumeric_Excel
Gnumeric_dif
Gnumeric_derivatives
Gnumeric_applix
GOffice_smoothing
GOffice_reg_logfit
GOffice_reg_linear
GOffice_plot_xy
GOffice_plot_surface
GOffice_plot_radar
GOffice_plot_pie
GOffice_plot_boxes
GOffice_plot_barcol"
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\gnumeric\plugins\active: ""
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\M\_DriveFlags\Version: 0x0000000A
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\M\_DriveFlags\Version: 0x0000000D
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\M\_DriveFlags\LastUpdate: 0x050F2715
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\M\_DriveFlags\LastUpdate: 0x050FD7C7
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\M\_GFA\Version: 0x0000001C
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\M\_GFA\Version: 0x0000001F
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\M\_GFA\LastUpdate: 0x050F2715
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\M\_GFA\LastUpdate: 0x050FC539
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\N\_DriveFlags\Version: 0x0000000A
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\N\_DriveFlags\Version: 0x0000000D
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\N\_DriveFlags\LastUpdate: 0x050F2724
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\N\_DriveFlags\LastUpdate: 0x050FD7D7
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\N\_GFA\Version: 0x0000001C
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\N\_GFA\Version: 0x0000001F
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\N\_GFA\LastUpdate: 0x050F2715
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\N\_GFA\LastUpdate: 0x050FC539
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\StreamMRU\MRUListEx: 9A 00 00 00 9E 00 00 00 AF 00 00 00 AD 00 00 00 B0 00 00 00 A8 00 00 00 AA 00 00 00 86 00 00 00 04 00 00 00 A6 00 00 00 3C 00 00 00 45 00 00 00 41 00 00 00 92 00 00 00 A2 00 00 00 A9 00 00 00 9C 00 00 00 4F 00 00 00 A7 00 00 00 31 00 00 00 9B 00 00 00 00 00 00 00 A0 00 00 00 9D 00 00 00 A5 00 00 00 A3 00 00 00 A1 00 00 00 87 00 00 00 C0 00 00 00 95 00 00 00 0E 00 00 00 A4 00 00 00 AB 00 00 00 99 00 00 00 15 00 00 00 27 00 00 00 62 00 00 00 65 00 00 00 67 00 00 00 63 00 00 00 66 00 00 00 97 00 00 00 23 00 00 00 90 00 00 00 39 00 00 00 96 00 00 00 5A 00 00 00 B9 00 00 00 93 00 00 00 3F 00 00 00 05 00 00 00 34 00 00 00 0B 00 00 00 10 00 00 00 16 00 00 00 80 00 00 00 3D 00 00 00 98 00 00 00 91 00 00 00 5F 00 00 00 94 00 00 00 8C 00 00 00 8E 00 00 00 51 00 00 00 8B 00 00 00 8F 00 00 00 88 00 00 00 33 00 00 00 6B 00 00 00 8D 00 00 00 8A 00 00 00 1E 00 00 00 84 00 00 00 82 00 00 00 6F 00 00 00 83 00 00 00 6A 00 00 00 0F 00 00 00 2E 00 00 00 73 00 00 00 6D 00 00 00 85 00 00 00 89 00 00 00 70 00 00 00 75 00 00 00 81 00 00 00 57 00 00 00 03 00 00 00 7D 00 00 00 47 00 00 00 68 00 00 00 56 00 00 00 6C 00 00 00 B3 00 00 00 78 00 00 00 9F 00 00 00 7B 00 00 00 5B 00 00 00 4C 00 00 00 22 00 00 00 6E 00 00 00 76 00 00 00 74 00 00 00 7C 00 00 00 7A 00 00 00 72 00 00 00 77 00 00 00 5E 00 00 00 79 00 00 00 49 00 00 00 61 00 00 00 48 00 00 00 69 00 00 00 2A 00 00 00 60 00 00 00 55 00 00 00 4D 00 00 00 58 00 00 00 5D 00 00 00 24 00 00 00 59 00 00 00 11 00 00 00 25 00 00 00 30 00 00 00 50 00 00 00 38 00 00 00 53 00 00 00 43 00 00 00 C2 00 00 00 54 00 00 00 12 00 00 00 26 00 00 00 4E 00 00 00 4A 00 00 00 52 00 00 00 18 00 00 00 44 00 00 00 19 00 00 00 2F 00 00 00 20 00 00 00 32 00 00 00 3E 00 00 00 40 00 00 00 37 00 00 00 36 00 00 00 28 00 00 00 2D 00 00 00 2B 00 00 00 1B 00 00 00 29 00 00 00 C3 00 00 00 1C 00 00 00 21 00 00 00 64 00 00 00 1F 00 00 00 7F 00 00 00 7E 00 00 00 71 00 00 00 02 00 00 00 1A 00 00 00 5C 00 00 00 C7 00 00 00 B1 00 00 00 1D 00 00 00 0D 00 00 00 BD 00 00 00 14 00 00 00 13 00 00 00 09 00 00 00 BF 00 00 00 0C 00 00 00 2C 00 00 00 06 00 00 00 42 00 00 00 0A 00 00 00 07 00 00 00 B5 00 00 00 08 00 00 00 C1 00 00 00 01 00 00 00 B6 00 00 00 46 00 00 00 35 00 00 00 17 00 00 00 B4 00 00 00 BB 00 00 00 C5 00 00 00 C4 00 00 00 C6 00 00 00 BE 00 00 00 BA 00 00 00 4B 00 00 00 BC 00 00 00 B2 00 00 00 3A 00 00 00 B7 00 00 00 B8 00 00 00 3B 00 00 00 AC 00 00 00 AE 00 00 00 FF FF FF FF
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\StreamMRU\MRUListEx: 9A 00 00 00 AD 00 00 00 AE 00 00 00 9E 00 00 00 AF 00 00 00 B0 00 00 00 A8 00 00 00 AA 00 00 00 86 00 00 00 04 00 00 00 A6 00 00 00 3C 00 00 00 45 00 00 00 41 00 00 00 92 00 00 00 A2 00 00 00 A9 00 00 00 9C 00 00 00 4F 00 00 00 A7 00 00 00 31 00 00 00 9B 00 00 00 00 00 00 00 A0 00 00 00 9D 00 00 00 A5 00 00 00 A3 00 00 00 A1 00 00 00 87 00 00 00 C0 00 00 00 95 00 00 00 0E 00 00 00 A4 00 00 00 AB 00 00 00 99 00 00 00 15 00 00 00 27 00 00 00 62 00 00 00 65 00 00 00 67 00 00 00 63 00 00 00 66 00 00 00 97 00 00 00 23 00 00 00 90 00 00 00 39 00 00 00 96 00 00 00 5A 00 00 00 B9 00 00 00 93 00 00 00 3F 00 00 00 05 00 00 00 34 00 00 00 0B 00 00 00 10 00 00 00 16 00 00 00 80 00 00 00 3D 00 00 00 98 00 00 00 91 00 00 00 5F 00 00 00 94 00 00 00 8C 00 00 00 8E 00 00 00 51 00 00 00 8B 00 00 00 8F 00 00 00 88 00 00 00 33 00 00 00 6B 00 00 00 8D 00 00 00 8A 00 00 00 1E 00 00 00 84 00 00 00 82 00 00 00 6F 00 00 00 83 00 00 00 6A 00 00 00 0F 00 00 00 2E 00 00 00 73 00 00 00 6D 00 00 00 85 00 00 00 89 00 00 00 70 00 00 00 75 00 00 00 81 00 00 00 57 00 00 00 03 00 00 00 7D 00 00 00 47 00 00 00 68 00 00 00 56 00 00 00 6C 00 00 00 B3 00 00 00 78 00 00 00 9F 00 00 00 7B 00 00 00 5B 00 00 00 4C 00 00 00 22 00 00 00 6E 00 00 00 76 00 00 00 74 00 00 00 7C 00 00 00 7A 00 00 00 72 00 00 00 77 00 00 00 5E 00 00 00 79 00 00 00 49 00 00 00 61 00 00 00 48 00 00 00 69 00 00 00 2A 00 00 00 60 00 00 00 55 00 00 00 4D 00 00 00 58 00 00 00 5D 00 00 00 24 00 00 00 59 00 00 00 11 00 00 00 25 00 00 00 30 00 00 00 50 00 00 00 38 00 00 00 53 00 00 00 43 00 00 00 C2 00 00 00 54 00 00 00 12 00 00 00 26 00 00 00 4E 00 00 00 4A 00 00 00 52 00 00 00 18 00 00 00 44 00 00 00 19 00 00 00 2F 00 00 00 20 00 00 00 32 00 00 00 3E 00 00 00 40 00 00 00 37 00 00 00 36 00 00 00 28 00 00 00 2D 00 00 00 2B 00 00 00 1B 00 00 00 29 00 00 00 C3 00 00 00 1C 00 00 00 21 00 00 00 64 00 00 00 1F 00 00 00 7F 00 00 00 7E 00 00 00 71 00 00 00 02 00 00 00 1A 00 00 00 5C 00 00 00 C7 00 00 00 B1 00 00 00 1D 00 00 00 0D 00 00 00 BD 00 00 00 14 00 00 00 13 00 00 00 09 00 00 00 BF 00 00 00 0C 00 00 00 2C 00 00 00 06 00 00 00 42 00 00 00 0A 00 00 00 07 00 00 00 B5 00 00 00 08 00 00 00 C1 00 00 00 01 00 00 00 B6 00 00 00 46 00 00 00 35 00 00 00 17 00 00 00 B4 00 00 00 BB 00 00 00 C5 00 00 00 C4 00 00 00 C6 00 00 00 BE 00 00 00 BA 00 00 00 4B 00 00 00 BC 00 00 00 B2 00 00 00 3A 00 00 00 B7 00 00 00 B8 00 00 00 3B 00 00 00 AC 00 00 00 FF FF FF FF
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\StreamMRU\174: 14 00 1F 50 E0 4F D0 20 EA 3A 69 10 A2 D8 08 00 2B 30 30 9D 19 00 23 45 3A 5C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 89 92 13 00 31 00 00 00 00 00 55 36 13 36 10 00 7A 69 63 00 00 29 00 31 00 00 00 00 00 79 37 04 6E 11 00 42 6F 62 62 79 20 46 75 6C 6C 65 72 20 46 6F 75 72 00 42 4F 42 42 59 46 7E 31 00 00 00
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\StreamMRU\174: 14 00 1F 50 E0 4F D0 20 EA 3A 69 10 A2 D8 08 00 2B 30 30 9D 19 00 23 54 3A 5C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ED F7 12 00 31 00 00 00 00 00 BC 38 7B 44 10 00 54 44 00 00 24 00 31 00 00 00 00 00 C5 38 C8 4E 10 00 50 6F 72 74 61 62 69 6C 69 7A 65 72 00 50 4F 52 54 41 42 7E 32 00 31 00 31 00 00 00 00 00 C6 38 59 45 10 00 72 65 67 73 68 6F 74 5F 31 2E 38 2E 32 5F 73 72 63 5F 62 69 6E 00 52 45 47 53 48 4F 7E 31 2E 32 5F 53 00 00 00
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\174\CabView: 5C 00 00 00 02 00 00 00 03 00 00 00 00 83 FF FF 00 83 FF FF FF FF FF FF FF FF FF FF AC 00 00 00 E3 00 00 00 87 03 00 00 3C 03 00 00 01 00 00 00 00 00 00 00 A8 2D 09 00 00 00 00 00 D6 D0 50 71 07 00 00 00 E0 D0 57 00 73 35 CF 11 AE 69 08 00 2B 2E 12 62 01 00 00 00 00 00 00 00
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\174\CabView: 5C 00 00 00 02 00 00 00 03 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 05 01 00 00 1D 00 00 00 E0 03 00 00 76 02 00 00 01 00 00 00 00 00 00 00 68 2D 09 00 00 00 00 00 D6 D0 50 71 07 00 00 00 E0 D0 57 00 73 35 CF 11 AE 69 08 00 2B 2E 12 62 01 00 00 00 00 00 00 00
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{75048700-EF1F-11D0-9888-006097DEACF9}\Count\HRZR_EHACNGU: 2A 00 00 00 86 13 00 00 E0 54 9F 4E D7 C7 C8 01
HKU\S-1-5-21-2275805115-2598138170-2549685903-1121\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{75048700-EF1F-11D0-9888-006097DEACF9}\Count\HRZR_EHACNGU: 2A 00 00 00 87 13 00 00 80 B8 C4 84 D7 C7 C8 01

----------------------------------
Files [attributes?] modified:2
----------------------------------
C:\WINNT\system32\config\software
C:\WINNT\system32\config\software.LOG

----------------------------------
Total changes:20
----------------------------------

Thanks for your help

ledoctom
Offline
Last seen: 13 years 3 months ago
Joined: 2008-04-21 04:46
I have to precise that i did

I have to precise that i did that with regshot, 2nd shot performed after first launch of Gnumeric.

But practically and in details when I have regshot report, what information should i use and copy into the template ?

Thanks

CrendKing
Offline
Last seen: 13 years 6 months ago
Joined: 2007-08-14 05:36
Registry saving problem

I really love this template, but I think I encounter some problem about registry saving about this PAT. This is my post: https://portableapps.com/node/14595 . Hope anyone here can give me an solution. Thank you very much!

CrendKing
Offline
Last seen: 13 years 6 months ago
Joined: 2007-08-14 05:36
I think I worked it out!

In line 895:

StrCmp "$R7" 0 +3 ; an error occures when saving registry key

the jump destination is the next third line after the current line, where it is

; Sleep 50

which is a comment. It seems NSIS runs incorrectly for this code snippet, and only the first defined registry key is processed.

I fix this problem referring to the InitReg function, that is, add a CleanRegNoError label before the weird commented sleep, and let the StrCmp jump to the label.

Hope Klonk can notice my post and release a new bug-fix version.

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
Thanks

uploaded corrected version 2.6.3.

Devilrider
Offline
Last seen: 14 years 4 months ago
Joined: 2008-07-22 07:37
missing ":" for label Line

missing ":" for label
Line 897 must be:

CleanRegNoError:
; Sleep 50

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
Uuups

sorry fixed. (But I haven't increased the version number for that)

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 4 hours 22 min ago
DeveloperModerator
Joined: 2008-07-24 18:46
Helper Apps?

In the OP Klonk mentions:

"(There are several helper apps for that task)"

I am able to monitor file/folder generation easy enough, but are there any suggestions as to a helper app for registery key generation?

r.andom
r.andom's picture
Offline
Last seen: 14 years 3 months ago
Joined: 2007-11-12 15:11
Regshot

You may take a look at Regshot Portable (still in development) for that task.

And welcome to PortableApps.com! Smile

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
Total uninstall

the last free version might also be worth a look.

CrendKing
Offline
Last seen: 13 years 6 months ago
Joined: 2007-08-14 05:36
Sandboxie

Use Sandboxie (http://www.sandboxie.com) to install the application in sandbox. Then use Windows Registry Recovery (http://www.mitec.cz/wrr.html) to open the RegHive file. In Raw Data section, you can see all the registries the application accessed. I believe you can distinguish with is the application's keys.

BTW, you can also see the created files in the sandbox. I highly recommend you this solution.

seba
Offline
Last seen: 12 years 2 months ago
Joined: 2008-02-02 09:58
Two Bugs found

Bug1:
There is a bug in the script. When the user starts to copy app files from hdd to usb and then in the browse dialog changes its mind and clicks cancel launcher starts copying files from random location.

In the template lines

546: Dialogs::Folder "Select installation folder of ${APP} " 'Select the main folder where you installed "${APP}" on your harddrive:' "$PROGRAMFILES" "${VAR_R0}"
547: CopyFiles "$R0\*.*" "$PROGRAMDIR" ; copy files from harddrive to mobile drive

should be:

546: Dialogs::Folder "Select installation folder of ${APP} " 'Select the main folder where you installed "${APP}" on your harddrive:' "$PROGRAMFILES" "${VAR_R0}"
547: StrCmp $R0 "" 0 +3
548: ${registry::Unload}
549: Abort ; no folder was selected
550: CopyFiles "$R0\*.*" "$PROGRAMDIR" ; copy files from harddrive to mobile drive

And if I may make a suggestion, I'd like it if template can be made to work from
path\to\folder\Other\$APPPortableSources\
folder. What I mean is that when I compile it in that folder it would produce launcher in path\to\folder\ directory.
And I must say Thanks for this great script.

Bug2:
Also I found one more bug. When you test for write access to the registry you do it in the HKLM hive and that is needed only if you need admin (or poweruser) rights, I think you don't need to test it if app doesn't need admin rights. if my launcher (or app) don't need write access in HKLM I can't start app becose launcher aborts.

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
Well the first one wasn't really a bug

but you're right there should be some checking, thus I added your suggestion to version 2.6.4.

regarding your suggestion to have the compiled thing some dirs higher:
maybe the following would work:
!cd "..\..\"

I haven't found a compiler command where you can define where the compiled file should be written.

Bug2: have you defined a registry key or that a maxybe existing registry file should be used? If yes, than it's the normal behaviour. If both is disabled, no registry checking occurs at all.

seba
Offline
Last seen: 12 years 2 months ago
Joined: 2008-02-02 09:58
Bug2

Yes, I did define a registry key in REGKEYS, but it was in the HKCU where every user has write access. That check aborted launcher because it was checking in the HKLM where may app doesn't need to write anything, when I comment out that part launcher and app works ok.

About the output file, the only way to change output dir is to prepend path to the outfile in the OutFile command. I thought you could make it an option where to output compiled launcher, or even better if script can detect that it is in the right location (by paf spec) and it outputs launcher to the right place. I know I'm asking to much :).
btw. (why do) you define OutFile in two locations in the template.

XSLord
Offline
Last seen: 4 months 2 days ago
Joined: 2006-03-07 15:54
.reg file

I'm just starting to play around with this template, and need some help:

i've got a registry file called testapp.reg, and have placed it in the following dir:

TestApp\Data

; If a file e.g."TestApp.reg" within the data directory is found then it is read
; and all child registry keys are processed as if they'd have been set within
; REGKEYS
!define USEREGKEYSFILE "TRUE"

The nsi file is being compiled without problems, but i launch the portableapp the reg file is not being processed, any ideas.

Thanx in advance for your help!

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
How does

the regfile look like?

Do the lines have +[HLKM..... (The Plus is important)?
Can you add the registry keys manually by double clicking on the .reg file?
In that case do they appear in the registry??

eresele
Offline
Last seen: 5 years 8 months ago
Joined: 2007-10-28 18:21
BUG: several

BUG: several "{registry::unload}" instances lack the '$' sign in front of them and thus make the template PAT 2.6.4 fail to compile.

BUG: On line 553; the "Abort;" statement should either have the ';' removed, or be separated from Abort by a space.

eresele
Offline
Last seen: 5 years 8 months ago
Joined: 2007-10-28 18:21
BUG: Commenting out

BUG: Commenting out USEREGKEYSFILE [as mentioned in the README section of the template], OR clearing, makes the compilation fail with the following message [after fixing BUG mentioned in my last post]:

Invalid command: ${registry::Unload}
Error in script "E:\PortableApps\TestPAT-2.6.4-Portable\ApplicationPortableTemplate.nsi" on line 438 -- aborting creation process

geiseri
Offline
Last seen: 14 years 3 months ago
Joined: 2008-08-23 17:37
I am seeing this error too

Is this because I have a wrong version of the registry plugin installed?

JoeR
Offline
Last seen: 12 years 4 months ago
Joined: 2008-08-22 09:55
BUG: Commenting out USEREGKEYSFILE

When you comment out the USEREGKEYSFILE or REGKEYS, the registry.nsh at line 174 doesn't get loaded.

Comment out the surrounding 'if' test to include the registry support file.

Nice script tool! Lets keep working on it!
Joe

eresele
Offline
Last seen: 5 years 8 months ago
Joined: 2007-10-28 18:21
Please Help: How do I

Please Help: How do I configure the Portable Application Template 2.6.x for an application that has/needs multiple executables/launchers? E.g. for a file structure similar to this:

PortableApps/
             AppNamePortable/
                            App/
                               AppName/
                                      appname1.exe
                                      appname2.exe
                                      ...
                                      appnameN.exe
                            Data/

                            # generating a result similar to:

                            AppName1Portable.exe (launcher 1)
                            AppName2Portable.exe (launcher 2)
                            AppNameNPortable.exe (launcher n)

                            Other/
                                  AppName1PortableSource/
                                                         AppName1Portable.nsi
                                                         AppName1Portable.ico
                                  AppName2PortableSource/
                                                         AppName2Portable.nsi
                                                         AppName2Portable.ico
                                  ...
                                  AppNameNPortableSource/
                                                         AppNameNPortable.nsi
                                                         AppNameNPortable.ico


BTW, and how are/should App/appinfo.ini and App/appicon.ico be handled in this case?

TIA

CrendKing
Offline
Last seen: 13 years 6 months ago
Joined: 2007-08-14 05:36
A new feature

Hi everyone, I added a new feature to this template. I don't know how to make it capable of using extra path before the program execution. Since I didn't find any option in the header, I added one. If you find it useful, can you please add this feature in the new versions?

There are 3 places to add code:
Insert in line 59:

; define extra path before execution, separated by ". e.g. "$EXEDIR\Data" will append the "Data" directory of the portable to the "PATH" environment variable.
	!define EXTRAPATH			""

Comment this line or leave blank will disable this feature, just as USEJAVAV feature.

Insert in line 155:

!ifdef EXTRAPATH
	!if ! "${EXTRAPATH}" = "" ; only do stuff if constant is not empty
		!define USEEXTRAPATH
	!endif
!endif

This mimics the USEJAVAVERSION code.

Insert in line 629:

!ifdef USEEXTRAPATH
	ReadEnvStr $R0 "PATH"
	StrCpy $R0 "$R0;${EXTRAPATH}" ; append extra path
	System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("PATH", R0).r0' ; set new path
!endif

Mimic again. Append ${EXTRAPATH} to the current %PATH% variable.

BTW, please fix the bugs eresele mentioned.

geiseri
Offline
Last seen: 14 years 3 months ago
Joined: 2008-08-23 17:37
Port-O-Matic

Hi, I am working on a little utility that wraps the template. It is at: http://trac.geiseri.com/wiki/PortoMatic. Its pretty rough still, but I have a preview of the installer on the site. I have to ask people to test the template out, since I cannot get it to run reliably here. I am going to assume operator error until someone else can tell me otherwise though. Good luck.

XSLord
Offline
Last seen: 4 months 2 days ago
Joined: 2006-03-07 15:54
Fantastic!!! Looks absolutely

Fantastic!!!

Looks absolutely promising

CrendKing
Offline
Last seen: 13 years 6 months ago
Joined: 2007-08-14 05:36
Set up an active project

I tried your program. Fine user interface, but it's not working at my computer (it always reports Check to make sure you have write access to the destination directory). And it always prompt me a I think splash image, though I don't need one. I think it has much space to improve, especially for flexibility.

Seems this thread is pretty inactive. So I just think, can someone set up an active project in SourceForge or Google Code for the development of this template, or if geiseri likes, bundle the Port-O-Matic with the project. This can make the template evolve quickly and healthy.

App Guy
Offline
Last seen: 9 years 1 month ago
Joined: 2008-03-16 14:24
Is it possible

...to make a video on how to use this program. I've tried this but I've no idea what to do.

May the Shwartz be with you

silentcon
silentcon's picture
Offline
Last seen: 10 years 7 months ago
Joined: 2008-05-31 05:37
That is a great idea!

That is a good idea so that novices might actually know a little bit and know how to use the program.

xxzab
Offline
Last seen: 14 years 1 week ago
Joined: 2008-09-19 10:27
Question

I have a app that is just a single EXE file (and already portable) would I use this to get it to show up in the portalbeapps.com launcher menu?

eresele
Offline
Last seen: 5 years 8 months ago
Joined: 2007-10-28 18:21
Yes you can, but it's

Yes you can, but it's sufficient to place your exe directly in a directory, e.g. '\PortableApps\YourAppsDirectoryPortable', in the PortableApps file hierarchy.

kingtone
Offline
Last seen: 1 year 10 months ago
Joined: 2007-02-14 18:15
HKCU and Vista

I have an app that stores lots of details in HKCU. If I create the launcher to run with !define ADMINREQUIRED "FALSE", it asks for set up and everything works. On shutdown, the {APP}.Reg gets created as it should. Seems fine. Problem is, when I run it again, it is as if the app never got set up. Like the reg file is not getting applied like it should.
Now, if I change to force the app to run as administrator with !define ADMINREQUIRED "TRUE", everything works as it should and the reg file gets applied correctly.
I want to try and fix this because there are machines that I might not have admin privs on. And this is HKCU so it should be ok with out admin.
Any ideas?

kingtone
Offline
Last seen: 1 year 10 months ago
Joined: 2007-02-14 18:15
I actually figured this out a

I actually figured this out a while back. Thought it would be good to share.

Change line 679 from:
ExecWait 'regedit /s "$DATADIR\${APP}.reg"'

to:
nsExec::ExecToStack '"$WINDIR\system32\reg.exe" import "$DATADIR\${APP}.reg"'

Change line 920 from:
ExecWait 'regedit /s "$DATADIR\${APP}Backup.reg"'

to:
nsExec::ExecToStack '"$WINDIR\system32\reg.exe" import "$DATADIR\${APP}Backup.reg"'

Klonk
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-21 03:08
Thanks

I changed this according to your suggestions in 2.6.5.

Sorry for my late reply but currently I'm on the road heavily (from job)...

JoeR
Offline
Last seen: 12 years 4 months ago
Joined: 2008-08-22 09:55
Enhancements?

Hi all,
I finally got a fellow who knows how to test portable apps helping. His comments pointed out a couple of things.

1. PAT creates Data\ and AppInfo\ under the ..\ProgramDir. My 'ProgramDir' is like this:
App/FreePCB/bin
so I have App/AppInfo, then also the code creates App/FreePCB/DefaultData, and App/FreePCB/Appinfo, i.e. same level as /bin.

I suggest adding a variable like "TOPDIR", or "APPDIR", which is the point at which the template would add folders. Or does NSIS have a basedir already? I bet it does, we just need to change the default folder creation point and remove PROGRAMDIR from that part of the code.

2. The Adv Splash dll is not being cleaned up.

3. Install source puts 4 files in the App/ root. Is this the correct way?
I don't see why it 4 of the files from the Other/Source folder anyway.

I will attempt to fix these items.

Thanks,
Joe

Pages

Topic locked