Author Topic: Portable Code::Blocks  (Read 155488 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Portable Code::Blocks
« Reply #30 on: April 19, 2009, 12:31:20 pm »
Using well defined environment variable to save configuration is a standard procedure.

Nothing to say against that.

What I mean is to use APPDATA and HOME as default, but give the user the flexibility to change the conf-dir via commandline.

And if it should be done with environment variables, it is not the correct way to change variables that are set by the OS (even not temporary).
In this case we should use an own variable (maybe only if it is set and as default use the system standard).

To avoid that plugins, that are distributed with C::B, still use the system standard dirs, we should offer a function to provide the actual used directory and not hack the environment.
And "teach" them to use it.

Offline Omnipotent Geass

  • Single posting newcomer
  • *
  • Posts: 4
Re: Portable Code::Blocks
« Reply #31 on: May 20, 2009, 07:16:33 pm »
I don't see why you couldn't save application data in file and have an option in code::blocks to modify where that data is saved because I my self would like a completely portable code::blocks yet it dose not appear to have much use to me as why would you be developing an application on other person/entity's computer other than your own unless you are wanting to compile bit of code that you might find.
« Last Edit: May 20, 2009, 07:19:35 pm by Omnipotent Geass »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Portable Code::Blocks
« Reply #32 on: June 21, 2009, 04:44:34 am »
Quote
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. As a work-arround I have modified the directories on USB to look like "standard windows" ones (although I prefer short unix-like ones where you do not need to type quotes to get around that stupid spaces). The script launches codeblocks.exe and also command prompt with all variables set - where you can eg launch real bash shell from msys by typing "sh". Here is modified script expecting MinGW, msys, and codeblocks directories as before:

I can confirm this bug.

I have many *.ini file next to codeblocks.exe. when I run CbLauncher.exe, it will use these ini files. (though I have a subfolder called "APPDATA" next to codeblocks.exe)

When I delete the *.ini file and run Cblauncher.exe again.
All the layout will be reconfigured. Quite STRANGE.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Portable Code::Blocks
« Reply #33 on: June 21, 2009, 03:07:05 pm »
@Biplab
I found another bug. See the steps I wrote in this post:

http://forums.codeblocks.org/index.php/topic,10599.msg73602.html#msg73602

Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Portable Code::Blocks
« Reply #34 on: June 21, 2009, 04:02:38 pm »
@Biplab
I found another bug. See the steps I wrote in this post:

http://forums.codeblocks.org/index.php/topic,10599.msg73602.html#msg73602

Thanks for reporting this bug. However it seems that it's a bug in CodeSnippets plugin. I'll look into the other bug.
Be a part of the solution, not a part of the problem.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Portable Code::Blocks
« Reply #35 on: June 21, 2009, 04:06:13 pm »
It seems this bug has happened only once (in the first configure step).

After that, I can delete "codesnippets.ini" in the root folder, and it won't happened again when I run portable CB. :D

 
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

washington678

  • Guest
Re: Portable Code::Blocks
« Reply #36 on: July 08, 2009, 04:51:40 am »

Hello everyone. Nice to meet you all.



pret auto

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Portable Code::Blocks
« Reply #37 on: December 05, 2009, 05:03:23 am »
For a reminder, I added this to

3.2 Q: How do I make Code::Blocks portable?

Also, I suggest that these codes can be add to SVN trunk. Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Portable Code::Blocks
« Reply #38 on: December 05, 2009, 05:54:15 am »
For a reminder, I added this to

3.2 Q: How do I make Code::Blocks portable?

Also, I suggest that these codes can be add to SVN trunk. Thanks.

Thanks for reminding. I haven't got time to update it. Nevertheless I'll merge it to trunk soon. :)
Be a part of the solution, not a part of the problem.

Offline Denro

  • Multiple posting newcomer
  • *
  • Posts: 28
  • Just dont ask me
    • search to find
Re: Portable Code::Blocks
« Reply #39 on: August 18, 2010, 10:07:45 am »
i did download CbLauncher0.1.3
and i did all as http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_make_Code::Blocks_portable.3F said ... also with bat file

now in the launcher doc is writen
Quote
3- If applications used by CB "Tools" or "Plugins" are located in a "tool"
subdirectory of the CodeBlocks installation root directory or subdirectories, then
the "tool" directory and its subdirectories are added to the system path prior to
launching Code::Blocks.

do i have to make a directory "tool" in the C::B install root folder and place all plugins and tools in that folder?

also i did download all the dejavu fonts and place them into the share\CodeBlocks\fonts folder
is it OK if i place all the fonts there or should it be only one font?

and in the APPDIR i have a template folder ... do i have to move it now to the C::B main directory or what?
there are also some other files in the APPDIR ... what i do with them

maybe all gets clear if i start C::B with the launcher
but i wait now some minutes ... maybe someone will motivate me or tell me what i have to do with this template folder and the other files in the APPDIR :)
Max 255; characters remaining: 221

Offline Denro

  • Multiple posting newcomer
  • *
  • Posts: 28
  • Just dont ask me
    • search to find
Re: Portable Code::Blocks
« Reply #40 on: August 18, 2010, 07:02:22 pm »
i did download the last nighltly C::B build
and minGW
i did download the lastest C::B portable launcher from http://biplab.in/2009/04/creating-portable-codeblocks-part-2/
and also the Dejavu fonts from http://dejavu-fonts.org
and i did all as described here http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_make_Code::Blocks_portable.3F

I have put the minGW folder into the C::B mainfolder "codeblocks\mingw"
and the fonts to "codeblocks\share\CodeBlocks\fonts"

i had to run C::B and to compile the C::B portable launcher wich comes as a C::B project

the Launcher binary i placed i the C::B root folder "codeblocks\"
and all the files in "%APPDATA%\codeblocks\" i moved to the C::B application directory "codeblocks\"
(there were some files in subfolders which i placed at the corresponding folder in the C::B application folder)

i did rename the "%APPDATA%\codeblocks\" to "_CB_"
and launch the portable launcher

and C::B did load finaly as normal :D with all my settings and as ever :D


i have not tested all the plugins and hope most of them will work too in that way ;)

there is one thing that is buging me :(
in the enviroment settings i can tell C::B where the helpfiles are
and the phat looks like "C:\Program Files\CodeBlocks\share\CodeBlocks\docs\codeblocks.chm"
can i do this relative?
and if i have tools will i face the same problem? can i make the tools path also portable (relative) if i put the tools into the C::B folder?
the launcher instruction is not very clear to me ... sorry!

if any other person wanna try it ... just do as i did and it will work as far as possible :D

thanks for this cool launcher ;)
Max 255; characters remaining: 221

Offline rbon

  • Single posting newcomer
  • *
  • Posts: 6
Re: Portable Code::Blocks
« Reply #41 on: August 25, 2010, 12:56:11 pm »
Here is the Code::Blocks portable launcher CbLauncher0.1.3 with exe.zip

Offline rbon

  • Single posting newcomer
  • *
  • Posts: 6
Re: Portable Code::Blocks
« Reply #42 on: August 25, 2010, 07:30:16 pm »
Here is the file "CodeBlocks_rev6527_portable.zip" -link removed-  
I have set:
1. Settings -> Environment -> Help files : add the path to file codeblocks.chm (for open it with F1)
2. ->Settings
-->Compiler and debugger
--->Toolchain executables
---->Compiler's installation directory
     (manual search the path of MinGW directory)  
3. when You move the directory to a USB key You need manual re-set the path for the Compiler - debugger
4. I have not tried the plugins

« Last Edit: August 28, 2010, 09:15:30 am by rbon »

Offline rbon

  • Single posting newcomer
  • *
  • Posts: 6
Re: Portable Code::Blocks
« Reply #43 on: August 27, 2010, 08:43:53 pm »
Hi,
here is a mini How-to to create a portable version of CodeBlocks
1. install "codeblocks-10.05mingw-setup.exe"
2. create a folder on desktop with name "CodeBlocks"
3. download the last Nightly build
4. download CbLauncher ver 0.1.3
5. create in desktop CodeBlocks a sub-folder "tool"
6. unzip the files of the Nightly build in desktop CodeBlocks
7. unzip CbLauncher in desktop CodeBlocks
8. copy from installed version to desktop the folder "MinGW" in "tool" and the folder "docs" in the same path in the desktop folder
9. copy the desktop folder in a USB key
10. run CbLauncher: this launcher create a folder AppData
11. go to Setting and set the name and the folder of Help file (codeblocks.chm) and check for open it with F1
12. go to Settings and set the path of the folder MinGW (inside "tool")
13. finally uninstall "codeblocks-10.05mingw-setup.exe"
14. if You like a localization, create a folder "locale" in \CodeBlocks\share\CodeBlocks\de_DE or fr_FR and copy in this sub-sub-folder the appropriate file "_codeblocks.mo".
15. if You move this folder from USB to Hard Disk or and external HD, delete "AppData", launch CbLauncher again and set, in Settings, the nome and path of help file and the path of MinGW.

btw
I have checked the Windows Registry with Regshot 1.8.2 before and after run the portable version: this build write various key in
HKU\...\Software\Classes\CodeBlocks.* (various files extension) or
HKU\..._Classes\CodeBlocks.* (various files extensions).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Portable Code::Blocks
« Reply #44 on: August 28, 2010, 09:23:16 pm »
I have checked the Windows Registry with Regshot 1.8.2 before and after run the portable version: this build write various key in
HKU\...\Software\Classes\CodeBlocks.* (various files extension) or
HKU\..._Classes\CodeBlocks.* (various files extensions).
This is true but only happens if you select this option in a C::B dialog asking you so (register file extensions) and can be done at any time again through C::B's options. That's the only registry use to my knowledge and also just because there is no other choice. So: You can safely ignore this part for a portable install and leave it to the user's decision.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ