Hi all.
It seems there are many people on this forum who would like to see PellesC as portable so I'll give you all some ideas.
Most of the applications i use i prefer to make portable so i can use them at community college while the teachers are busy teaching the class things i knew in junior high (can everyone say "if statement"?). Anyway, i have had PellesC for a while and only just became aware of the enormous amount of potential it holds for C programmers, so i spent the time to make it portable, and here's what i did.
First, i use
NSIS (Nullsoft Scriptable Installer System) for creating my portable applications, and it's easiest to create them using templates. The one i use (when I'm being lazy
) can be found
here, but you can find many variations, using a few different languages on this same
website.
The way i did it was to completely move the ide to it's own folder within the installation directory (add the directory structure required by the template of course). You may not like this approach, but I'm sure you can figure something out if this is the case. To accomplish this you will need to move some files files to the portable application directory (<PellesC install dir>\<new folder for portable ide>\App\<name you're using for portable installer>). My directory looked like: G:\PellesC\PoIDE\App\PoIDE.
The files to be moved to this directory include:
<installdir>\bin\Addins\
<installdir>\bin\Intl\
<installdir>\bin\Wizards\
<installdir>\bin\Help\
<installdir>\bin\Support.dll
<installdir>\bin\poide.exe
<installdir>\bin\poviewp.exe
<installdir>\bin\poreg.exe
<installdir>\bin\porc.dll
I have, however, not tested if any of these need not be moved, but i am fairly certain that moving them will not break anything else (i have compiled many projects and add-ins from this site successfully).
When that is completed, you'll want to define the registry key in the portable application template. Fortunately PellesC keeps its keys in HKEY_CURRENT_USER, so users running this from a limited account should have no problems provided additional restrictions on the registry are not applied by your admin. The key we need is HKEY_CURRENT_USER\Software\Pelle Orinius\PellesC (you can copy and paste this into the REGKEYS definition in the template like so:
!define REGKEYS "HKEY_CURRENT_USER\Software\Pelle Orinius\PellesC"
The rest of the definitions within the template are mostly self explanatory.
Now if you're anal like me and want it to be nice and clean, you can add the following things to the portable template.
To remove the HKEY_CURRENT_USER\Software\Pelle Orinius key if it is empty after you're done with poide, you can add the following line to the end of the !ifdef REGKEYS block near the end of the template ~line 445:
DeleteRegKey /ifempty HKEY_CURRENT_USER "Software\Pelle Orinius"
Also, because your drive letter will most likely be different, having a list of recently opened projects and files is only going to mess up your day, so you can add the following two lines to delete them in between the Function Init
and FunctionEnd block at ~line 98:
DeleteRegKey HKEY_CURRENT_USER "Software\Pelle Orinius\PellesC\Recent File List"
DeleteRegKey HKEY_CURRENT_USER "Software\Pelle Orinius\PellesC\Recent Project List"
Note that PellesC will re-create these keys, empty, each time it runs, these lines just delete the ones created in the previous session before poide starts.
Now that you're all done with the script, just compile it (run makensisw.exe and drag the script onto the client area) and you're all ready to go
Hope this helps you guys out (and wasn't tooooooo long winded). Happy portable compiling, Ehtyar.
P.S. Thanks so much Pelle for this incredible compiler/IDE, and thanks to Klonk for his/her very handy portable app template.
[edit]
Forgot to add porc.dll to the list. Fixed.
[/edit]