You are here

Portable Application Template 1.4 released

82 posts / 0 new
Last post
Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
Portable Application Template 1.4 released

This template should be suitable for most applications to make them portable.

Download it here (latest version 1.4.2):
http://www.loncarek.de/downloads/ApplicationPortableTemplate.zip

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.

Comments welcome.

In order to compile this script with NSIS you need the following Plugins:
- NewAdvSplash
- Registry
- FindProc

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
some bugfixes

Last tested with NSIS 2.24

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 14 years 5 months ago
Joined: 2006-01-06 21:27
Me. Want. Inkscape. Now.

I want that Inkscape.
Tutorial or Download?
----
R McCue

"If you're not part of the solution, you're part of the precipitate."

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
OK Tutorial, as currently only a simple test

The following is a short tutorial for PortableInkscape as I do not have enough webspace to host it completely. BTW: consider it as beta.

OK, use the above template replace the empty constants with the stuff below:

!define AUTHOR "Karl Loncarek" ; your name
!define APP "InkScape"
!define VER "1.0.0.0"
!define EXE "inkscape.exe"
;!define ICON "Portable${APP}.ico"
;!define SPLASHIMAGE "Portable${App}.jpg"
!define APPDIR "inkscape"
;!define REGKEYS ""
;!define SETTINGSFILES ""
!define SETTINGSDIRS "$APPDATA\Inkscape"

This has no splashscreen integrated. If you want one create an image and place it in the SPLASHIMAGE constant. Also teh default NSIS application icon is used.

Then do a local install or get the .ZIP archive of inkscape (if there is any) to get the inkscape files.

Create the following directory structure:

PortableInkscape (put your portableinkscape.exe in here)
+-App
| +-Inkscape (copy the whole local inkscape install in here)
+-Data
  +-Registry
  +-Settings
  +-Other
    +-PortableInkscapeSource

The following files can be EXE-compressed (I used WinUPack):
inkscape.exe
inkview.exe
freetype6.dll
intl.dll
jpeg62.dll
msvcr70.dll
popt1.dll
xmlparse.dll
zlib1.dll
libpng13.dll
libgtk-win32-2.0-0.dll
libgdk-win32-2.0-0.dll
libxml2.dll
libtiff3.dll
libpangowin32-1.0-0.dll

Hope this helps... (no warranty for nothing)

BTW: I decided to integrate the handling of INI-files into the template also some additional checking of existing directories and creation on demand. I'll release that in a future version.

hello5959us
Offline
Last seen: 14 years 11 months ago
Joined: 2006-05-28 14:55
Deleting Directories

I used this to make Portable Robolab, which stores settings to My Documents\ROBOLAB Data. When the program is closed it deletes the contents of the folder, but not the folder itself. It would be great if it could do this. Thanks.

retaw
Offline
Last seen: 17 years 5 months ago
Joined: 2006-10-03 23:24
would you mind to help a newbie?

Before I saw Portable Application using NSIS scripts, I used AutoIt3 scripts to run applications, for example, import registry, copy configuration files, run exe, exit exe, export registry. The script also could be compiled and compressed to exe files.

but, NSIS seems better. For example, it seems to be able to make the executables run with configuration files in the same working folder. So, the first question is that how do NSIS scripts achieve that?

NSIS scripts seem more complicated than AutoIt3 scripts. Although I already downloaded your template, NSIS, and read other templates for the portable applications here, I am still not able to pick up quickly. So, I have more questions. Thanks for being patient!

the second question is, some registry files contain path infomation. When using a USB drive, the drive label is often changing, for example, e: or f: or h:. So, could and how do NSIS scripts change path info in registry file according to the current drive labe of the USB drive?

the third question is when the program exits, could and how do NSIS scripts backup/remove the imported registry info and save the configuration files?

The last one, I have prepared a program with the following structure as above:

PortableABCDE (put my ABCDE.exe in here)
+-App
| +-ABCDE (copy the whole local program in here)
+-Data
+-Registry
+-Settings
+-Other
+-PortableInkscapeSource

How could I make changes in your great template? Only in the define section?

Thanks for reading!

Lurking_Biohazard
Lurking_Biohazard's picture
Offline
Last seen: 5 years 6 months ago
Joined: 2006-02-18 18:06
Um, here 'tis...

Been out there for a while... thought you knew. In English, not French. (I just tried it.)

Portable Inkscape

~Lurk~ Email

~Lurk~

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
Yes, I knew

as I said I just did it for testing purposes. And if I don't mix things up with that version AutoIt3 was used for the launcher.

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 14 years 5 months ago
Joined: 2006-01-06 21:27
Thanks

I dont like AutoIt.
Email me and I'll host the tutorial at http://rmccue.stsolutions.us/
----
R McCue

"If you're not part of the solution, you're part of the precipitate."

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
Version 1.1 released

see at the top...

hello5959us
Offline
Last seen: 14 years 11 months ago
Joined: 2006-05-28 14:55
Reg. Rapper

If you don't mind, I would like the template to work with the Registry Rapper format. thanks

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
Where is the difference?

Sorry I do not see the difference in format. Please explain.

hello5959us
Offline
Last seen: 14 years 11 months ago
Joined: 2006-05-28 14:55
Sample and NSIS

It would be nice if you bundled PortableNSIS and a sample Template script to compare with. Thanks for making the template!

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
Portable NSIS is available

see: http://www.portasoft.org/e107/page.php?13

So I don't really see the need for integrating Portable NSIS

Here is an example for inkscape:
http://www.loncarek.de/downloads/InkscapePortableSource.zip

copy all files and directories of your local inkscape installation (or the files out of the distributables, could be found e.g. here: http://sourceforge.net/project/showfiles.php?group_id=93438&package_id=9... ) into the directory PortableInkscape\App\inkscape

Released version 1.1.1 (small bugfix)

Released new version to adopt the new directory structure introduced by John

raother
Offline
Last seen: 17 years 9 months ago
Joined: 2006-06-10 22:57
GUI

Would it be possible to write a GUI for this? Thanks.

Rob Loach
Rob Loach's picture
Offline
Last seen: 15 years 6 months ago
Developer
Joined: 2005-12-09 17:29
PSPad

NSIS just provides a command line compiler and an interface for that compiler. You can use external editors, however, like PSPad (it's already portable) to write scripts for it. Be sure to Website] [Projects] [Blog]

tproli
Offline
Last seen: 11 years 5 months ago
Joined: 2006-07-01 10:07
how to add regkeys to the template?

Thanks for the template, but I have a question: how to add a reg key to it?
I stored the required registry keys in a .reg file, but the readme says,

'!define REGKEYS "" ; insert regkeys to use separated by "||"'

Could someone tell me how to do that exactly (via an example)?

Thanks in advance,

tpr

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 14 years 5 months ago
Joined: 2006-01-06 21:27
Like this:

"HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip||HKEY_LOCAL_MACHINE\SOFTWARE\LimeWire" etc
Get it? (I think)
----
R McCue
PortaBlog Home and My Website
PortaBlog is now officially out of beta!

"If you're not part of the solution, you're part of the precipitate."

Knivez
Offline
Last seen: 17 years 6 months ago
Joined: 2006-07-08 08:27
Good Job!

I like the fact that it passes the command line switches to the app, been using Registry Rapper until now but it doesnt have this feature.

Oh and im wondering if does it support registry entries in different locations? ex HKLM/software/myapp||HKCU/software/myapp, i remember seeing an app that works like this but i cant remember which one Shock

Thanks

Edit:
I tried making Foxit PDF Reader portable, here's the regkey part:

!define REGKEYS "HKEY_CURRENT_USER\Software\Foxit Software||HKEY_CLASSES_ROOT\.pdf||HKEY_CLASSES_ROOT\CLSID\{14E8BBD8-1D1C-4D56-A4DA-D20B75EB814E}||HKEY_CLASSES_ROOT\FoxitReader.Document"

For some reason it succesfully exports all 4 keys, but

HKEY_CLASSES_ROOT\FoxitReader.Document

and

HKEY_CLASSES_ROOT\.pdf

and all the subkeys remain on the registry after closing.. am i doing something wrong?

thanks

Knivez
Offline
Last seen: 17 years 6 months ago
Joined: 2006-07-08 08:27
Solved it :D

I just figured that HKEY_CLASSES_ROOT and HKEY_LOCAL_MACHINE\Software\Classes are hotlinked, so adding HKEY_LOCAL_MACHINE\Software\Classes\FoxitReader.Document and HKEY_LOCAL_MACHINE\Software\Classes\.pdf to the previous example did the trick.

Thanks for this awesome script

porter
Offline
Last seen: 17 years 7 months ago
Joined: 2006-07-09 06:54
Exactly ...

Thanks Knivez, works like a charm.
Now, I noticed that when launching FoxitReader from a local/portable installation, you've got the ads in the upper right corner. One might think, View -> Untick "Advertisements" and you're done. The problem is, the next time you launch the app , the ads come back.
What I did, I made a portable version using PAT, went into the following folders "Data -> Settings" and edited "RegKey1.reg".
Open the "RegKey1.reg" and delete "AdvertiseIndex"="number"

One thing I am missing or just couldn't find, is the possibility to choose whether you want to use local or portable settings upon launching the portable application just like in "QuickPortTemplate"

Any suggestions?

PS: Oh I forgot, brilliant script! Thanks heaps.

Knivez
Offline
Last seen: 17 years 6 months ago
Joined: 2006-07-08 08:27
i dunno

A possible way should be modifying the portable .regs to reflect the local entries but it should work only if the app itself doesnt change them..

Ive noticed too that once closed, the wrapper "wipes" any local settings too (it would be awesome if it restored them instead) for example, lets say i want to use my Foxit reader in a computer where PDFs are associated with Acrobat Reader and i don't want to change anything. If open and close Foxit (compiled with the settings i posted earlier)the original pdf associations will get deleted as well. Not much of a concern trough i can live with that Blum

Oh i'd also like to know if there's a limit of the # of reg keys a launcher can manage without problems. I'm considering making my MediaMonkey portable and it creates a huge number of entries each time is launched so i was wondering if it was possible to cover every key.

Regards

porter
Offline
Last seen: 17 years 7 months ago
Joined: 2006-07-09 06:54
Well,

@ knivez
I ported an application that had about 10 registry entries without any problems.

Now, what about those directories (RegistryBackup and SettingsBackup ) then?
It is stated that both will be dynamically created, I have never seen them though ...
Am I not getting it the right way ?

Knivez
Offline
Last seen: 17 years 6 months ago
Joined: 2006-07-08 08:27
just noticed..

... that apparently is not neccesary to mirror HKEY_CLASSES_ROOT and HKLM\Software\Classes\, its just enough to point to the latter when compiling the loader. It confused me a bit since i use Total Uninstall to monitor changes and it only reports HKEY_CLASSES_ROOT instead of both.

porter: -RegistryBackup and SettingsBackup are working fine here. The folder(s) are created in the Data dir and get deleted when the app closes.

porter
Offline
Last seen: 17 years 7 months ago
Joined: 2006-07-09 06:54
Alright,

Alright, I've just noticed that thanks Smile

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
Well they will be only

Well they will be only created, when an existing regkey is found. After closing the Portable App again, the backup is restored to the Registry again and the directories RegistryBackup and Settingsbackup are deleted automatically.

thekonfuser
Offline
Last seen: 16 years 10 months ago
Joined: 2007-02-12 12:11
Issues with large number of Registry entries.

I was trying to work on making Omea Reader portable. It creates over 100 registry entries. After adding the keys in the .nsi file, i tried compiling it. It throws an error message. It seems like it doesnt support large number of reg entries. Is there a work around to this? Like adding all reg entires in a file. And then asking the script to import the reg entries in the file? I am new to NullSoft scripting...still on the learning curve. Can someone help me out with this thing?

Thanks,
Sam.

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
Better

if you try to add a complete branch and not only one key. This should work then.
Most application I know create maximum maybe 4-5 branches which might conatin some subkeys.

mikalo
Offline
Last seen: 16 years 5 months ago
Joined: 2006-08-26 18:52
Media Monkey

I would be interested in a portable Media Monkey, even imperfect (provided it's legal).

albuemil
Offline
Last seen: 14 years 3 months ago
Joined: 2006-07-20 11:00
Doesn't restore old settings.

i've tried to create a portable version of WinImage, and i've got the following problem :
after i run the portableWinImage, it deletes the WinImage resitry keys completely.
If i modify the template, and i comment out the lines :

StrCpy "$ACTION" "DeleteKeys" ; delete registry keys on host computer
Call DoAction ; just do it

at line 406 and 407, it doesn't delete the keys and restores the old registry settings, BUT, if there was no registry key to start with, it still leaves the key behind.

From what i can see, there's a problem and the RestoreKeys is not called after the DeleteKeys.

Is there a way around this as i'd like to be able to restore the old registry settings if there was any, but still don't leave any traces if there was no registry entry.

thanx in advance.

EDIT :

I've just looked at QuickPortTemplate, and i've seen a little trick there. After running DeleteKey and RestoreKey it uses a litle delay Sleep 500 before deleting the temporary registry file.
Maybe that's the problem here, the registry file might be deleted before the registry plugin manages to import its content.

EDIT 2:

After a few tests, i've managed to make the code work, here's how the last part of the file looks like (at aboutline 402)

!ifdef REGKEYS
StrCpy "$ACTIONPARAMETERS" "${REGKEYS}" ; hand over parameters list
StrCpy "$ACTIONDIRECTORY" "$DATADIR\Registry" ; define where local keys are
StrCpy "$ACTION" "BackupKeys" ; backup existing registry keys
Call DoAction ; just do it

StrCpy "$ACTION" "DeleteKeys" ; delete registry keys on host computer
Call DoAction ; just do it
Sleep 1000 ; this delay is needed, so the registry writing can be finished before the temporary REG file is deleted

RestoreOldReg:
StrCpy "$ACTIONDIRECTORY" "$DATADIR\RegistryBackup" ; define where to backup keys
StrCpy "$ACTION" "RestoreKeys" ;restore saved keys
Call DoAction ; just do it
Sleep 1000 ; this delay is needed, so the registry writing can be finished before the temporary REG file is deleted
EndRegKeys:
!endif

The ideea is that i've included the 1000ms delay both after deleting the regkey and after restoring the backup, this seems to work just fine.

There's no teacher who can teach us anything new
He can just help us to remember the things we always knew!
E N I G M A

porter
Offline
Last seen: 17 years 7 months ago
Joined: 2006-07-09 06:54
Nice work ..

Nice work there albuemil ,
This way, old settings are restored upon shutting down the portable app.

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
Thanks I'll add this and

Thanks I'll add this and update it.

tproli
Offline
Last seen: 11 years 5 months ago
Joined: 2006-07-01 10:07
Thanks for the help rmccue,

Thanks for the help rmccue, although I figured it out myself after a few days (after checking out the code of portable photoshop and the nsis documentation). Maybe I asked it too early...

twnty3svn
Offline
Last seen: 15 years 11 months ago
Joined: 2006-04-10 03:24
Thanks!... Got it working but....

for some reason after creating "WordWeb Pro" into a portable app it keeps creating a "history.txt" file in the directory where the PortableWordWeb.exe file is kept. Is this normal, and if so how do i stop it, and if not, what am i doing wrong?

Thanks

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
1.2 out now

version 1.2 out now

twnty3svn
Offline
Last seen: 15 years 11 months ago
Joined: 2006-04-10 03:24
Multipul Instances?

Any chance of adding checking for multipul instances in this fantastic template? Or am i just blind and not configured it properly...

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
?

Do you mean mulitple starting of the launcher? This is not handled currently. Is this a topic? Then I would have to implement this.

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
Added with version 1.4

I added checking for the second launch of the portable app with version 1.4.

Dennis
Offline
Last seen: 17 years 5 months ago
Joined: 2006-09-19 09:20
Current version of NSIS is 2.20

Current version of NSIS is 2.20 - it is stated (in the template) that it is written for NSIS 2.17

Does anyone know if it can be used with NSIS 2.20 ?

Kind Regards,

Dennis Hestbech

Steve Lamerton
Steve Lamerton's picture
Offline
Last seen: 10 years 6 months ago
Developer
Joined: 2005-12-10 15:22
Should

have not problems, if it does post em and we'll have a look.

Yours

Steve Lamerton

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
Works with 2.20

Simply the first design was made on NSIS 2.17. I'll change the comment..

Ledanalf
Offline
Last seen: 10 years 12 months ago
Joined: 2006-09-15 20:50
A little interrogant

In the function :

!define SPLASHIMAGE "${PNAME}.jpg"

It apears an error, says that the image it's not found. Some suggestions?

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
correct name

Did you name the image correctly? e.g. "InkScapePorable.jpg"?
Becaus here I do not get any error message.

ekin_116
Offline
Last seen: 6 years 11 months ago
Joined: 2005-12-29 14:26
During the time I testing in

During the time I testing in some project, I can't compile with the PAT 1.4, but I can compile with PAT 1.3.
Blog for Portability
http://blog.eafriends.com

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
More informations, samples?

for solving this problem?

Ledanalf
Offline
Last seen: 10 years 12 months ago
Joined: 2006-09-15 20:50
Somebody could

Upload NewAdvSplash include, it's now giving me some errors about it now.

ZacWolf
Offline
Last seen: 8 years 2 weeks ago
Joined: 2006-11-28 17:17
Where are the supporting .nsh files?

Am I missing something?

I don't see any of the supporting .nsh files in the zip

Registry.nsh
WordFunc.nsh
FileFunc.nsh

I admit I'm new to this, but should it really be this difficult?
-Zac

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 14 years 5 months ago
Joined: 2006-01-06 21:27
Go to

the NSIS website and download them separately.
----
Ryan McCue
Cube Games
Life is like a sewer. What you get out of it depends on what you put into it.
(Tom Lehrer)

"If you're not part of the solution, you're part of the precipitate."

chezduong
Offline
Last seen: 1 year 7 months ago
Joined: 2006-12-06 04:01
A few questions

Hello Klonk. Thank you for your wonderful template (v 1.4). I spent about 4 hours last weekend creating about 10 portable app launchers, testing, extracting icons, etc., replacing Reg Rapper. Love it!

First question is generic. What is the environmental variable for My Documents? $PROFILE? I googled for about 20 minutes, but either could not find the correct variable or did not implement it correctly in the script.

Second question is more specific. I tried to compare your PAT 1.4 script with John T. Haller's script to see what the differences are. Since I do not know NSIS, I spent an hour and then gave up. What are the major differences?

Last question. Does PAT 1.4 store settings directly in the Data\Settings directory or does it store it on the Host computer and then copy to the USB stick's Data\Settings directory?

Again, thank you very much for having made this template.

CD

chezduong
Offline
Last seen: 1 year 7 months ago
Joined: 2006-12-06 04:01
Answer to First Question

The answer to my first question is $DOCUMENTS.

Found it on nullsoft's website by "accident".

chezduong
Offline
Last seen: 1 year 7 months ago
Joined: 2006-12-06 04:01
Answer to Last Question

Settings are stored on Host computer (in normal non-portable place) and then copied to USB stick and deleted from Host computer.

Indirectly, this answers part of the second question as well...because I think that John's script stores settings directly on the USB stick?

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 14 years 5 months ago
Joined: 2006-01-06 21:27
PAT

is based off John's launchers, however it is easier to change and also supports working with the registry.
----
Ryan McCue
Cube Games
Life is like a sewer. What you get out of it depends on what you put into it.
(Tom Lehrer)

"If you're not part of the solution, you're part of the precipitate."

ndrwgn
Offline
Last seen: 14 years 9 months ago
Joined: 2006-12-08 09:47
Allright, I'm frustrated..

What am I doing wrong?

[CODE REMOVED - POSTING SNIPETS OF CODE IS FINE. POSTING 300 LINES OF CODE IN A FORUM IS NOT]

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 14 years 5 months ago
Joined: 2006-01-06 21:27
Send it

to my email: cubegames@gmail.com
----
Ryan McCue
Life is like a sewer. What you get out of it depends on what you put into it.
(Tom Lehrer)

"If you're not part of the solution, you're part of the precipitate."

chezduong
Offline
Last seen: 1 year 7 months ago
Joined: 2006-12-06 04:01
DeKnop registry entries not deleted

Hi Klonk and everybody,

Can you please help me with something? As mentioned in an earlier post, I have successfully created about a dozen launchers with PAT 1.4 and they all work flawlessly! Thanks again. Smile

There was one program, Deknop (a graphic button maker), with which PAT 1.4 does not seem to work correctly (or with which I do not seem to do correctly). The launcher works, but the registry entry is not deleted when the program is closed.

This is the registry key that I copied from Regedit: HKEY_CURRENT_USER\deknop

This is the code snippet:

!define REGKEYS "HKEY_CURRENT_USER\deknop" ; insert regkeys to use separated by "||", comment out, when not used

Is there something special about a registry entry in the HKCU root that makes PAT 1.4 less effective?

Please remember that I used PAT 1.4 for a dozen other programs that all work correctly so although it could be human error, it would be a repetitive human error (which seems to delete registry keys in the other programs).

Thank you. CD

someoneabc
Offline
Last seen: 14 years 6 months ago
Joined: 2007-04-05 12:34
HELP!!

Hello,

Can someone tell me how to get started?? All I see in the zip is an .nsi file (??) Do I need some kind of NSIS software or something?? I'd love to be able to create my own portable apps and I DO KNOW what I would have to find out and stuff like that, but can anyone help me here??

Thanks

chezduong
Offline
Last seen: 1 year 7 months ago
Joined: 2006-12-06 04:01
Version 1.4.1 and version 1.5?

Hi Klonk,

I noticed from your website that you evolved to version 1.4.1. I don't read German so cannot tell if you wrote this on your website (and I could not find your email address). Can you tell me what improvements/changes you made? Otherwise I'll just review the code...but that takes much longer! Smile

I'd like to also request a new feature in version 1.5 (if there will be one). Can you add files and/or directories to delete once the application is closed? Implementation like you did for unlimited registry keys, setting files and settings directories would be ideal.

I ask because Audacity 1.32 Beta, makes temporary directores that need to be deleted after program close. I don't want to copy these to my USB key because they are generally very large uncompressed audio (WAV?) files.

Thank you.

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

1.4.1 is just a bugfix thing, nothing new and fancy.
Unlimited settings files and settings directories are already supported...

Twar3Draconis
Offline
Last seen: 16 years 11 months ago
Joined: 2006-12-29 23:45
Assistance

Assistance please.

Testing this will NSIS 2.22, and NSIS 2.20, I come upon an error, that seems to be with the Registry.nsh that is downloadable from the NSIS site. I'm getting:

Invalid command: ${registry::KeyExists}

The Registry.nsh is the one available here:
http://nsis.sourceforge.net/Copy_Registry_Key

doni49
Offline
Last seen: 2 months 4 weeks ago
Joined: 2007-01-21 20:16
U3 compatible?

I just bought a U3 stick earlier today. I'd LOVE to be able to make Quicken portable for use with it. Of course this will be just for my own personal use.

But I didn't see anything about using this to make apps U3 compatible.

Are there any tutorials available to make them U3?

Don

Don

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
U3

is something really special which you need some special U3 API for it. I doubt that there is a way to create a launcher with NISIS to get something U3 capable.

vbap
Offline
Last seen: 6 years 10 months ago
Joined: 2006-08-28 02:28
Thanks...

for providing this template. Created a launcher for Tunnelier (graphical SSH client with SFTP from bitvise.com) and it works a treat!
Waiting on feedback from bitvise about hosting this launcher for the community.

JEStoner
Offline
Last seen: 17 years 1 month ago
Joined: 2007-01-23 10:50
plug-ins required

For those of you getting started with this template (an excellent one, BTW - Thank you for providing it), you need to download and install several additional plug-ins for NSIS.

Go to the NSIS Plug-ins page at http://nsis.sourceforge.net/Category:Plugins

Download the following plug-ins: NewAdvSplash, Registry & FindProcDLL and install them.

-Jeff

-Jeff

Simeon
Simeon's picture
Offline
Last seen: 9 years 5 months ago
DeveloperTranslator
Joined: 2006-09-25 15:15
Or

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

nycjv321
Offline
Last seen: 15 years 7 months ago
Joined: 2006-06-04 15:53
umm

are u gonna remove default directories? like john has? so it doesnt autoprobe for directories, just a waste of CPU time Sad

Slackware 12 for system
MCP (For XP and Server 2003)
Network + Certified
aim is "nycjv321" (minus quotes)

vbap
Offline
Last seen: 6 years 10 months ago
Joined: 2006-08-28 02:28
It's a template

Since it's a template, it should cater for all possibilities. Feel free to remove the redundant code for your own particular implementation...

ReneL
Offline
Last seen: 11 years 2 months ago
Joined: 2005-12-18 02:40
InkscapePortable 0.45

As John is currently releasing a bunch of updated Apps I really hope that he will add InkscapePortable at last... now that there's the brand new version 0.45.

NSIS 2.23 generates with the InkscapePortableSource.zip from 19 Oct 2006 an .exe which just consumes all CPU without doing something visible...

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
I tried

with NSIS 2.24 and using the actual Inkscape Portable source. works fine...

kTitan
Offline
Last seen: 17 years 2 weeks ago
Joined: 2007-03-09 06:18
same problem

I have the same problem with an other app (my first).
Did you solved your problem somehow?
I tried it with diffrent NSIS Versions (at the moment with 2.24). All have the same effect.

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
Check

whether there is some loop or something. Or some wait for application start.

Ling-Ling
Offline
Last seen: 17 years 1 month ago
Joined: 2007-02-13 08:29
i think its nice but how can

i think its nice but how can i make this file to an exe file?

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
Simply compile it

with NSIS

schmots
Offline
Last seen: 17 years 4 weeks ago
Joined: 2007-02-22 12:36
Just don't get it

I tried this. But the exe created is blank and when run complains about not finding the exe I specified. I am not a programmer. Does anyone have a start to finish tutorial for this using some application thats small and opensource?

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
It's quite simple

You simply have to change those lines (comments are quite self explaining)

; **************************************************************************
; * Define constants
; **************************************************************************
!define AUTHOR "" ; your name
!define APP "" ; insert application name, e.g. "TestApp"
!define VER "0.0.0.0" ; insert version of launcher
!define EXE "" ; insert program exe name, e.g. "testapp.exe"
!define PNAME "${App}Portable" ; format of portable name (dirs and filenames)
!define ICON "${PNAME}.ico" ; comment this line out when default icon should be used
!define SPLASHIMAGE "${PNAME}.jpg" ; comment this line out when no splashscreen image should be used
!define REGKEYS "" ; insert regkeys to use separated by "||", comment out, when not used
!define SETTINGSFILES "" ; insert settings files to use separated by "||" as stored on the host computer, e.g. "$WINDIR\TEST.INI", comment out, when not used
!define SETTINGSDIRS "" ; insert settings directories to use separated by "||" as stored on the host computer, e.g. "$PROFILE\TEST", comment out, when not used

You should also take a look at the readme.txt regarding the necessary directory layout.

For REGKEYS, SETTINGSFILES, SETTINGSDIRS: You have to fidn out yourself where the application you want to start stores its settings. There are several tools out there monitoring registry or file acccess..

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
Requirements

Added the requirements...

magdoomh
Offline
Last seen: 17 years 1 week ago
Joined: 2007-03-07 20:45
Need help with registry keys in PAT

Hello,

If my registry key is like this ,whats the format i have to enter it in the template.

(+)(REG KEY)HKEY_CLASSES_ROOT\CLSID\{195B5D84-DAD1-11D3-AA5F-00105A6F87AB}\InprocServer32
(+)(REG VAL) ThreadingModel = 'both'
(+)(REG VAL) (Default) = 'C:\Program Files\SIPLink\dXDBInsp.dll'

Thankyou

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
Simple:

I think the folowing should work:

!define REGKEYS "HKCR\CLSID\{195B5D84-DAD1-11D3-AA5F-00105A6F87AB}\InprocServer32"

In the NSIS help you can find the "HKCR" thing at the function "WriteRegExpandStr"

tkuntz
Offline
Last seen: 17 years 1 week ago
Joined: 2007-03-15 13:59
Error: Infinite Loop in Template Script

If the executable can't be found, the script goes into an endless loop - leaving you hanging (pun intended).

Notice the reference back to "CheckAppsDIR" if the file is not found?

181 CheckAppsDIR:
182 IfFileExists "$EXEDIR\Apps\${PNAME}\${APP}\$PROGRAMEXE" "" CheckAppsDIR

Here's my guess as to the fix... using a new label "NoExeFound"

CheckAppsDIR:
IfFileExists "$EXEDIR\Apps\${PNAME}\${APP}\$PROGRAMEXE" "" NoExeFound
    StrCpy "$PROGRAMDIR" "$EXEDIR\Apps\${PNAME}\${APP}"
    StrCpy "$DATADIR" "$EXEDIR\Data\${PNAME}"
    Goto InitVarEnd		
; --------------------------------------------------------------------------
; No allowed pathconfiguration was found
; --------------------------------------------------------------------------
NoExeFound:
MessageBox MB_OK|MB_ICONEXCLAMATION `$PROGRAMEXE was not found.  Please check your configuration`
Abort ; terminate launcher

BTW - This is a great script, Karl! Thanks for posting.

Klonk
Offline
Last seen: 11 years 11 months ago
Joined: 2006-04-21 03:08
Uups,

you're right, this is a bug. I'll fixed this in the source and updated it to my homepage.

SmithTech
SmithTech's picture
Offline
Last seen: 1 year 11 months ago
Developer
Joined: 2006-11-24 18:06
Would you mind if I included

Would you mind if I included the template with the NSIS Portable on my website?

For those who have fought for it, freedom has a flavor the protected will never know.

"Because they stand on a wall and say, 'Nothing is going to hurt you tonight. Not on my watch.'" (A Few Good Men)
Coincidence is God's way of remaining anonymous.(Albert Einstein)

someoneabc
Offline
Last seen: 14 years 6 months ago
Joined: 2007-04-05 12:34
HELP!!

Hello,

Can someone tell me how to get started?? All I see in the zip is an .nsi file (??) Do I need some kind of NSIS software or something?? I'd love to be able to create my own portable apps and I DO KNOW what I would have to find out and stuff like that, but can anyone help me here??

Thanks Wink

P.S. Please delete the one at the top...I can't figure out how to comment without replying Pardon

Cheat King
Offline
Last seen: 16 years 10 months ago
Joined: 2007-03-07 11:16
Hi! Erm...

Hi, erm... I think this is a great script and all, but I get this error:

Error while setting icon to "$LimeWire.ico": can't open file

The code that I am using to get the icon is:

!define ICON "$LimeWire.ico" ; comment this line out when default icon should be used

And also, what does it mean: comment it out?

Cheat King
----------

Cheat King
----------

hello5959us
Offline
Last seen: 14 years 11 months ago
Joined: 2006-05-28 14:55
Get rid of the $

Commenting is putting a semicolon in front.

Topic locked