Do not use this. Use the PortableApps.com Launcher instead.
Discussion has moved here:
https://portableapps.com/node/10491
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.
One special thing (since version 1.6): The users profile folder is 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 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
Last tested with NSIS 2.28
History (since version 1.4):
Discussion/History until version 1.4:
https://portableapps.com/node/2022
1.5
- complete rewrite for intermediate users to understand easier what is going on, as discussed here: https://portableapps.com/node/6229
- integrated readme into source
- files/folders are now renamed -> should improve starting time a lot.
- error handling when backup files/folders exist
1.6
- compile flags added to decrease final launcher filesize
- users profile directory is now redirected to the portable data directory
- added check for non-existant data folders -> automatic creation
1.7
- added automatic creation of missing data directories
- automatic user profile redirection could now be also disabled
1.8
- added optional admin rights checking
- optimized compilation (when some constants are left empty and not commented out.
- minor bugfix
1.9
- when no directories are found a default directory structure is created
- when no EXE is found you are asked to select a folder from which to copy the files
- added possibility to integrate the sources if you want to distribute only the exe, e.g. when creating commercial/shareware applications launchers -> launcher is an installer at the same time
- added switch for INI file to disable the above automatic extraction
- some code optimizations
2.0
- registry keys are now stored in one single file even with multiple registry keys (not compatible to previous versions)
- Overrides setting of REGKEYS if USEREGKEYSFILE is "TRUE" and reads registry keys to process from file "Registry.reg"
- Added "Registry.reg" to source installation
- Added default command line parameters
- removed one possible directroy structure (which did not make sense)
- added GTK and JAVA (or better JRE) support, adjustable via INI
- automatic detection of a "CommonFiles" directory.
2.1
- bug fixes
- possibility to deltet registry keys before applying own (saved) ones
- added RequestExecutionLevel for better VISTA compatibility
2.2
- fixed newadvsplash DLL being left in the temp directory (forgot cleanup)
- changed way of restoring the registry keys (now uses "regedit /s")
- removed sleeps again (commented them out, just in case...)
- removed /D=2 switch when saving registry keys
2.3
- added a lot of "" around the variables, this should fix errors with empty variables
- cleared errors before any registry stuff
- added popup messages when something goes wrong when saving registry keys
Any comments/bug reports are welcome.