FoxPro Programming
VFP EXE file and UAC
Gravatar is a globally recognized avatar based on your email address. VFP EXE file and UAC
  Carl Chambers
  All
  Sep 19, 2018 @ 09:12am

I don't know if this is a Windows issue or if there is something I can do in building/installing the VFP EXE.

I have an EXE that is run by a third party program to do some processing, typically without becoming visible unless the user needs to be messaged.

When this EXE is run by the third party program, the UAC alert (gold, not blue) is displayed. It works OK but this is a nuisance.

If I double-click on the EXE in Windows Explorer, it runs fine with no UAC alert.
If I "Run As Administrator" in Windows Explorer, the UAC alert is displayed.

Is there something I can do in the build or installation of this EXE to prevent the UAC alert when run by the third party program or is this completely in the hands of the third party developer?

Gravatar is a globally recognized avatar based on your email address. re: VFP EXE file and UAC
  Rick Strahl
  Carl Chambers
  Sep 19, 2018 @ 06:01pm

This almost certainly means the target application is running under different permissions (most likely as an Admin account). Any exe started under an elevated prompt will trigger UAC. Same behavior as if you did Run as Administrator.

I'm assuming your app doesn't have a custom manifest that forces it to run as Admin as it launches without UAC prompts from Explorer, but there are flags in the manifest that let you force the app to admin.

Gold and blue badges depend on whether or not the binary is signed. Gold is not signed and blue will show the company name of the signer. To get a blue signed cert you need to get a Code Signing certificate and apply it to the EXE (using SignCode.exe utility from the Windows SDK).

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: VFP EXE file and UAC
  Carl Chambers
  Rick Strahl
  Sep 20, 2018 @ 05:34pm

This was very helpful.
If I start the 3rd party app using "Run as Administrator", the UAC alert is no longer displayed when it runs my EXE.

Thanks, Rick.

Gravatar is a globally recognized avatar based on your email address. re: VFP EXE file and UAC
  Rick Strahl
  Carl Chambers
  Sep 20, 2018 @ 05:52pm

Hmmmm... that must mean that your application wants to run as an Administrator for some reason. Are you using a custom Manifest in the application?

Just strange that it won't pop that UAC dialog if you're launching directly from a non-elevated explorer/command session. Are you running your account with UAC disabled perhaps? The prompt comes the first time the transition is made from normal mode to Admin mode so once you're in an admin prompt and you run another admin requiring app it won't prompt again.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: VFP EXE file and UAC
  Carl Chambers
  Rick Strahl
  Sep 21, 2018 @ 05:59am

No custom Manifest. I don't even know what that is.

I have little knowledge of this stuff but it appears that the 3rd party app may be doing the equivalent of "Run as Administrator" when it runs my EXE. Is that possible?

Gravatar is a globally recognized avatar based on your email address. re: VFP EXE file and UAC
  Rick Strahl
  Carl Chambers
  Sep 21, 2018 @ 02:04pm

Yes... an application can specify under what account application is launched. By default, if no account info is specified the currently running account is used. So it seems a bit weird that an app would launch using Admin, unless the app is already running in Admin mode to start with.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: VFP EXE file and UAC
  Carl Chambers
  Rick Strahl
  Sep 25, 2018 @ 07:12am

Yeah, I guess that does seem odd but it's out of my hands.
I'm just glad I can give my users a way around the UAC alert thanks to your explanantion.

Thanks again.

© 1996-2024