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

Portable Code::Blocks

(1/19) > >>

Biplab:
Hi All,

I've made a patch against current svn revision to make Code::Blocks portable. A slightly detailed write-up on this can be found from my blog (http://biplab.in/2009/04/creating-portable-version-of-codeblocks/).

With this patch anyone should be able to carry customised C::B settings by copying entire folder of Code::Blocks and plugins settings from %APPDATA%\codeblocks folder, place it to a folder and then pointing it by modifying APPDATA variable before launching C::B.

I've written a small utility which will create an folder structure AppData\codeblocks from the directory it is launched. Then it'll modify APPDATA variable before launching Code::Blocks from same folder.

Now you can copy your entire content of %APPDATA%\codeblocks to AppData\codeblocks folder and copy the folder to any portable drive. Everytime you run codeblocks through cblauncher, your settings will be saved to the folder you are running from. If you don't copy your settings and run C::B through cblauncher it will assume that it's a fresh install and will behave accordingly.

I've created a binary package from revision 5409 to try this out. You can download it from the following link.

--- Quote ---http://files.filefront.com/Portable+CB+5409+bin7z/;13536157;/fileinfo.html
--- End quote ---
Edit 1: If you download this package, extract it to a folder and then double click on cblauncher.exe file.

I've not applied this patch to svn. However I intend to do so if other devs have no objection to this hack.

Patch is attached with this post. CbLauncher source and binary can be downloaded from my blog.

Please post your valuable feedback.

Regards,

Biplab

[attachment deleted by admin]

ollydbg:
I have read your blog article, and I have two binary package in my system. One is nightly build version, the other is the version I build from the svn.

To let the two version work separately, I follow the wiki page:
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_make_Code::Blocks_portable.3F

But as you said, some plug-in setting can't be work in full portable mode. :(

I download your binary package and unpack to my nightly build folder which is located in D:\program files\code blocks.

Then I just run CbLauncher.exe, it will create an empty folder in
D:\Program Files\CodeBlocks\AppData\codeblocks

And even I close C::B, no setting files were saved in these folders. This is a little strange. :(. Should I need to clear the setting file in:
"C:\Documents and Settings\[your_user_name]\Application Data\codeblocks"?

By the way, I suggest when the portable version was running, the console window should be closed.
And another issue it the about dialog shows that it is SVN 0.  :D

See the screen shot.



[attachment deleted by admin]

ollydbg:
I upzip your binary package to D:\PortableCB.

The First time I run CbLauncher.exe, it seems no C::B was running, only an empty folder named AppData was generated.

The second time I run CbLauncher.exe, it will initialize C::B, then after I close C::B, some configuration files were saved in D:\portableCB\AppData\XXX, also, two sub folders were generated.

Here is the folder tree. Is it right?

--- Code: ---D:\portableCB

├─AppData
│  ├─codeblocks
│  └─share
│      └─codeblocks
│          ├─plugins
│          └─scripts
└─share
    └─CodeBlocks
        ├─images
        │  ├─16x16
        │  ├─codecompletion
        │  ├─codesnippets
        │  ├─settings
        │  ├─ThreadSearch
        │  └─wxsmith
        ├─lexers
        ├─lib_finder
        ├─plugins
        ├─scripts
        └─templates
        ......
        ......

--- End code ---

Thanks!

ollydbg:
By the way, I have found the way to hide the console window.

Add this statement:


--- Code: ---#define _WIN32_WINNT 0x0500
......
......


HWND hwnd = GetConsoleWindow();
ShowWindow(hwnd,SW_HIDE);


--- End code ---

Thanks

Biplab:

--- Quote from: ollydbg on April 06, 2009, 03:14:32 pm ---I download your binary package and unpack to my nightly build folder which is located in D:\program files\code blocks.

Then I just run CbLauncher.exe, it will create an empty folder in
D:\Program Files\CodeBlocks\AppData\codeblocks

And even I close C::B, no setting files were saved in these folders. This is a little strange. :(. Should I need to clear the setting file in:
"C:\Documents and Settings\[your_user_name]\Application Data\codeblocks"?

--- End quote ---

It's a bug in CbLauncher. I've fixed it. You can replace your cblauncher.exe file with the attached one. I'll reupload binary package with new cblauncher.exe file.


--- Quote from: ollydbg on April 06, 2009, 03:14:32 pm ---But as you said, some plug-in setting can't be work in full portable mode. :(

--- End quote ---

I have tried with few plugins (DevPak, DragScroll). They are saving their settings to APPDATA pointed directory. But honestly I haven't checked all.


--- Quote from: ollydbg on April 06, 2009, 03:14:32 pm ---By the way, I suggest when the portable version was running, the console window should be closed.
And another issue it the about dialog shows that it is SVN 0.  :D

--- End quote ---

Noted. I'll make this change. Don't worry about SVN 0. It's built from rev 5409. I built this build from source tarball and therefore svn failed to generate any revision number.


--- Quote from: ollydbg on April 06, 2009, 03:44:03 pm ---
--- Code: ---D:\portableCB

├─AppData
│  ├─codeblocks
│  └─share
│      └─codeblocks
│          ├─plugins
│          └─scripts
└─share
    └─CodeBlocks
        ├─images
        │  ├─16x16
        │  ├─codecompletion
        │  ├─codesnippets
        │  ├─settings
        │  ├─ThreadSearch
        │  └─wxsmith
        ├─lexers
        ├─lib_finder
        ├─plugins
        ├─scripts
        └─templates
        ......
        ......

--- End code ---

--- End quote ---

Folder structure is correct. Your settings will be saved under AppData folder. Share folder is being used to load various resources.

Thanks a lot for your feedback. :)


[attachment deleted by admin]

Navigation

[0] Message Index

[#] Next page

Go to full version