tags:

views:

39

answers:

1

I'm writing an app that allows you to script the buttons from a wiimote into actions on your PC. It currently supports all of the features of the main remote control, except for the speaker.

Now, I'm running in to trouble when I run it on Vista with UAC turned on.

Any time a UAC'd window has focus, my app fails to move the mouse successfully. For instance, when an installer is run, I have to navigate it with the keyboard.

  1. Will running the app as administrator solve my problem? (At one point in time, I was able to successfully move the mouse over a UAC-password-entry box)

  2. How do I build a manifest that will tell windows to "run as administrator"?

  3. How do I embed this manifest into my app, if I'm strongly naming my assembly?

  4. How do I sign my application with an Authenticode cert?

EDIT:

Ok, so after some more extensive research, I have found:

http://msdn.microsoft.com/en-us/library/bb756929.aspx

<requestedExecutionLevel
    level="asInvoker|highestAvailable|requireAdministrator"
    uiAccess="true|false"/>

However, the article says:

Applications with the uiAccess flag set to true must be Authenticode signed to start properly. In addition, the application must reside in a protected location in the file system. \Program Files\ and \windows\system32\ are currently the two allowable protected locations.

I have edited the question to reflect the new developments.

+2  A: 

3: This depends on your development environment. If you cant find an option to embed a manifest, you can instead deploy it as an external manifest file alongside your .exe. For example, if your .exe is called MyProg.exe, place the manifest in a file called MyProg.exe.manifest

Notice that since Windows Server 2003 and later, any internal manifest is preferred over an external manifest.

There's also the MT.exe tool.

4: See for example http://www.tech-pro.net/code-signing-for-developers.html

mlaan
Yeah, I got it all compiled and working, but I still have to pay for a cert. Windows wont allow me to trust a self-signed cert.
John Gietzen
If your application is open source, www.certum.eu provides free certs trusted by all Windows versions. Otherwise I found Comodo most reasonable myself, especially going via a Comodo affiliate which gives identical certs, but at lower prices.
mlaan

related questions