Pach me Windows Vista/2008/7

Started by Gregg, August 11, 2010, 11:26:27 PM

Previous topic - Next topic

Gregg

You know, patch.exe has given me hell since I started using it on Vista and beyond. It requires admin and I just don't run admin much when prepping source or building even.

Clicking OK on the UAC warning also doesn't work so this has been a thorn in my side for some time.   :'(

But I finally found the thorn and am no longer in pain ... renamed the damn file to pach.exe  ;D

mario

What? That simply solves that problem? Only name changing? What the heck? Is that a reserved word inside the windows code?  :o

Gregg

Yes, that seems to solve the problem as scary as that is. When you think of the binary abilities of patch you understand the concern. It does not work on just text files ... supposedly. I've never played with patching binaries but again, supposedly, you can.

Hello, we're Microsoft, security by keyword...!

However, since I build on XP as much or more than Vista and beyond, I'll never remember to use the different name on what machine ... that's why I made the dumb SU4Win.

I'm just tired of having  to stop, open up a console as admin and CD\ing my way back to where I was just so I could type;

patch -p1 -b < filename.patch

I need to do that for no other part of the process, so that is why I made su4w. Stupid as it is ... did it work for you?

Now in your email on su4w you said "I think you like linux" ... lol ... so far from the truth that is! I do however feel, if Windoze is going to be like Linux this way, they should at least give the same tools .... but no.


mario

Yepp SU4Win works for me, but I open the commandlines for compiling with run as Admin, so I don't have to worry about all the permission stuff.

Gregg

Yes, and I could do same but;

I personally hate cd-ing around in the console, I have nightmares that night of being back in '91 cd-ing all over in DOS 5 cause you had to back then.

I keep a command prompt shortcut (or VC9 prompt shortcut) at the top of every build folder. If you remove the working directory in the shortcut it will open in the directory launched. This saves a lot of cd-ing all over. Give it a try, you'll see.

Now try it using "Run as Administrator," it completely ignores pretty much everthing and starts up in c:\user\system regardless of where you started from.

In all cases BUT using patch, I never need admin rights. In XP obviously I don't. Anyhow, SU4Win will launch an Admin'd console in the current directory you call it from saving all that cd-ing around.

Make sense now?




mario

Well I found a better solution.

Create a text file in the same directory with the name patch.exe.manifest

<?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>


Save as UTF8. Now it works. Well I have to test if it is possible to embedd the manifest than good bye $%&# asking for admin permission :)