NO

Author Topic: Portable Pelles C - is it possible?  (Read 12701 times)

lamer

  • Guest
Portable Pelles C - is it possible?
« on: July 24, 2006, 10:56:23 PM »
Hi, Pelle!
First of all - thank you for great IDE! =D>
The wish (suggestion) - is there any way in future versions to make the program portable? It works just fine from USB drive, but writes many values to registry. May be use INI file instead?
At my work it's absolutely prohibited to use third party programs - so I'm compelled every day to insert settings in the morning and delete them in the evening. :D
Thank you.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Portable Pelles C - is it possible?
« Reply #1 on: August 04, 2006, 12:10:20 PM »
Hello,

Quote from: "lamer"
First of all - thank you for great IDE! =D>

Thanks! :-)

Quote from: "lamer"

The wish (suggestion) - is there any way in future versions to make the program portable? It works just fine from USB drive, but writes many values to registry. May be use INI file instead?

All I can say right now is "maybe". It's not high priority, but perhaps some day...
/Pelle

Synfire

  • Guest
Portable Pelles C - is it possible?
« Reply #2 on: August 04, 2006, 02:23:58 PM »
Quote from: "lamer"
The wish (suggestion) - is there any way in future versions to make the program portable? It works just fine from USB drive, but writes many values to registry. May be use INI file instead?


Just for the record, I'd like to second that suggestion. I tend to program in random places; library, friends houses, etc. Because of this, I setup PellesC on my USB SanDISK. But unfortunately, at the library and friends houses I don't always have permission to write to the registry so I end up just working from the command line (which isn't that big of an issue) but I actually do like PoIDE. It'd be extremely useful to have settings stored in an INI file. Maybe something to think about for the next Release build (ie, non beta). :wink:

Regards,
Bryant Keller

kalikiana

  • Guest
Portable Pelles C - is it possible?
« Reply #3 on: August 04, 2006, 07:47:37 PM »
Quote from: "Synfire"
Quote from: "lamer"
The wish (suggestion) - is there any way in future versions to make the program portable? It works just fine from USB drive, but writes many values to registry. May be use INI file instead?


Just for the record, I'd like to second that suggestion. I tend to program in random places; library, friends houses, etc. Because of this, I setup PellesC on my USB SanDISK. But unfortunately, at the library and friends houses I don't always have permission to write to the registry so I end up just working from the command line (which isn't that big of an issue) but I actually do like PoIDE. It'd be extremely useful to have settings stored in an INI file. Maybe something to think about for the next Release build (ie, non beta). :wink:

Regards,
Bryant Keller


Hm... may that's a bit off-topic but I'm wondering why someone should be programming at different places the way you do. I mean for example, if I'm working together with a friend, he would allow me to install PellesC, wouldn't he? I'm just asking out of curiosity here.

Synfire

  • Guest
Portable Pelles C - is it possible?
« Reply #4 on: August 04, 2006, 10:01:03 PM »
I don't normally work with people on any project. I don't really play well with others. I have slightly less than reliable living conditions, been that way since I was 14, so I tend to just work where I can.

ivanhv

  • Guest
Portable Pelles C - is it possible?
« Reply #5 on: September 19, 2006, 10:11:19 PM »
I'd like to see Pelles C configurable by an ini file too.

Look for "PortableApps" in google. You'll see how much effort there is on making "portable applications".

The point is that installing Pelles C each time you work on a different PC is not as cool as if you could carry the compiler on a USB pen drive, yet configured and ready to use.

I think the change would be easy to make. Just look for the lines where you read registry. Replace it for a custom routine that reads the registry the same way, but also read from a .INI if you don't find the registry value (the INI should be located at the same dir where poide is). That's almost all (almost... take in mind that a USB device could be mounted on different drive letters for different machines).

I like having some particular applications portable, because I frequently work in three different PC, and it's not easy to have app settings on sync in all of them sometimes. As PoIDE success on editing C files, it would be great to carry it configured on the pocket (you know... you can never say when you're going to program one line of raw C code or two!)

kalikiana

  • Guest
Portable Pelles C - is it possible?
« Reply #6 on: September 19, 2006, 10:59:12 PM »
I love portable apps which can read settings from their folder although I don't use more than two PC's most of the time.

But note that Vista will not any more allow every app to write to the 'program files' folder, so you should find some way using either the registry or an ini file by choice. Even if you are not gonna use Vista like me, there may be some people who use it. ;)

Ehtyar

  • Guest
Re: Portable Pelles C - is it possible?
« Reply #7 on: April 18, 2007, 03:16:52 AM »
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 :P) 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:
Code: [Select]
<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:
Code: [Select]
!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:
Code: [Select]
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:
Code: [Select]
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]
« Last Edit: April 21, 2007, 12:09:38 AM by Ehtyar »

Crayzie

  • Guest
Re: Portable Pelles C - is it possible?
« Reply #8 on: September 16, 2007, 06:20:36 PM »
Urm, sounds weird if we have to make it some registry entries manually for PellesC to work. I will take a look and see what I can do...

Ehtyar

  • Guest
Re: Portable Pelles C - is it possible?
« Reply #9 on: September 19, 2007, 05:16:11 AM »
PellesC makes the registry entries, which is fine provided you don't care about losing all your settings. The purpose of a portable PellesC is to preserve the settings from computer to computer. It's just unfortunate the settings aren't saved in a file (store settings in an sqlite db anyone?).

Ehtyar.

severach

  • Guest
Re: Portable Pelles C - is it possible?
« Reply #10 on: September 20, 2007, 04:22:28 AM »
All you need to do to preserve settings is to write them to a REG file. I wrote mine to a reg file, trimmed out the defaults, and my Pelles-C install went from 3 minutes down to 20 seconds.

Ehtyar

  • Guest
Re: Portable Pelles C - is it possible?
« Reply #11 on: September 22, 2007, 12:35:34 AM »
You were obviously doing something considerably wrong in that case. Though if you have an idea of how to use nsis you can create your own loader, and slim it down a sizable amount, easily down to three seconds, as it should be anyway.

Ehtyar.