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

Can I make C::B portable?

Started by Squeller, November 16, 2006, 02:13:38 PM

Previous topic - Next topic

Squeller

#15
OK, I've put the contents of %appdata%\codeblocks\ into my codeblocks directory. Those are:

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)?

share\ (it creates this dir again, but not the plugins subfolder)
cbKeyBinder10v111.ini
codesnippets.xml

darus

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:


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)


tiwag

Quote from: darus 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:

you should copy an already created an valid config file there

thomas

Quote from: Squeller on November 19, 2006, 09:41:09 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
QuoteAlso, 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.

QuotecbKeyBinder10v111.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."

thomas

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

#20
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:

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:

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...

Squeller

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.

thomas

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

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).

Pecan

#24
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.

Pecan

DragScroll and KeyBinder get their conf directory with the following.


    //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

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

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.

stahta01

#28
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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stretchboom

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.