News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

compiler plugin works only with admin rights

Started by mariocup, July 20, 2007, 11:26:28 PM

Previous topic - Next topic

mariocup

Hi,

in the compilers Cygwin, GDC, MINGW, MSVC, MSVC8, SDCC the registry is read with key.Open() in read/write mode. This works only with admin rights for users under windows, otherwise you get an error.

So the registry should be opened in read mode with key.Open(wxRegKey::Read):

Example:

    wxRegKey key; // defaults to HKCR
    key.SetName(_T("HKEY_LOCAL_MACHINE\\Software\\Name\\"));
    if (key.Exists() && key.Open(wxRegKey::Read))
    {
     // found; read it
    if (key.HasValue(_T("InstallPath")))
{
key.QueryValue(_T("InstallPath"), m_MasterPath);
        }
     }

rickg22


mariocup

Hi rickg22,

no, I found the problem right now with my PC and Browse Tracks Plugin. Shall I open a bug in berlios for it?




rickg22

Yes, please. Otherwise the bugs get lost in this forum jungle.

MortenMacFly

I can't really reproduce it. I'm running C::B always from a restricted user account (as I am always a restricted user). Not even Power User, just user. It works very well...?!
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]

mariocup

Hi MortenMacFly,

I changed the code for e.g. ARM in read mode so the error is elminated. The problem with the access occurs specially if you start CB for the first time without an existing default.conf.

Here a example the log of browse Tracker (only the compiler with read/write access to the registry issue an error.)


13:10:29: BrowseTracker Plugin Logging Started[0.1.7 2007/06/7]
13:10:29: Argv[0][D:\eigene_dateien\codeblocks-trunk\src\output\codeblocks.exe] Cwd[D:\eigene_dateien\codeblocks-trunk\src\output]
13:10:29: FindAppPath: AbsolutePath[D:\eigene_dateien\codeblocks-trunk\src\output]
13:10:29: CfgFolder[C:\Dokumente und Einstellungen\lumi\Anwendungsdaten\codeblocks]
13:10:29: ExecFolder[D:\eigene_dateien\codeblocks-trunk\src\output]
13:10:29: TrackerCfgFullPath[C:\Dokumente und Einstellungen\lumi\Anwendungsdaten\codeblocks\BrowseTracker.ini]
13:10:29: Menubar[00EDC3C8]idMenuViewTracker[895]
13:10:29: Error: Execution of command 'C:\MinGW\bin\mingw32-gcc.exe --version' failed (error 3: das System kann den angegebenen Pfad nicht finden.)
13:10:29: Error: Can't open registry key 'HKLM\Software\Dev-C++' (error 2: das System kann die angegebene Datei nicht finden.)
13:10:29: Error: Execution of command 'C:\MinGW\bin\mingw32-gcc.exe --version' failed (error 3: das System kann den angegebenen Pfad nicht finden.)
13:10:29: Error: Can't open registry key 'HKCU\Software\Microsoft\Win32SDK\Directories' (error 2: das System kann die angegebene Datei nicht finden.)
13:10:29: Error: Can't open registry key 'HKCU\Software\Microsoft\DebuggingTools' (error 2: das System kann die angegebene Datei nicht finden.)
13:10:29: Error: Can't open registry key 'HKCU\Software\Microsoft\Win32SDK\Directories' (error 2: das System kann die angegebene Datei nicht finden.)
13:10:29: Error: Can't open registry key 'HKCU\Software\Microsoft\MicrosoftSDK\InstalledSDKs' (error 2: das System kann die angegebene Datei nicht finden.)
13:10:29: Error: Can't open registry key 'HKCU\Software\Microsoft\DebuggingTools' (error 2: das System kann die angegebene Datei nicht finden.)



killerbot

well, if you have patches, please post them.
I will apply them, if we don't need write rights, then we should not open something with write rights. It will also be more safe.

mariocup

Hi killerbot,

Mandrav said that he will add me to the committers list, so I will be able to update the documentation for codeblocks. Shall I commit the changes for the sources or better post the patches on berlios?

Biplab

Quote from: mariocup on July 22, 2007, 03:00:22 PM
Mandrav said that he will add me to the committers list, so I will be able to update the documentation for codeblocks. Shall I commit the changes for the sources or better post the patches on berlios?

If you've been given full access to the repo, then you'll be able to commit it. Otherwise pass it to anyone of us and we'll put it in repo. :)
Be a part of the solution, not a part of the problem.

Pecan

Quote from: mariocup on July 22, 2007, 01:06:41 PM
Here a example the log of browse Tracker (only the compiler with read/write access to the registry issue an error.)

Did I accidently leave the BrowseTracker log active, or did you turn it on yourself ?

I really didn't mean to publish BrowseTracker with the log polluting the users screen.

killerbot

Quote from: mariocup on July 22, 2007, 03:00:22 PM
Hi killerbot,

Mandrav said that he will add me to the committers list, so I will be able to update the documentation for codeblocks. Shall I commit the changes for the sources or better post the patches on berlios?

You choose, you can have your very own first commits, or you pass the patch and we commit it ;-)

mariocup

Hi Pecan,

I did no activate any log. I was wondering if there is a option to disable the log window.
In the menu of Browser-Tracker is a small typo: foreward instead of Foreward.

I saw also some typos in the Settings/Environment: To-Do and To-do list. This is not really disturbing, but perhaps you want to change it.

A few days ago I saw that you made changes to the browser Tracker plugin, but did not find any info. I think it would be easier if the index of the wiki page would show something like New, Update for the entries.

Another possibility is to have the nice plugins like ThreadSearch, Browser Tracks under svn (like the Shell extension plugin), so the user can check out them under the contrib directory and make a svn update to see the logs etc., test new features and not searching the forums or the wiki page.

What do the CB team think about that?