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.
Your template works perfect! Very cool! Thanks alot!
quicky
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.
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.
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.
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
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.
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.
you are right, I fixed this and uploaded 2.5.1
How does NSIS work?
Insert original signature here with Greasemonkey Script.
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.
I mean how do you compile it?
Insert original signature here with Greasemonkey Script.
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
Oh, I found an NSIS Portable on Sourceforge
Insert original signature here with Greasemonkey Script.
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.
maybe youre just missing a plugin...but I know, NSIS errors can be difficult to decipher
"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate
The NSIS portable I got from sourceforge says it comes with all the plugins.
Insert original signature here with Greasemonkey Script.
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
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.
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
would be possible..
Do you think of relative paths or simply subpaths of the Apps folder?
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
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
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
program loads and runs fine, however on exit the registry.reg gets overwritten with.
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
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
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?
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.
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.
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
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.
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.
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)
at function "cleanreg" quite at the bottom
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.
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
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
I dont get what the difference is. Can you explain it a bit more.
Simplifying daily life through technology
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
Acrording to a post in OAC, this doesn't allow full portability either.
Simplifying daily life through technology
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
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?
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.
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
to this
e.g., they use "${DESCRIPTION}" rather than "${APP} Portable".
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..
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.
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...
The backup function of PAM uses this file structure and most apps are moving towards this, that's the reason I suggested it.
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
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
#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.
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
you installed the registry plugin??
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,
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)
How do I use this?
Simplifying daily life through technology
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.
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
the registry plugin...
Insert original signature here with Greasemonkey Script.
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 !
I think that gnumeric is 'just works' and not 'portable'.
Did you try regshot?
Insert original signature here with Greasemonkey Script.
Here is the regshot report :
Thanks for your help
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
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!
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.
uploaded corrected version 2.6.3.
missing ":" for label
Line 897 must be:
CleanRegNoError:
; Sleep 50
sorry fixed. (But I haven't increased the version number for that)
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?
You may take a look at Regshot Portable (still in development) for that task.
And welcome to PortableApps.com!
the last free version might also be worth a look.
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.
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.
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.
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.
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!
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??
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.
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
Is this because I have a wrong version of the registry plugin installed?
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
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:
BTW, and how are/should App/appinfo.ini and App/appicon.ico be handled in this case?
TIA
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:
Comment this line or leave blank will disable this feature, just as USEJAVAV feature.
Insert in line 155:
This mimics the USEJAVAVERSION code.
Insert in line 629:
Mimic again. Append
${EXTRAPATH}
to the current%PATH%
variable.BTW, please fix the bugs eresele mentioned.
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.
Fantastic!!!
Looks absolutely promising
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.
...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
That is a good idea so that novices might actually know a little bit and know how to use the program.
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?
Yes you can, but it's sufficient to place your exe directly in a directory, e.g. '\PortableApps\YourAppsDirectoryPortable', in the PortableApps file hierarchy.
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?
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"'
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)...
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