This template should be suitable for most applications to make them portable.
Download it here (latest version 1.4.2):
It allows saving a lot settings (one or all of them at once):
- One or more registry keys
- One or more settings directories
- One or more settings files
The source contains a lot comments, documenting what I did and why (for those who want to learn).
You could do some additional adjustments in the functions "Init" before calling the application and "Cleanup" after the application closed. I left them empty but prepared for very special customizations.
I took the main idea from the Quickport NSIS template developed by Deuce but rewrote it completely (and added some stuff)
This template has no specific license. Therefore I left the commented license section empty.
Everyone could use this template for creating portable applications out of standard applications (commercial or not). If you make a commercial application portable beware of the respective license terms. Nevertheless it would be nice to share the launcher application.
Just for fun (and testing) I created a NSIS version of a launcher for Inkscape. It works nicely.
Enjoy it and have fun with it.
I haven't included any handling of ini-files or some other directory structure as John usually does in his launchers. If you think it would be a good idea to have, please tell me and I'll add it.
In order to compile this script with NSIS you need the following Plugins:
NEW with version 1.1:
INI files and some default directory structures are supported now.
NEW with version 1.2:
added sleep time when deleting registry keys
adopted new directory structure as recently used by John (AppPortable instead of PortableApp)
NEW with version 1.3:
fixed a bug
NEW with version 1.4:
added handling for second launch
Last tested with NSIS 2.24