Author Topic: WIN98/9x/others build : registry settings test  (Read 64118 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
WIN98/9x/others build : registry settings test
« on: January 07, 2006, 04:19:46 pm »
Dear All,

Below you can find a link to an ansi build which should run on all win platforms.
More specifially on win9x/Me. The build is based on rev 1667 with a registry patch applied (see other place in this forum for more info). I would like your help/feedback on this.

The Problem :
Currently CB registers the file types in HKEY_CLASSES_ROOT, this creates 2 problems :
 - is forced upon all users of the PC (different users might want different default editors)
 - when you have a restricted user account on the win NT based (winNT/2000/XP/2003) you don't have access to this part of the registry.

Solution:
Starting from win2000 MS offered to have these settings stored in the registry per user, solving the previously mentioned problems) : HKEY_CURRENT_USER\Software\Classes . So we should store the settings there, but since this is not a perfect world, this key probably does not exist on win9x, and in the case it does the question is, will that Windows version consider it and read it in ?
The applied patch will check if that user key exists, if so, it writes the settings at that position, otherwise it writes it at the old global level position.

Things I'd like from those who want to test this (especially win9x):
1) Check if that HKEY_CURRENT_USE\Software\Classes exist on your machine  :  yes/no
2) remove at HKEY_CLASS_ROOT the entries for : (see remark below)
 .cbp .workspace .c .cc .cpp .cxx .h .hh .hpp .hxx    and
CodeBlocks.cbp CodeBlocks.workspace CodeBlocks.c CodeBlocks.cc CodeBlocks.cpp CodeBlocks.cxx CodeBlocks.h CodeBlocks.hh CodeBlocks.hpp CodeBlocks.hxx
3) use the build you can download from the link below (contains all plug-ins and the wx dll), start it up and go to Settings menu -> Environment -> General tab and click on set now
4) check your registry to see where the ended up (the user key or again at the global level)  -> tell me about it please
5) close cb : double click on a cpp file and check if it opens in cb (tell me about it)
6) double click on another cpp file and check if it opens in cb (tell me about it)

In the case you get the error box saying it can't find the fil but actually opens it, that a whole other poblem with DDE, no idea why and how to solve it, but that exist also in the official cb).

REMARK : if you do it like this, you will also lose other information stored at the .cpp .c ... , sometimes additional programs register themselves in there for the open with menu. In case you are in this siutation and you do not want to loose this, then do the test with only the .cbp or .workspace files (but hey, we all want cb to open them ;-) )


The LINK : http://users.pandora.be/lieven.de.cock/CodeBlocks/CB_ansi_rev1667.7z

Many many thanks for your help,
Lieven


Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: WIN98/9x/others build : registry settings test
« Reply #1 on: January 07, 2006, 06:48:18 pm »
The LINK : http://users.pandora.be/lieven.de.cock/CodeBlocks/CB_ansi_rev1667.7z
Hmm... I have a bad feeling downloading from a server with that name...  :lol:
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Maciek

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: WIN98/9x/others build : registry settings test
« Reply #2 on: January 08, 2006, 12:11:45 am »
WIN98SE here.

1) yes
2) done
3) I did this, but there were some errors. Here you can see what it looked like:



The polish sentence you can see means: "Registry key is not valid" (most probably because of that double backslash)

4) the settings were at user key

5) and 6) files don't open in cb.

Hope that helps.
« Last Edit: January 08, 2006, 12:14:44 am by Maciek »

Offline duncanka

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: WIN98/9x/others build : registry settings test
« Reply #3 on: January 08, 2006, 04:15:24 am »
1) yes
2) done
3) I did this, but there were some errors.
...
4) the settings were at user key

5) and 6) files don't open in cb.

Hope that helps.
I got identical results, also on Win98SE.
It might interest you to know what I do in fact have in this section of the registry.  I have the following registry subkeys in it:
  • Applications-->netscape.exe-->shell-->open-->command: (Default)="C:\Program Files\Netscape\Netscape 8\netscape.exe" "%1"
  • CLSID-->(A bunch of stuff pertaining to the Windows theme in use - Recycle Bin icon, My Computer icon, etc.)
  • MIME-->DataBase-->Content Type
  • Software\Microsoft\MediaPlayer\Preferences: AcceptedPrivacyStatement=1
Nothing that appears to be related to file extensions, unfortunately, except maybe the netscape thing (I have no idea what it means).

Hope that helps, too.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: WIN98/9x/others build : registry settings test
« Reply #4 on: January 08, 2006, 09:47:29 am »
Lieven,

there is no need to go through this hassle with win98. You seem to forget that it's not a multi-user OS, not in the real sense of the term. HKEY_CLASSES_ROOT is used for windows 98 file associations.
Here is an enlightening read on the subject...
Be patient!
This bug will be fixed soon...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
Re: WIN98/9x/others build : registry settings test
« Reply #5 on: January 08, 2006, 10:36:48 am »
thanks for the feedback,
Indeed, there was a bug in the code, so that there were 2 backslashes for the rebuild command. I fixed my code (together with another little bug).

@Yiannis : the reason why I tried it out first like this, so that I did not have to check on the windows version.
But it seems I will have to do it like this, damn.
So I will adjust the code and create a new build.
It seems when on win9x you have that user key, it might be there because some other program had put stuff there although it shows win98 does not look at it to determine the file association. Somewhere else in this thread someone claimed multi user was introduced either in win98SE2 or in winME.
Anyone with WinME ???

Since this key was introduced in win2000, I will now assume it does not exist in Win NT4, anyone who still uses this, please give the above mentioned build a try ??? (maybe some service pack introduced it, but as said :assumption : it does notexist and it's not being looked at).

Therefor : new algo :
if on win9x/Me/winNt4 -> root key, otherwise user key. Will create a new build with this mechanism today, if you all could please try that one again then, many thanks, I owe you all (those who have tested and provided feedback, not all of those who just read this ;-) ) a beer.

Cheers,
Lieven

Offline artoj

  • Almost regular
  • **
  • Posts: 206
  • Location: Supporting my team
    • http://ajonsson.kapsi.fi/
Re: WIN98/9x/others build : registry settings test
« Reply #6 on: January 08, 2006, 10:52:50 am »
From Windows 2000 docs

Quote
In Windows NT 4.0 and earlier, HKEY_CLASSES_ROOT displayed the data only in HKEY_LOCAL_MACHINE\SOFTWARE\Classes. The current, merged configuration lets the system independently register program classes for each user. This feature is known as per-user class registration.

This was introduced in Win2K, so none of the NT 4.0 service packs change this.
« Last Edit: January 08, 2006, 10:54:39 am by artoj »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
Re: WIN98/9x/others build : registry settings test
« Reply #7 on: January 08, 2006, 10:56:28 am »
thanks for the info.

Can someone with WIN2000 tell me what it reports when you execute winver ??

Is that already version 5 ?
(Win XP is version5.1.)

Offline artoj

  • Almost regular
  • **
  • Posts: 206
  • Location: Supporting my team
    • http://ajonsson.kapsi.fi/
Re: WIN98/9x/others build : registry settings test
« Reply #8 on: January 08, 2006, 11:00:47 am »
Windows versions:

4.0.950    Windows 95
4.0.1111    Windows 95 OSR 2 & OSR 2.1
4.0.1212    Windows 95 OSR 2.5
4.1.1998    Windows 98
4.1.2222    Windows 98 Second Edition
4.9.3000    Windows Me

Windows NT versions:

4.0.1381    Windows NT 4.0
5.0.2195    Windows 2000
5.01.2600    Windows XP or Windows XP 64-Bit Edition Version 2002 (Itanium)
5.02.3790    Windows Server 2003
   or Windows XP x64 Edition (AMD64/EM64T)
   or Windows XP 64-Bit Edition Version 2003 (Itanium)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
Re: WIN98/9x/others build : registry settings test
« Reply #9 on: January 08, 2006, 11:04:43 am »
thanks artoj, you're the greatest.

Offline artoj

  • Almost regular
  • **
  • Posts: 206
  • Location: Supporting my team
    • http://ajonsson.kapsi.fi/
Re: WIN98/9x/others build : registry settings test
« Reply #10 on: January 08, 2006, 11:10:37 am »
Oh, and you shouldn't use the last four numbers, just the first two, mening major and minor versions. The last four numbers define which service pack (if any) is installed.

So in pseudo code

Code
if (Version.Major == 5) and (Version.Minor == 0) {
  isWin2k = true;
}
« Last Edit: January 08, 2006, 11:16:03 am by artoj »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
Re: WIN98/9x/others build : registry settings test
« Reply #11 on: January 08, 2006, 11:18:32 am »
New build for a new test : http://users.pandora.be/lieven.de.cock/CodeBlocks/CB_ansi_rev1667(2ND-try).7z

This the the code of the algo :
   // first determine which key to use
   // win9x/ME/NT 4 ->ROOT, others USER
   wxString BaseKeyName(_T("HKEY_CURRENT_USER\\Software\\Classes"));
   int Major = 0;
   int WinFamily = wxGetOsVersion(&Major, NULL);
   if((WinFamily == wxWIN95) || ((WinFamily == wxWINDOWS_NT) && (Major < 5)))
   {
      BaseKeyName = _T("HKEY_CLASSES_ROOT");
   }

Don't use win 3.11 ;-)

I debugged it on in XP, there it seems to work.

Patiently waiting for the test results. Same pocedure as described above, but with the new build.


Thanks,
Lieven

Offline artoj

  • Almost regular
  • **
  • Posts: 206
  • Location: Supporting my team
    • http://ajonsson.kapsi.fi/
Re: WIN98/9x/others build : registry settings test
« Reply #12 on: January 08, 2006, 12:10:06 pm »
Using Windows ME.

Things I'd like from those who want to test this (especially win9x):
1) Check if that HKEY_CURRENT_USE\Software\Classes exist on your machine  :  yes/no

Yes, contains only CLSID subkey.

2) remove at HKEY_CLASS_ROOT the entries for : (see remark below)
 .cbp .workspace .c .cc .cpp .cxx .h .hh .hpp .hxx    and
CodeBlocks.cbp CodeBlocks.workspace CodeBlocks.c CodeBlocks.cc CodeBlocks.cpp CodeBlocks.cxx CodeBlocks.h CodeBlocks.hh CodeBlocks.hpp CodeBlocks.hxx

Done.

3) use the build you can download from the link below (contains all plug-ins and the wx dll), start it up and go to Settings menu -> Environment -> General tab and click on set now

Done.

4) check your registry to see where the ended up (the user key or again at the global level)  -> tell me about it please

HKEY_CLASSES_ROOT

5) close cb : double click on a cpp file and check if it opens in cb (tell me about it)

Opens correctly.

6) double click on another cpp file and check if it opens in cb (tell me about it)

Opens correctly.

Now, where's my beer? :P
« Last Edit: January 08, 2006, 04:41:53 pm by artoj »

Offline duncanka

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: WIN98/9x/others build : registry settings test
« Reply #13 on: January 08, 2006, 09:09:40 pm »
Just tried it on Win98SE.  Same results as artoj.
Still needs someone to test on Win2k+, though, to make sure that still works.

Offline duncanka

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: WIN98/9x/others build : registry settings test
« Reply #14 on: January 11, 2006, 01:43:42 am »
Below you can find a link to an ansi build which should run on all win platforms.
More specifially on win9x/Me. The build is based on rev 1667 with a registry patch applied (see other place in this forum for more info).
Are there any plans to make any more SVN builds for ANSI/Win98, or at least to have a .cbp file that can be used for such a build, given that you've put in the work to make the code compatible with Win98?