[Question.] How do windows update packs recognize version?

Discuss Windows Vista/Server 2008 to Windows 10.
Post Reply
Camwinny
Posts: 36
Joined: Sun Sep 23, 2018 9:31 am

[Question.] How do windows update packs recognize version?

Post by Camwinny »

As the title, how do windows update packs recognize the version of windows?

compgeke
User avatar
Donator
Posts: 3771
Joined: Mon Jun 14, 2010 7:42 am
Location: Napa, CA, USA
Contact:

Re: [Question.] How do windows update packs recognize versio

Post by compgeke »

Code: Select all

#include <windows.h>
#include <stdio.h>

void main()
{
    DWORD dwVersion = 0; 
    DWORD dwMajorVersion = 0;
    DWORD dwMinorVersion = 0; 
    DWORD dwBuild = 0;

    dwVersion = GetVersion();
 
    // Get the Windows version.

    dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
    dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));

    // Get the build number.

    if (dwVersion < 0x80000000)              
        dwBuild = (DWORD)(HIWORD(dwVersion));

    printf("Version is %d.%d (%d)\n", 
                dwMajorVersion,
                dwMinorVersion,
                dwBuild);
}

Camwinny
Posts: 36
Joined: Sun Sep 23, 2018 9:31 am

Re: [Question.] How do windows update packs recognize versio

Post by Camwinny »

compgeke wrote:

Code: Select all

#include <windows.h>
#include <stdio.h>

void main()
{
    DWORD dwVersion = 0; 
    DWORD dwMajorVersion = 0;
    DWORD dwMinorVersion = 0; 
    DWORD dwBuild = 0;

    dwVersion = GetVersion();
 
    // Get the Windows version.

    dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
    dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));

    // Get the build number.

    if (dwVersion < 0x80000000)              
        dwBuild = (DWORD)(HIWORD(dwVersion));

    printf("Version is %d.%d (%d)\n", 
                dwMajorVersion,
                dwMinorVersion,
                dwBuild);
}
Thanks. But I wonder which file is recognized by windows update packs.

Lucas Brooks
Posts: 773
Joined: Sat Oct 20, 2018 11:37 am
Contact:

Re: [Question.] How do windows update packs recognize versio

Post by Lucas Brooks »

What do you mean? It is stored in the registry and in all system files. Open winver and see, winver.exe is a version report tool.

Camwinny
Posts: 36
Joined: Sun Sep 23, 2018 9:31 am

Re: [Question.] How do windows update packs recognize versio

Post by Camwinny »

ComputerHunter wrote:What do you mean? It is stored in the registry and in all system files. Open winver and see, winver.exe is a version report tool.
I mean how the update packs know my windows version. By which file?

Lucas Brooks
Posts: 773
Joined: Sat Oct 20, 2018 11:37 am
Contact:

Re: [Question.] How do windows update packs recognize versio

Post by Lucas Brooks »

Not by file, by the reported kernel version and registry info.

Here is an example:

Code: Select all

	</Action>
	<Action type="If">
		<Condition>
			<VersionComparison property="SYS.WIN.VER" toValue="501" comparison="HigherEqual"/>
		</Condition>
		<IfFalse>
			<Action type="Prompt">
				<Title>Update</Title>
				<Text>This update requires Windows XP (or later) operating systems.</Text>
			</Action>
			<Action type="Quit"/>
		</IfFalse>
	</Action>

DragonWars
User avatar
Posts: 92
Joined: Wed Apr 25, 2018 9:57 am

Re: [Question.] How do windows update packs recognize versio

Post by DragonWars »

changing registry and ntoskrnl modifies desktop build tag and lab, however it doesn't modify winver nt version and build (Version: 6.3 (Build 9600) for example) (build lab gets modified)

Lucas Brooks
Posts: 773
Joined: Sat Oct 20, 2018 11:37 am
Contact:

Re: [Question.] How do windows update packs recognize versio

Post by Lucas Brooks »

I don't think he is trying to edit winver... He might want to install an update that won't install on his version of Windows.

DragonWars
User avatar
Posts: 92
Joined: Wed Apr 25, 2018 9:57 am

Re: [Question.] How do windows update packs recognize versio

Post by DragonWars »

he might be interested in installing a windows 8.1 update on a post-rtm build (9785) like i am
but im more interested in installing vcredist 2015/2017

os2fan2
User avatar
Donator
Posts: 1394
Joined: Sun Dec 30, 2007 8:12 am
Location: Brisbane, Queensland
Contact:

Re: [Question.] How do windows update packs recognize versio

Post by os2fan2 »

Windows gets the version number from registry.

LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Windows CSDVersion = 256 // ie Reg_Dword = 256*sp #
LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion CurrentVersion = 6.1


Winver does not contain the relevant info. Running winver from win31, will give you the wow version (3.95 enhanced), while a winnt version (of any kind) will show the same screen as the latest version.

If you are building a service pack, or need to diddle the service pack to point to a different number, use the first one. I used it first to build sp6 for nt4 (ie set it to 1536), and later to install something that looked for 2k sp1 (ie temp set it to 256). A reboot is required, since it is read on IPOL.

gtgamer468
User avatar
Posts: 340
Joined: Sun Jun 12, 2016 10:35 pm

Re: [Question.] How do windows update packs recognize versio

Post by gtgamer468 »

This is rather interesting. I would like to see if I can mod my copy of Windows version 9875 so that I can port in Windows 8.1 updates. About the redistributes, go back to my thread about debombing build 9900 which later, turned into a discussion of running 9875 and check the second or third most recent post by me.

Lucas Brooks
Posts: 773
Joined: Sat Oct 20, 2018 11:37 am
Contact:

Re: [Question.] How do windows update packs recognize versio

Post by Lucas Brooks »

Not the best idea... You might end up destroying your OS. Editing your version info to install updates will cause catalog and signature problems in some cases. Back up your OS.

os2fan2
User avatar
Donator
Posts: 1394
Joined: Sun Dec 30, 2007 8:12 am
Location: Brisbane, Queensland
Contact:

Re: [Question.] How do windows update packs recognize versio

Post by os2fan2 »

I've done the service-pack trick quite a few times to install various lumps of software, and to see what things show where. It's pretty safe as long as you stick to multiples of 256.

I think the real problem is that the install does not work, and apart from placing the files, you need to run regsvr32 on the DLL files to register them.

Lucas Brooks
Posts: 773
Joined: Sat Oct 20, 2018 11:37 am
Contact:

Re: [Question.] How do windows update packs recognize versio

Post by Lucas Brooks »

10 years ago, I tried to install a SP to my Windows XP that is not designed for it and every time it boots, it is telling me to replace a file and even after replacing the file the error still comes up. So a warning to everybody else, don't try to install SP that is not designed for it and always back things up.

os2fan2
User avatar
Donator
Posts: 1394
Joined: Sun Dec 30, 2007 8:12 am
Location: Brisbane, Queensland
Contact:

Re: [Question.] How do windows update packs recognize versio

Post by os2fan2 »

That's a dllcache problem.

DragonWars
User avatar
Posts: 92
Joined: Wed Apr 25, 2018 9:57 am

Re: [Question.] How do windows update packs recognize versio

Post by DragonWars »

i tried to install wannacry patch for windows 8.1 on post-rtm build 9785 (just for experimenting) but even after changing build number in registry i still get incompatibility error
Image
i also thought of modifying build number in ntoskrnl, but after that, even with test mode, windows will keep starting automatic repair, i tried using disable dse option in advanced boot but still nothing.
can anyone help me?

LuLu
Permanently Banned
Posts: 159
Joined: Mon Dec 12, 2016 5:32 am

Re: [Question.] How do windows update packs recognize versio

Post by LuLu »

did you also "patch" files in SxS folder ?

DragonWars
User avatar
Posts: 92
Joined: Wed Apr 25, 2018 9:57 am

Re: [Question.] How do windows update packs recognize versio

Post by DragonWars »

i didnt modify anything else

can you explain what do i have to patch?

LuLu
Permanently Banned
Posts: 159
Joined: Mon Dec 12, 2016 5:32 am

Re: [Question.] How do windows update packs recognize versio

Post by LuLu »

kernel ...
all the backup sys files are in winsxs folder

also when replacing them should be done with booting in PE or whatever rescue disc...

wyf180
Posts: 34
Joined: Thu Jan 25, 2018 2:52 am

Re: [Question.] How do windows update packs recognize versio

Post by wyf180 »

I had tried to install windows virtual pc(KB958559)on win8 7850,it successfully worked.

gtgamer468
User avatar
Posts: 340
Joined: Sun Jun 12, 2016 10:35 pm

Re: [Question.] How do windows update packs recognize versio

Post by gtgamer468 »

Could you explain how you did it? I always wanted to use Windows XP Mode in Windows 8.

Post Reply