Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

patch not working in Vista

Help
2008-01-30
2013-11-23
  • Help. I've gotten patch and am trying to use it to apply a patch under Vista, but everything I try results in patch running and nothing happening. It stays running (seemingly indefinitely) until I press CTRL-C to stop it.

    Thanks,

    George

     
    • Keith Marshall
      Keith Marshall
      2008-01-30

      What is your command line? patch' reads the patch source fromstdin'; did you redirect it? Perhaps it is just waiting for you to type the patch input.

       
      • Panthrax
        Panthrax
        2008-06-20

        When I start patch.exe Vista asks for confirmation to allow or deny patch.exe execution because of the unkown publisher. Now, when execution is allowed, a command line window opens that awaits input and can be quitted by pressing Crtl-C.

        However, the parameters aren't passed to patch.exe. The following doesn't work:

        patch.exe < Filename.patch

        Any ideas?

         
        • Eric Lemings
          Eric Lemings
          2008-12-18

          Has this issue been resolved? I just installed patch.exe and it requires administrator privileges to install, not to mention to run a simple patch --version or `patch --help' command. It shouldn't work that way, right?

          Thanks,
          Eric.

           
          • msec
            msec
            2009-04-06

            There's a fairly straightforward workaround:

            in the same folder as patch.exe, add a file named 'patch.exe.manifest' which has the following content:

            <pre>
            <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
            <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
            <security>
            <requestedPrivileges>
            <requestedExecutionLevel level="asInvoker"/>
            </requestedPrivileges>
            </security>
            </trustInfo>
            </assembly>
            </pre>

            Two things need to be borne in mind: you need elevated privileges to create this file in the right place (otherwise it ends up in your personal virtual store, which is not the same folder); also, check there is no 'run in compatibility mode' setting on patch.exe before you create the manifest.

             
            • msec
              msec
              2009-04-06

              Please note that the <pre> and </pre> tags in my previous post should NOT be part of the file content - I didn't read the 'HTML tags will display in your post as text' warning carefully enough :(

               
    • Allan Lehtla
      Allan Lehtla
      2008-12-26

      you can also disable UAC in vista for avoid this administrator privileges message

       
  • Sune Karlsson
    Sune Karlsson
    2010-09-19

    Unfortunately this does not work on 64-bit Vista. After adding the patch,
    running patch results in a prompt saying (loosely translated from Swedish)
    "The requested action requires a privilege elevation" and then the program
    terminates. The only way to run patch seems to be "as administrator". Not
    good. And why does it need elevated privileges? All it does is twiddle some
    files (in a highly useful way).

     
  • msec
    msec
    2010-09-20

    Unfortunately this does not work on 64-bit Vista.

    Have you applied the workaround described in posts 6 and 7 in this thread?

    Patch.exe does not need admin privileges; it's the heuristics built into Vista
    which assumes that executables which do not have a manifest and have certain
    strings in their name - such as 'patch' and 'setup' - which causes the
    elevation prompt. Adding the manifest above stops Vista applying this
    heuristic; patch.exe then runs using the invoker's privilege.

     
  • Sune Karlsson
    Sune Karlsson
    2010-09-25

    Yes I applied the workaround, but it didn't "take" immediately. It works after
    rebooting.

     
  • Jay Satiro
    Jay Satiro
    2010-09-26

    You have to touch the file to apply it immediately. So if you create a
    manifest like patch.exe.manifest:

    touch patch.exe

    You'll need three manifests for gnuwin32 utils,

    patch.exe.manifest

    install.exe.manifest

    install-info.exe.manifest

     
  • Den Gordo
    Den Gordo
    2013-11-23

    I could not make it work on my Win 7 64bit even with manifest files. When I run even "patch --version" command it asks to allow/deny and then open another console window with patch.exe file.
    So I end up installing Cygwin for 64-bit versions of Windows and it works fine! You just need to find "patch" package during installation and don't forget to add path to you bin directory in "Environment Variables: System variables: Path"