Author Topic: Can I make C::B portable?  (Read 39770 times)

Squeller

  • Guest
Re: Can I make C::B portable?
« Reply #15 on: November 19, 2006, 09:41:09 pm »
OK, I've put the contents of %appdata%\codeblocks\ into my codeblocks directory. Those are:

Code
cbKeyBinder04v110.ini
cbKeyBinder04v19.ini
cbKeyBinder10v111.ini
cbKeyBinder10v111.ini.bak
codesnippets.xml
default.conf
DragScroll.ini

...and a "share" folder with subfolders which are all empty. After deletion of the %appdata%\codeblocks\share\ folder and any startup of c::b, I get the error message:

"Can not enumerate files in directory U:\Dokumente und Einstellungen\User\Anwendungsdaten\codeblocks\share/codeblocks/plugins (error 3: System can't find path)"

Why does it want that empty directory?

Also, if finding all necessary config files in $(codeblocks) dir, why does it create these under %appdata% again? (Though they also appear in the codeblocks directory)?

Code
share\ (it creates this dir again, but not the plugins subfolder)
cbKeyBinder10v111.ini
codesnippets.xml
« Last Edit: November 19, 2006, 09:44:39 pm by Squeller »

darus

  • Guest
Re: Can I make C::B portable?
« Reply #16 on: November 20, 2006, 08:30:20 am »
I can't make it work too.

When I create an empty default.conf in CB folder and run CB, it pops an exception dialog:

Code
The application encountered an error at sdk\configmanager.cpp, on line 131.
The error message is:

TinyXML error: Error document empty.
In file: default.conf
At row 0, column 0.

Code::Blocks Version revision 3240 (gcc 3.4.5, build: Nov 16 2006 23:32:14)


Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Can I make C::B portable?
« Reply #17 on: November 20, 2006, 11:10:36 am »
I can't make it work too.
When I create an empty default.conf in CB folder and run CB, it pops an exception dialog:

you should copy an already created an valid config file there

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Can I make C::B portable?
« Reply #18 on: November 20, 2006, 03:14:58 pm »
...and a "share" folder with subfolders which are all empty. After deletion of the %appdata%\codeblocks\share\ folder and any startup of c::b, I get the error message
Quote
Also, if finding all necessary config files in $(codeblocks) dir, why does it create these under %appdata% again? (Though they also appear in the codeblocks directory)?
Because "user plugins" were added a long time after everything else, and because the person adding them was not the same as the person writing the other path handling functions. Such things happen.
Because nobody ever uses the relocation feature, we don't see the error, and we don't get feedback on it (until now). Therefore, things like that may go unnoticed. Even if we use the feature (as I did a few days ago), the problem doesn't show up on developers' machines either, as we do have those folders in our profile folders.

Quote
cbKeyBinder10v111.ini
codesnippets.xml
Those are not strictly Code::Blocks, these belong to contrib plugins. Quite likely, they suffer from the same problem as the "empty folder" one, though.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Can I make C::B portable?
« Reply #19 on: November 20, 2006, 06:22:11 pm »
All those issues should be fixed now. I've tried launching Code::Blocks with no config at all, re-launch it in "normal" mode, and relaunch it in "relocated" mode, removing all installed files from the PC first.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Squeller

  • Guest
Re: Can I make C::B portable?
« Reply #20 on: November 21, 2006, 09:34:30 am »
I've put c::b plus it's config files to a computer with no c::b on it.

1. Startup was fine.
2. Created a console application with the wizard.
3. Edited the source code.

After a couple of seconds an error message appeared:

Code
09:25:16: Failed to create a temporary file name (error 267: der Verzeichnisname ist ungültig.)
09:25:16: can't open user configuration file.

Those are my files in the codeblocks folder:

Code
cb_console_runner.exe
cbKeyBinder04v110.ini
cbKeyBinder04v19.ini
cbKeyBinder10v111.ini
cbKeyBinder10v111.ini.bak
codeblocks.dll
codeblocks.exe
codesnippets.xml
default.conf
DragScroll.ini
exchndl.dll
mingwm10.dll
wxmsw26u_gcc_cb.dll
wxscintilla.dll

EDIT: In order to make it portable, I probably have to narrow the default.conf down to only some necessary settings, including the compiler relative path...
« Last Edit: November 21, 2006, 09:41:22 am by Squeller »

Squeller

  • Guest
Re: Can I make C::B portable?
« Reply #21 on: November 21, 2006, 04:32:32 pm »
I think this is not perfect. If I copy the c::B to another computer without the default.conf, it does create on in %appdata%. If I put that one into the cb folder, I get the previously mentioned error message. So I think a) c::b cannot live without the default.conf in %appdata%\c::b, and b) I think there is some invalid (absolute?) paths saved in the .conf file.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Can I make C::B portable?
« Reply #22 on: November 21, 2006, 05:10:04 pm »
I could imagine the source of this error is one of the contrib plugins, because I saw no such error when I tried with "plain vanilla" Code::Blocks and only the standard core plugins loaded.

Could you please try disabling or deleting one by one and see if the error ceases?
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Squeller

  • Guest
Re: Can I make C::B portable?
« Reply #23 on: November 21, 2006, 07:06:14 pm »
This is a hard task, because I haven't found an easy way to reproduce the error message. It does just appear sometimes.
OK, with dragscroll.dll turned off, the error message does appear more rarely now (with dragscroll.dll turned on, it happens e.g. any time after changing an editor setting).

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Can I make C::B portable?
« Reply #24 on: November 21, 2006, 07:36:54 pm »
I suspect this is caused by the merge timer in KeyBinder.
KeyBinder and Dragscroll know nothing about portable directories.

I cannot look at it until the last week of November.
Disable Dragscroll and KeyBinder to see if the problem goes away.
« Last Edit: November 21, 2006, 08:41:34 pm by Pecan »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Can I make C::B portable?
« Reply #25 on: November 21, 2006, 08:44:31 pm »
DragScroll and KeyBinder get their conf directory with the following.

Code
    //memorize the key file name as {%HOME%}\cbKeyBinder+{vers}.ini
    m_sKeyFilename = ConfigManager::GetConfigFolder();

KeyBinder looks to merge dynamic menu keys to its .ini file every 15 seconds,
backs up the .ini to .ini.bak and writes the new merged .ini file.

I don't see the problem, but I can only test this after November.

Squeller

  • Guest
Re: Can I make C::B portable?
« Reply #26 on: November 22, 2006, 09:06:56 am »
Thanks, Pecan. The timer behaviour explains, why I wasn't easily able to reproduce it. OK. I've moved all my config files to c::b dir again; looks like it's solved... I'll test more thoroughly later the day,,,

Squeller

  • Guest
Re: Can I make C::B portable?
« Reply #27 on: November 22, 2006, 08:59:44 pm »
Pecan, you're right. I have disabled both plugins and c::b is now fully portable without any problems afaics. I've worked 2 hrs. without a problem with it.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Can I make C::B portable?
« Reply #28 on: December 31, 2006, 10:51:00 pm »
The setup of ConfigManager::GetConfigFolder() variable ConfigManager::config_folder in the method ConfigManager::InitPaths() needs work to make it portable.

Tim S

PS: I trying to write a small patch to make ConfigManager::GetConfigFolder portable right now.

Uploaded patch
[ Patch #1783 ] GetConfigFolder patch to make it work in a Portable win32
https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=1783&group_id=5358

NOTE: If you are talking about this patch please mention Patch #1783 in the message.
« Last Edit: January 01, 2007, 11:45:11 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

stretchboom

  • Guest
Re: Can I make C::B portable?
« Reply #29 on: January 01, 2007, 11:37:09 pm »
Hi.
I've tested the steps with cb_20070101_rev3446_win32 and borland's bcc55.

I extracted the file, started cb and wanted to disable DragScroll and Keyboard shortcuts plugin. After a click on disable button codeblocks crashs. Then i started it again and this time i could disable it. The same with the other plugin.

After that i copied content of %appdata%\codeblocks\ to my codeblocks folder and configured relative paths by using $(codeblocks). Now i have running a portable version.  :D

Just want you to inform about the crash and give a little summary.