Hello,
I am new with portable apps and I am trying to write my first NSIS script. I would like the app Ekiga to be portable:
Section "Main"
ReadEnvStr $APPDATAPATH "APPDATA"
CopyFiles /FILESONLY $EXEDIR\Data\settings\ekiga.conf $APPDATAPATH\ekiga.conf
FileOpen $0 $EXEDIR\App\Ekiga\ekiga.bat w
FileWrite $0 "set PATH=%PATH%;$EXEDIR\GTK2-Runtime\bin$\n"
FileWrite $0 "cd App\Ekiga$\n"
FileWrite $0 "ekiga.exe$\n"
FileClose $0
StrCpy $EXECSTRING "$EXEDIR\App\Ekiga\ekiga.bat"
Exec $EXECSTRING
CopyFiles /FILESONLY $APPDATAPATH\ekiga.conf $EXEDIR\Data\settings
SectionEnd
The script works. But is there a better way to change the PATH variable to enable GTK2-Runtime in the EkigaPortable folder?
Use the PortableApps.com Launcher. It does these things properly, taking care of these things plus quite a number of other things you haven't dealt with. Here is the approximate launcher configuration you would end up with:
Note that this assumes moving GTK2-Runtime to App\gtk (the conventional location to put the GTK).
I am a Christian and a developer and moderator here.
“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1
Thanks for the information. It works with
[Environment]
PATH=%PATH%;%PAL:AppDir%\gtk\bin