Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Portable Code::Blocks

<< < (6/19) > >>

MortenMacFly:

--- Quote from: rokan1 on April 16, 2009, 11:06:38 pm ---Here is modified script expecting MinGW, msys, and codeblocks directories as before:

--- End quote ---
Notice that this script won't work on non-English Windows platforms.

@Biplab: Did you commit the sources for CbLauncher, too? I could not find them... Or do I need to use the one from the archive?

Biplab:

--- Quote from: rokan1 on April 16, 2009, 11:06:38 pm ---I have found a bug in codeblocks: It does not use APPDATA to store various .ini files, instead it uses hard-codded "Application Data" subdirectory within users directory, which causes messing the root (on USB) with various files.

--- End quote ---

Code::Blocks now uses APPDATA to save configuration files. Download a nightly (Rev > 5534) which will have this modification.



--- Quote from: MortenMacFly on April 17, 2009, 01:14:50 am ---@Biplab: Did you commit the sources for CbLauncher, too? I could not find them... Or do I need to use the one from the archive?

--- End quote ---

No I didn't commit source of CbLauncher. It can be downloaded from my blog. If others have no objection, I can commit it to trunk.

MortenMacFly:

--- Quote from: Biplab on April 17, 2009, 02:00:13 am ---No I didn't commit source of CbLauncher. It can be downloaded from my blog. If others have no objection, I can commit it to trunk.

--- End quote ---
You can submit the tool in the "tools" sub-folder in src.

BTW: How does that work under Linux? If I got the changes right they are Windows only and under Linux it still uses the standard path's which would be not on (e.g.) a USB stick...?!

Jenna:

--- Quote from: MortenMacFly on April 17, 2009, 07:10:14 am ---BTW: How does that work under Linux? If I got the changes right they are Windows only and under Linux it still uses the standard path's which would be not on (e.g.) a USB stick...?!

--- End quote ---

On linux a simple script should be enough.

I just hacked one to use C::B compiled with C::B.

Put the following script inside the folder where the run.sh-script is and start it.
You might have to deal with LD_LIBRARY_PATH for a wxWidgets-installation, if you need to have it on the stick (or whatever), too.
But that's another thing and makes it not so easy to make C::B portable on linux.

If you have a C::B installed on the machine and all you want is to have portable configuration, you can use a call to codeblocks instead of running run.sh.


--- Code: ---#!/bin/sh

xhost +
export HOME=`pwd`
./run.sh
xhost -

--- End code ---

By the way:
Instead of dealing with APPDATA and HOME (that seems to be a little hacky), it would be better (in my opinion) to pass an alternative conf-dir to C::B as start-parameter and provide a sdk-function that returns the actual used conf-dir (for the plugins or whatever needs it).

Biplab:

--- Quote from: MortenMacFly on April 17, 2009, 07:10:14 am ---
--- Quote from: Biplab on April 17, 2009, 02:00:13 am ---No I didn't commit source of CbLauncher. It can be downloaded from my blog. If others have no objection, I can commit it to trunk.

--- End quote ---
You can submit the tool in the "tools" sub-folder in src.

BTW: How does that work under Linux? If I got the changes right they are Windows only and under Linux it still uses the standard path's which would be not on (e.g.) a USB stick...?!

--- End quote ---

I'll put that code in trunk.

Creating portable version on Linux is not easy. I mean you build binary on Fedora and then you can't expect that it will run fine on other system, e.g. Ubuntu. Yes, it's possible to ask Code::Blocks to save configuration file to any specified folder. I have made this change only for Windows where many people prefer portable application.



--- Quote from: jens on April 17, 2009, 10:50:14 am ---By the way:
Instead of dealing with APPDATA and HOME (that seems to be a little hacky), it would be better (in my opinion) to pass an alternative conf-dir to C::B as start-parameter and provide a sdk-function that returns the actual used conf-dir (for the plugins or whatever needs it).

--- End quote ---

Both way it's a hack. If you use APPDATA or HOME, you are asking Code::Blocks to use another directory by pointing to by modifying corresponding environmental variables locally. On the other hand if we provide it as an option, we are still asking it to use another folder as the configuration folder. Using well defined environment variable to save configuration is a standard procedure.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version