News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

I apply for a new feature

Started by luoyonggang, March 21, 2008, 10:42:52 AM

Previous topic - Next topic

luoyonggang

I need a feature that codeblocks can import configure file in the folder that conation codeblocks.exe . Then we can place codeblocks on usb and running it everywhere. I think it would be good !!!!!!
And we just need to adjust a parameter to determine whether the configure files is place on the computer or the usb drivers.

dje

Hi !

You should search the forum and the wiki.
C::B is already able to do that.

Dje

luoyonggang

I'm so sorry that i can't find that. I get a method but it doesn't work very well.
I created a automate bat file to running the codeblocks. even though it can specify the environment varibale USERPROFILE,
but in Windows Vista and Windows XP the APPDATA is different , so it's can't share the same configure file .
So can you tell me how to solve this problem.
If you have, please give me the answer.
Than you.

thomas

Code::Blocks will use a config file located in its installation directory if none is present in the current user's profile folder.

So, to put Code::Blocks onto an USB stick, simply move (not copy) the config file there.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Seronis

Quote from: thomas on March 23, 2008, 02:57:12 PM
Code::Blocks will use a config file located in its installation directory if none is present in the current user's profile folder.

So, to put Code::Blocks onto an USB stick, simply move (not copy) the config file there.

Just to clarify this..  does that mean that if i have codeblocks on my usb drive.. it will ignore my preferences if i use it on a computer that already has C::B?  Shouldnt any config file located in the installation override the generic 'global' config thats in the user profile?

Calexus

This seems to be a frequently returning question.
Maybe someone that knows how to get CB portable could write some lines in the Wiki?
Under Installing Code::Blocks for example...

PsYhLo

good idea i'm interest in such thinks :)
[url="http://img529.imageshack.us/img529/822/3664286vy.png"]http://img529.imageshack.us/img529/822/3664286vy.png[/url]

thomas

Quote from: Seronis on March 23, 2008, 06:17:55 PMJust to clarify this..  [...]
No, that's not how it works. Read what I wrote above.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

luoyonggang

Please specify the relative path to the directory of CodeBlokcs.
If the CodeBlocks is $(CodeBlocks), then where I need to place the codeblocks' config files.
In the current time
I put these files in $(CodeBlocks)/AppData/Roaming/codeblocks when i'm using CodeBlocks under Windows Vista
and I put these files in $(CodeBlokcs/Application Data/codeblokcs when i'm using CodeBlocks under Windows XP

Then I generated a bat file whoes name is $(CodeBlokcs)/codeblocks.cmd
with the content that follow:

echo off
set USERPROFILE=%~dp0Settings
START /D "%~dp0" CodeBlocks.exe %


The the problem was happend I have to use different Config File Under Different Operating System.
So can you help me to solve this problem?
Thanks.

MortenMacFly

Quote from: luoyonggang on March 25, 2008, 11:45:58 AM
If the CodeBlocks is $(CodeBlocks), then where I need to place the codeblocks' config files.
Make sure:
- place the default.conf file into the directory where  codeblocks.exe (or the C::B binary in general) is
- remove any default.conf file from APPDATA or USERPROFILE or wherever you have this now
- remove all bad hacks to modify USERPROFILE and/or APPDATA before C::B
- just run C::B from within the C::B path

A minor note: If C::B does not find default.conf (it's config) within the APPDATA/USERPROFILE path it looks within the C::B directory (the one where the C:B executable is) next. If there is no config file, too it will be created in APPDATA/USERPROFILE. So just make sure you are doing the right thing and C::B is portable just fine.

BTW: This does probably *not* apply for any other config file(s) where not C::B is the stakeholder but e.g. plugins. The main config file just works like that.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Jenna

You can even use the config-file from the C::B directory on a stick if C::B is installed on the computer.
Rename the "default.conf" on the stick to (for example) "stick.conf" and start C::B from a batch file with the parameter "--personality=stick".
If no "stick.conf" exists in APPDATA/USERPROFILE C::B will use the one from the stick.