What is patch file in windows

Patching

An application that has been installed using the Microsoft Windows Installer can be upgraded by reinstalling an updated installation package (.msi file), or by applying a Windows Installer patch (an .msp file) to the application.

A Windows Installer patch (.msp file) is a self-contained package that contains the updates to the application and describes which versions of the application can receive the patch. Patches contain at a minimum, two database transforms and can contain patch files that are stored in the cabinet file stream of the patch package. For more information about the parts of a Windows Installer patch package, see Patch Packages.

Servicing applications by delivering a Windows Installer patch, rather than a complete installation package for the updated product can have advantages. A patch can contain an entire file or only the file bits necessary to update part of the file. This can enable the user to download an upgrade patch that is much smaller than the installation package for the entire product. An update using a patch can preserve a user customization of the application through the upgrade.

**Windows Installer 4.5 and later:В В **

Beginning with Windows Installer 4.5, developers can mark components in a patch with the msidbComponentAttributesUninstallOnSupersedence value in the Component table. If a subsequent patch is installed, marked with the msidbPatchSequenceSupersedeEarlier value in its MsiPatchSequence table to supersede the first patch, Windows Installer 4.5 and later can unregister and uninstall components marked msidbComponentAttributesUninstallOnSupersedence to prevent leaving behind unused components on the computer. If the component is not marked with with this bit, installation of the superseding patch can leave an unused component on the computer. Setting the MSIUNINSTALLSUPERSEDEDCOMPONENTS property has the same effect as setting this bit for all components.

**Windows Installer 3.0 and later:В В **

Developers who use Windows Installer 3.0, and author patch packages that have the MsiPatchSequence table can create patch packages that do the following:

  • Use the product baseline cached by the installer to more easily service applications with smaller delta patches. For more information about using the product baseline, see Reducing Patch Size.
  • Skip actions associated with specific tables that are unmodified by the patch. This can significantly reduce the time required to install the patch. For more information about which tables can be skipped, see Patch Optimization.
  • Create and install patches that can be uninstalled singly, and in any order, without having to uninstall and reinstall the entire application and other patches. For more information about uninstalling patches, see Removing Patches.
  • Apply patches in a constant order regardless of the order that the patches are provided to the system. For more information about how the Windows Installer determines the sequence used to apply patches, see Sequencing Patches.
  • Apply patches to an application that has been installed in a per-user-managed context. For more information, see Patching Per-User Managed Applications.

**Windows Installer 2.0:В В **

The MsiPatchSequence table is not supported. Beginning with Windows Installer 3.0, patch packages can contain information that describes the patching sequence for the patch relative to other updates and additional descriptive information.

The recommended method for creating a patch package is to use patch creation tools such as Msimsp.exe and Patchwiz.dll. Developers can generate a patch creation file as described in the section: Creating a Patch Package. The creation of a small update patch is described in the section: A Small Update Patching Example.

Microsoft Windows Installer accepts a Uniform Resource Locator (URL) as a valid source for a patch. For more information about how to install a patch located on a Web server, see Downloading and Installing a Patch From the Internet.

A single Windows Installer patch (.msp file) can be applied to the installation package when installing an application for the first time. For more information, see Patching Initial Installations.

It is not possible to eliminate all circumstances when the application of a patch may require access to the original installation source. However, to minimize the possibility that your patch will require access to the original source, adhere to the points listed in the following section: Preventing a Patch from Requiring Access to the Original Installation Source.

To minimize the possibility that your patch is not broken by a subsequent customization transform, typically the patch is installed first, followed by the customization. Installing customization transforms first, and then the patch, may break the customization. For more information about patching customized applications, see Patching Customized Applications.

Patch Packages

A Windows Installer patch (.msp file) is a file used to deliver updates to Windows Installer applications. The patch is a self-contained package that contains all the information required to update the application. A patch package (.msp file) can be much smaller than the Windows Installer package (.msi file) for the entire updated application. For more information about delivering smaller updates to applications, see Reducing Patch Size.

A patch package contains the actual updates to the application and describes which versions of the application can receive the patch. Patches contain at minimum two database transforms. One transform updates the information in the installation database of the application. The other transform adds information that the installer uses for patching files. The installer uses the information provided by the transforms to apply patch files that are stored in the cabinet file stream of the patch package. A patch package does not have a database like an installation package (.msi file.)

Beginning with Windows Installer version 3.0, patch packages can contain information that describe the patching sequence for the patch relative to other updates in the MsiPatchSequence table and additional descriptive information in the MsiPatchMetadata table.

Users can install applications and updates from a network administrative image. Although patch packages can be applied to administrative installations, the recommended method to deliver updates is to have users install the original application and then apply the patches to the local instance of the application on to their computer. This keeps users in synchronization with the administrative image. If a patch is applied to the administrative installation, all clients of that administrative installation must recache and reinstall the application to receive the update. Until a user recaches and reinstalls, the user is unable to install-on-demand and repair installations from the patched administrative installation.

Читайте также:  Asus fx504g драйвера windows 10

Beginning with Windows Installer 3.0, non-administrators can apply patches to per-user-managed applications after the patch has been approved as trusted by an administrator. For more information on how to do this, see Patching Per-User Managed Applications. Another method is to use least privileged user account patching.

If the AllowLockdownPatch policy has been set, non-administrator users can apply a patch to an existing application while running an installation at elevated privileges. This method is not recommended because it enables untrusted patches to be applied to an application that can run with elevated privileges.

Patch packages are comprised of the following parts. For more information about the construction of patch packages, see Creating a Patch Package.

Summary Information Stream

The summary information stream of the patch package provides information about the identity and purpose of the patch.

The summary information stream holds a minimum of the following:

  • A GUID that uniquely identifies the patch. The GUID for this patch is appended with a list of GUIDs for earlier patches that are replaced by this patch.
  • A semicolon-delimited list of product codes for valid targets for this patch.
  • A semicolon-delimited list of transform substorage names in the order they are to be processed.
  • A semicolon-delimited list of sources for this patch.

Transform Substorage

A patch package contains transforms that can add or remove files, registry entries, user interfaces, and customizations. Transforms are included as substorages in the package. A patch package contains two transforms for each target database. One transform is the actual updates to the installation database and is generated from the differences between the original and updated images of the installation package. The other transform adds entries to the Patch, PatchPackage, Media, InstallExecuteSequence, and AdminExecuteSequence tables. Information in the substorage ties it to a specific UpgradeCode, ProductCode, ProductVersion, and ProductLanguage. A patch package that can be applied to multiple targets contains more than one pair of these transforms.

Cabinet File Stream

The cabinet file stream included in a patch can contain these types of files:

  • Patch files containing the information required to change the old version of the file into the new version. A single patch file can be used to update one or more old versions of a file.
  • Additional files being added to the application that are not present in the old version.
  • An entire replacement file. In the rare case where the new version of a file is smaller than the patch required to update the old version of that file, the new file can be included in its entirety. These are new files that are installed over their old versions.

What is patch file in windows 7

How to patch on Windows?

Given a (source) patch file, what’s the easiest way to apply this patch on the source files under Windows?

A GUI tool where I can visually compare the unchanged-changed source lines would be great.

4 Answers 4

Patch for Windows is what you’re looking for.

Thanks to Macke, a good way to apply a patch file under Windows OS is using Git. As I understood, Git is a version control solution like SVN.

Here is a guideline to apply a patch :

  • First of all, download the latest release of the Windows Git Edition here : GIT
  • With the cmd prompt, change directory to the patch file and files to patch
  • Now you can use the following command line :

Not that since Git 2.3.3 (March 2015), you can use git apply —unsafe-paths to use git apply outside a git repo.

» git apply » was not very careful about reading from, removing, updating and creating paths outside the working tree (under —index / —cached ) or the current directory (when used as a replacement for GNU patch).

The documentation now includes:

By default, a patch that affects outside the working area (either a Git controlled working tree, or the current working directory when » git apply » is used as a replacement of GNU patch) is rejected as a mistake (or a mischief).

When git apply is used as a «better GNU patch», the user can pass the —unsafe-paths option to override this safety check.
This option has no effect when —index or —cached is in use.

So if you have git installed, git apply could help, even outside of any git repo.

What is the format of a patch file?

What does the following mean ?

4 Answers 4

The -u option you used specifies the unified format. In that format the first two lines is a header: — is the original file, +++ is the new file, and the timestamps.

@@ block headers

That is then followed by chunks (change hunks) that starts with the @@ -R,r +R,r @@ syntax.

Those are two ranges, the one with the — is the range for the chunk in the original file, and the one with the + the range in the new file. The R designates the line number where the diff operation is started.

The numbers after the comma are the number of affected lines in each file.

  • Every time you remove a line, the +r number will be smaller than -r .
  • Every time you add a line, the +r number will be bigger than -r
  • Changing a line will add 0 to the +r number. (same scope of lines)

Chunks of code lines

Within these chunks lines are identified as additions or deletions — means delete, + means addition. Lines that did not change in that chunk will have neither + or — front of it.

In your example it means there are two chunks, or sections, that changed between the two files and the lines with + in it are the new ones added, nothing was deleted.

You can find much more information about the syntax by doing a google search for unified diff.

PAE patch updated for Windows 7

This patch allows you to use more than 3/4GB of RAM on an x86 Windows system. Works on Vista and 7, has been tested on Windows Vista SP2 and Windows 7. Instructions and source code included.

98 Comments

Your patch worked great for me, running Windows 7 32bit on Alum MacBook Pro 15″ with boot camp.

Hi, Please can you give me a very easy step by step suggestion for PatchPae. I could not use it. It is confusing for me from the very beginning. Thanks in advance.

Читайте также:  Установка debian поверх windows

click start menue, type, cmd. copy and paste each line in turn.

i can figure it out can u help

me too i patched it then i checked all my drivers then my camera doest work help

Ofir, how did u manage to use pae patch in bootcamp?

Using Windows 7 (x86) with 4GB RAM.

This patch worked for me. Before patching, system showed 3315 MB (or something like that) of RAM. Now it shows all 4 GB.
I’ve tested and yes, all 4GB can be utilized (I was able to use about 4000MB by running several VMWare VMs).

I’m still worried about how this patch will affect system stability.

The only thing you have to worry about is Windows updates. When the kernel is updated, you’ll have to redo the patch on the new file to get the updated kernel.

PatchPae.exe -type loader -o winloadp.exe winload.exe

PatchPae.exe -type loader winload.exe -o winloadp.exe

Winload.exe is the existing file.
Winloadp.exe is the modified file after patching.

I am having the same issue. PatchPae says that the patch failed. It makes a copy of winload.exe and names it winloadp.exe but does not patch the new copy. When I boot with winloadp.exe it still does verification and does not run the patched kernel.

same problem here, the patch of winload.exe to winloadp.exe is failing, although the winloadp.exe file is created.

Chances are, your using a hacked verision of windows to begin with, skip that one since it has to do with signature verification. most Windows bootlegs use a loader to activate, the loader is already hacked.

nope. fully legal versions of windows. PAE patch is broken. I used instructions elsewhere to download the make cert and cert signing tools, then used a different, working, patch to patch the kernel, then signed the change, all working now.

Would you mind elaborating? I’d like to get this patch working as well.

Nox already quoted the link in a previous comment:
http://www.unawave.de/windows-7-tipps/4-gb-patch-selber-machen.html
I pretty much used that page to get mine working

This is terrific. Thank you so much. I was just about switching my desktop to Linux. I have 6GB, but could only access 2.99GB. This came at the right time.

Everything worked as per the readme. But when restarted, windows wont load. There is a blank screen for about 20 seconds and then the system reboots. If I use the original windows configuration, the system boots. Can u tell me what is wrong?

I have this same problem after trying to log on with the PAE Patch. Only thing I see just before the logon screen is a blank black screen. it works with no problems wit ht original configuration. any solutions to that.

Just found that the issue is caused because of the Intel HD Graphics driver. Once the drivers are uninstalled, it boots properly. But with out the driver the display is just too big (only 1024×768 resolution). Any tips to solve this problem?

Awesome, I finally can use all 4gb of my memory. I refuse to use 64 until it becomes more stable.

I can confirm that this does not work with my Intel HD graphics card as well (Mobile 965). System boots into Startup Repair when selecting the patched boot option.

Can anyone tell me how to uninstall this patch as I cannot run my computer with the HD graphics drivers?

Hi babuji, If you have installed this as per given instructions, it would have created two entries in the boot loader and you will have an option to choose loading windows normally during startup. Try logging in using safe mode and see if you can remove the entries for the patch in msconfig (you should find two entries in the boot tab).

Hi Dwarakanath,
I followed the instructions exactly as described in the readme file. No failures. However my situation is the same as you desctied. The computer will not load with the patch but will load without it. Please help.

Dear Babuji, are you having two entries in the bootloader? while starting the system, are you see two options (one will be windows 7 and one will be windown 7 with PAE Patch). choose the windows 7 option and the system will start regularly. Then from msconfig delete the other entry.

Dear Dwarakanath,
I am fine upto the above steps. I had two entries during startup. I used the windows 7 option and the computer started up. I deleted the option with the patch. Everything went ok. Now whenever I try to apply the patch by rigously following the instructions I get two options during startup whereas the computer does not startup with the patch option. Is ther any way to apply the patch and make the computer work?
Regards, babuji

Hi Babuji, I am sorry, but there seems to be no way at this moment. Even I am searching for a way. The only way is to remove the graphic drivers, but that will mean a very low resolution for the system with standard VGA drivers.

Yeah its seems pretty safe to use. But did not get a chance to test it fully since it is not working under HD graphics for me.

I have the same problem. I tried several version of patches to enable more than 4gb ram. It worked untill installed Intel HD graphics driver. Patched kernel with HD driver = BSOD.
Anyone have the solution?

I have the same startup repair problem but i’m working with a sapphire hd6870 and not with the intel thing. copied the readme file precisely but it won’t work. To bad, will continue looking for a way though. Thanks for the blog.

doesn’t work on me also, maybe it’s a kernel side problem. i have a 6.1.7600.16695

all command line worked however it give me a black screen on booting the patched kernel then goes the windows repair.

have also tried UNAWAVE’s patch still no luck
(note: UNAWAVE’s patched ICE kernel version is 6.1.7600.16539 and mine is 6.1.7600.16695 like i said it might be a kernel side problem. should we wait for an update or fix for this too bad)

btw i might have the same specs with the others who suffer the way i do:

core i3
geforce 310m nvidia optimus

maybe intel hd is the problem just like @Dwarakanath said/ kernel version

Thank you!
The patch can be used, but unfortunately my sound card what uses 250 mb of title area is out of order under it!

Читайте также:  Windows 10 pro zosma 2020

Creative SB X-Fi XtremeMusic

i have installed the patch but it show the used memory in windows 3gb &i have 8 gb installed how?

i have windows 7 ent installed at hp probook 4520s after finish the patch it is said sucesfull after restart nothing happened in alocated memory in the task manager

Hi everyone. Can someone explain me how to completely uninstall this patch? I have used instruction attached to patch, but it didn’t worked for me ? Now Win7 see only 2 GB of ram in my computer :/. I removed patched entry from boot tab in ms config but issue is still the same. Also in the bottom right corner of my desktop appeared info witch says: “Test mode, Windows 7 Compilation 7601”.

This guy created a PAE patch and a patch to get rid of any watermarks left on your desktop screen.

I had System Repair on start up after mine did not work. When I was wondering how to uninstall it, I went to System32 and the files were not there, the system repair maybe deleted them. That’s how it was uninstalled for me.

Forget what I said above. Windows 7 (PAE Patched) still appears in Windows boot manager. Anyone who can tell how to completely uninstall it?

any patch/update for optimus powered laptops and sandybridge or later products is much appreciated

The patch works fine for me (Windows 7 Pro 32 bit). But when I am starting with the patched ntkrnl and winload, Windows is talking in Englisch to me (“Starting Windows”) and not in the language that is set in my BCD at the parameter “locale”. When I do not run the patched version, the language is all right like it is set in the parameter “locale”.

Has anyone an idea why it does show all in English and not in the language set at the parameter “locale” in the BCD-file?

no version for xp 32 bits recognize more 3.25 gb?

On Windows XP, some drivers, especially video adapter drivers with onboard RAM, cannot run with the /3GB parameter because they require more address space than the 1 GB kernel address space permits.
art. from msdn

5. bcdedit /copy /d “Windows 7 (PAE Patched)”

Run as administrator when use right mouse on Cmd Icon in Start menu . ^^

I can’t believe ? It’s workiiiiiiiing ? Lot of Thanks ?

After I used patch which was “successful” and rebooted, windows still saying 4gb(3gb useable). Bullshit?

hi
I have a problem
after the restart and start Windows 7 (PAE Patched). I have mesage “Your computer was unable to start” and starting startup repair.
Startup repair is not corrected the problem.
what am i doing wrong and what is the solution?

russian’s Staforce version works on Win7SP1 but is 7200 kernel instead 7201, however when using PaePatch i got the computer unable to start issue. I tried everything that don’t work, i have to blame the issue with ntkrnlpx.exe that patchpae created. Because when switch kernel with staforce boot it don’t work as well until i rename switch back to staforce’s kernel.

sorry i meant 7600 and 7601…

Here’s what i’ve discovered:

The tutorial above missing one important point, which is to make and insert a valid test certificate signing to the patched kernel. Also the Winload.exe patch is totally pointless as it never modify the file to disable checks, that makes cert signing the only way to work.

Staforce is also use this method, to make windows think its a test kernel for developer. For the makecert.exe and signtool.exe, you have to find it in Windows 7 SDK package > Tools section.

Use Google translator as its german language, GL all and happy 32bit until 2020 or 2025

haizzzz i have successfully type all command . However when i restart to choose “Windows 7 PatchPAE ” my pc 8gb ( 3gb usable ) . So sad >,

Hello! Is there a way to make a pae patch to the x86 Windows 8 ntoskrnl ?

Patch appears to require the Microsoft .NET Framework to function.

It seems work, for my system (Asus P5KE-WiFi, Windows 7 SP 1 And 4 GBytes RAM)
Thanks !

works great thank you very much

This patch works great in my win 7. Do you have anything similar to a win 2003 smb server?

Works nicely on my win 7, 4 GB. Thanks man.
But you should fix the following line in your readme.txt:

The minimum timeout is 3 seconds, so it should be:

PatchPae2.exe -type kernel -o ntoskrnx.exe ntoskrnl.exe
Failed.

double checked and re-downloaded the patch, same results. Running Windows 8 Pro x86 fully updated, could there have been a recent kernel update? modify date on kernel says 3/6/2013

I ran the application and my cmd screen flashed and went away so quickly that I couldn’t read it. Will try line by line using the readme file and see what happens then.

Okay, I used it today. I typed in the commands line by line. It appears to have partially worked for me. I built my PC via components, and the Motherboard/Processor supports 32 GB RAM.
Upon using this, I now have 24 GB RAM available, but I still have 8 GB RAM that are not usable. How would I got about correcting this?
Anybody.

I just want to share the solution I found recently:

1. PAEPatch does not work on Windows 7 32 bits if the PC has an Intel HD Graphic controller for Windows 7 32 bits. No way. This is a fact.
2. For their issues with Microsoft (it seems) they do want to “repair” this “bug”
3. The solution is to change the Intel HD graffic controller for Windows 7 into an Intel HD graphic controller for XP. (You will not see the difference)
4. The problem is that Windows 7 rejects the installation of this XP controller
5. Then, it is necessary to patch this XP Intel HD controller to be accepted by Windows 7.

In the following link you have this XP Intel HD contoller already patched to be installed in your Windows 7 PC by changing graphic controller in “devices manager”. You know: Update> browse in your machine>choose in a list..> use my disk…

Then the process is:
1 Have the PAEPatch and install
2. Boot in Windows 32 without PAEPatch
3.Have the XP Intel HD graphic cotroller patched
4. Change the graphic controller
5. Enjoy

Point #2: I wanted to say that Intel DO NOT want to “repair” this “bug”

Оцените статью