0

I took over a company that had a application already built and deployed and I am stuck.

My Delphi 5 application requires elevated privileges to run and I have no idea why.

How could I see why my application requires elevated privileges and potentially have the application run without elevated privileges since my client cannot have the users run the application as admin.

Project options -> Application

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Niens101
  • 1
  • 2
  • Unfortunately you are 15 years late to the party, and the migration documentation is hard to find. In summary, the first thing you need to do is add an asInvoker application manifest to your executable. This will disable virtualization of files and registry. Then you need to debug any subsequent issues. Likely to be places where your program writes to system and program files directories, or restricted areas of the registry, HKLM. – David Heffernan May 28 '20 at 09:36
  • Now, if your program requires elevation to work, then perhaps it has already got an application manifest. If it didn't then it might be that virtualization would save you. Start by finding out what the manifest is. Is it asInvoker or requiresElevation. You want asInvoker. Then you just have to start debugging. Find those places where it fails, and work out why. – David Heffernan May 28 '20 at 09:38
  • Thank you for the response. I come from a C# environment so I am not so familiar with the IDE. How do I find the manifest? I have added a image to the original post, this is where I was under the impression I would see this. – Niens101 May 28 '20 at 10:07
  • Delphi 5 was released in 1999. Application manifests didn't exist then. You would need to add one. I could explain how to do this in a series of comments. But would it be easier and better for you to read the documentation and learn about this? It's a complex topic. It will take time. It will take days for you to really get on top of this. You have to set your expectations accordingly. – David Heffernan May 28 '20 at 10:43
  • One steer I will give you, is to ask whether or not the app runs with admin rights by itself. Or do you have to take external actions to elevate. – David Heffernan May 28 '20 at 10:46
  • Since the app in question was written in Delphi 5 and likely doesn't have a UAC manifest already, and the fact that it "requires elevated privileges to run and I have no idea why", then is is possible that maybe the EXE file is named in such a way, or its Version resources contain certain keywords, that cause Windows' "Installer Detection" to wrongly identify the app as an installer and thus requires it to be elevated automatically. – Remy Lebeau May 28 '20 at 20:34

1 Answers1

0

Windows looks at the title and version info to see if the words "Setup", "Install", and a couple others I forget are in there and if so, automatically requires elevated privileges.

I had this happen recently in a Delphi XE application where there was a module that allowed configuration of company-wide information. I added the word "Setup" to one of the version info lines and immediately users complained of the same problem. As soon as I took that out, and without doing anything else, the problem went away.

Your screenshot shows the application Title has the word "Setup" in it and I'll bet that's causing the problem.

David Cornelius
  • 437
  • 1
  • 5
  • 12