0

I'm trying to get my program to compile in a way that it doesn't require local administrative privileges to run on a computer. The one thing I keep getting from Microsoft's Application Compatability Toolkit is that my application requests SeDebugPrivilege.

Basically I'm not sure how/where/when this privilege token is requested. I am building the application in "Release" with DEBUG and TRACE Complilation Constants disabled, I'm curious if the debug permission request is coming from a library I'm using?

Is there any easy way to tell how/when this privilege is being requested in Visual Studio? Is there a better tool to debug this?

Grambot
  • 4,370
  • 5
  • 28
  • 43
  • 1
    "The one thing I keep getting from Microsoft's Application Compatability Toolkit is that my application requests SeDebugPrivilege" can be a false alarm. What if you neglect it? – Lex Li Jun 30 '18 at 18:17
  • When I run it on a VM with a limited user permissions it still asks for privilege escalation. I used ACT to try and figure out what is doing that and from what I can tell it is the Debug Permissions – Grambot Jun 30 '18 at 21:15
  • Ask the library author if he [used this](https://msdn.microsoft.com/en-us/library/system.diagnostics.process.enterdebugmode(v=vs.110).aspx). Or use a decompiler to find it back. – Hans Passant Jun 30 '18 at 23:44

1 Answers1

0

Alright so I guess using the application I get from the "Build" action in Visual Studio will come with that permission embedded in it. That means Step #1 is to us "Publish" and not "Build" to get my executable.

Step 2 was a bit weird, and not something I had originally in my question. Since my application uses the phrase "Updater" in its name, apparently that triggers some UAC issue because it thinks it is an Installation Package. The question here is what tipped me off to that. Following the linked MSDN page I learned that I should include the manifest with my applictaion and voila!

So, recap:

#1 - Publish the executable first

#2 - Include the manifest

No more UAC. No more SeDebugPrivilege

Grambot
  • 4,370
  • 5
  • 28
  • 43
  • How so? I see several guides on generating the manifest which isn't an issue but nothing about embedding it – Grambot Jul 03 '18 at 17:33
  • That guide is related to C/C++. From my understanding the manifest is automatically supposed to be embedded in the executable (as I was able to pull one by looking at my exe with 7zip) but for some reason WIndows wasn't happy about that and wanted me to drop the .manifest file in the running directory explicitly. It really doesn't change anything of my build procedure anyway – Grambot Jul 03 '18 at 17:54
  • C# projects have the same setting. – Lex Li Jul 03 '18 at 17:55
  • I'm not using C#; the largest hangup is that there is no "Embed Manifest" option in the properties. I think you have to assume it is automatic to be embedded if there is one as part of the project. – Grambot Jul 03 '18 at 18:01
  • https://stackoverflow.com/questions/4383288/how-can-i-embed-an-application-manifest-into-an-application-using-vs2008 It is something long live, and should apply to all .NET project types (though .NET Core apps might not have that). – Lex Li Jul 04 '18 at 02:58
  • Again, I am not using C#. VB.NET's project configuration is different. I appreciate the assistance you're trying to provide but if you're not reading the feedback I'm giving this is a difficult conversation – Grambot Jul 04 '18 at 13:04
  • How the VB.NET configuration looks for your reference (Visual Studio 2017) https://imgur.com/s2sDFw9 – Grambot Jul 04 '18 at 13:07