Jump to content











Photo
* * * * * 1 votes

%HostOS% For Windows 8 32/64-Bit


  • Please log in to reply
8 replies to this topic

#1 Max_Real Qnx

Max_Real Qnx

    Gold Member

  • Patrician
  • 1382 posts
  • Location:Istanbul
  • Interests:To be or not to be that is the question.
  •  
    Turkey

Posted 27 January 2013 - 12:40 PM

Hi WinBuilder Developer ;)
 
Message,%HostOS%,INFORMATION

 

 

http://www.maxrealqn...uilderBug1.html

 

I found one or two minor errors. This code gives a blank output on the Windows 8. And why the WinBuilder does not support hidden files ? (It does not matter to me. However, it arouses the curiosity.) Kind regards :hi:



#2 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 27 January 2013 - 04:18 PM

The answer is simple: When WinBuilder 82 has been published, a regular Win8 host was not yet known. :cheers:

 

Here the code to evaluate %HostOS%:

procedure GetWinVersion;
var
  osVerInfo: TOSVersionInfo;
  majorVersion, minorVersion: Integer;
begin
  osVerInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
  if GetVersionEx(osVerInfo) then
  begin
    minorVersion := osVerInfo.dwMinorVersion;
    majorVersion := osVerInfo.dwMajorVersion;
    if majorVersion <= 4 then
      HostOS := 'NT'
    else if (majorVersion = 5) and (minorVersion = 0) then
      HostOS := 'W2000'
    else if (majorVersion = 5) and (minorVersion = 1) then
      HostOS := 'XP'
    else if (majorVersion = 5) and (minorVersion = 2) then
      HostOS := 'W2003'
    else if (majorVersion = 6) and (minorVersion = 0) then
      HostOS := 'Vista'
    else if (majorVersion = 6) and (minorVersion = 1) then
      HostOS := 'Win7';
  end;
end;

The 'Hidden' issue:

Never intended to have WinBuilder files hidden. I do not have any opinion what happens when an Admin starts a hidden App, or the app wants to access a hidden file.

 

Peter



#3 Max_Real Qnx

Max_Real Qnx

    Gold Member

  • Patrician
  • 1382 posts
  • Location:Istanbul
  • Interests:To be or not to be that is the question.
  •  
    Turkey

Posted 28 January 2013 - 12:20 PM

Hi pscEx :) Thank you for your reply. Can you develop a new function for the %HostOs%. I do not understand Delphi programming language. But I think, it should have a similar code like to filegetversion code of the autoit. In this way, you can create yourself equality with the value that you obtained. Am I wrong ? The hidden files issue are not very important. But do not you think that something is going wrong ? Kind regards :hi:

#4 paraglider

paraglider

    Gold Member

  • .script developer
  • 1739 posts
  • Location:NC,USA
  •  
    United States

Posted 28 January 2013 - 12:36 PM

As long as you only want to detect client os then your code is ok. However server os like w2008r2, w2012 share the same major / minor versions as the client os. You also should look at wProductType:

 

http://msdn.microsof...3(v=vs.85).aspx


  • Max_Real Qnx likes this

#5 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 28 January 2013 - 06:04 PM

As long as you only want to detect client os then your code is ok. However server os like w2008r2, w2012 share the same major / minor versions as the client os. You also should look at wProductType:

 

http://msdn.microsof...3(v=vs.85).aspx

You are right, but IMHO it is not reasonable to create a new variable %HostOSType% telling the user about the functionality (client / server / domain controller) of the host in the network.

I do not know any WinBuilder script where this information is needed.

 

BTW: The title of this topic tells about 'latest stable ...'. This is currently WinBuilder 082. Max's video shows use of 083.

To avoid misunderstandings: 083 is not supported by the WinBuilder author Nuno Brito. It is currently only tolerated by him.

BTW2: For me, I added Win8 detection in my 'private' WinBuilder 083.

 

Peter



#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15401 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 28 January 2013 - 07:03 PM

Fixed snippet ;):
 
 
 
procedure GetWinVersion;
var
osVerInfo: TOSVersionInfo;
majorVersion, minorVersion: Integer;
begin
osVerInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
if GetVersionEx(osVerInfo) then
begin
minorVersion := osVerInfo.dwMinorVersion;
majorVersion := osVerInfo.dwMajorVersion;
if majorVersion <= 4 then
HostOS := 'NT'
else if (majorVersion = 5) and (minorVersion = 0) then
HostOS := 'W2000'
else if (majorVersion = 5) and (minorVersion = 1) then
HostOS := 'XP'
else if (majorVersion = 5) and (minorVersion = 2) then
HostOS := 'W2003'
else if (majorVersion = 6) and (minorVersion = 0) then
HostOS := 'Vista or Server 2008, cannot say'
else if (majorVersion = 6) and (minorVersion = 1) then
HostOS := 'Win7 or Server 2008 R2, cannot say';
else if (majorVersion = 6) and (minorVersion = 2) then
HostOS := 'Win8 or Server 2012, cannot say';


end;
end;

:jaclaz:

:cheers:
Wonko

#7 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 28 January 2013 - 07:10 PM

That you can download since several hours from http://nativeex.exec...Builder_83.zip. And you can use it, provided you have the friends password.

 

About 'cannot say': see my post above.

 

Peter :smart:



#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15401 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 28 January 2013 - 07:46 PM

And you can use it, provided you have the friends password.


NO secret hand-shake? :unsure:

:cheers:
Wonko

#9 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 28 January 2013 - 08:13 PM

Serious multiPE users have no issues! :smart:

 

Peter :cheers:






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users