0

I found interesting problem with Win7/X64 machine.

For this time I haven't got problem with Delphi 6 and UAC. The exes are working in their's place, so I can use Delphi debugger with them.

But today I got error on run the project: "Unable to create process. For this operation you need higher user level".

How can I prevent this side-effect? What causes this? I don't understand why the older projects are running fine, but this new isn't...

Thanks for every idea, link, information!


Additional info: Normally I using the Delphi 6 IDE with normal starting (without SysAdmin rigths). So it is never asking me with "really?" kind UAC questions. And every of the older projects are usable with Delphi 6 - I can build, run, debug everything. This problem happened with only this project, so I try to find the differences if possible to solve the problem. I using normal directory ("c:\dev\anyproject"), others are using "c:\dev\otherproject1..2..n").

durumdara
  • 3,411
  • 4
  • 43
  • 71
  • 2
    I think you need to give us some clues. Does the executable request elevation when started normally? That is when you start it without a debugger. – David Heffernan Oct 25 '12 at 09:52
  • Maybe the project is located in a folder which requires elevation to write. So check the path where is located the project. – RRUZ Oct 25 '12 at 11:46
  • possible duplicate of [Developing Apps with Administrator Rights in Delphi](http://stackoverflow.com/questions/6108112/developing-apps-with-administrator-rights-in-delphi) – jachguate Aug 05 '15 at 14:15

3 Answers3

3

Does your application request elevation when started from Windows Explorer?
Does it have a manifest?

The name of the exe, like setup.exe, could also trigger elevation. See an outline of the Installer detection technology.

Non-elevated process can't debug elevated process.
If your application requires elevation at the start, then you would need to run the IDE elevated to be able to debug it.

Community
  • 1
  • 1
Alexey Ivanov
  • 11,541
  • 4
  • 39
  • 68
  • Yes, this application prompts for admin rights when I try to start it from Total Commander/Explorer. But I don't know why? What is the difference between my other applications, and this application that cause the elevation? Can you help me in this question, what I need to find? – durumdara Oct 26 '12 at 09:42
  • 1
    Ahhhhhh, I got it. The problem the my application name containing "updater" substring in it's name! Thanks, you helped me lot!!! ;-) – durumdara Oct 26 '12 at 10:03
  • If your updater does not need to elevate, [create and embed an application manifest](http://msdn.microsoft.com/en-us/library/bb756929.aspx) with `level="asInvoker"`. – Alexey Ivanov Oct 26 '12 at 11:20
  • 1
    @durumdara UAC was introduced with Vista, almost 6 years ago now. You should not be building manifest free applications today. – David Heffernan Oct 26 '12 at 11:58
1

Starting your IDE as an administrator should solve the problem (option in the context menu). If not, you could always disable UAC while developing.

M0-3E
  • 1,012
  • 2
  • 13
  • 22
  • 5
    But don't disable UAC while testing: otherwise you may miss problems that your end-users will encounter when using your application. – frogb Oct 25 '12 at 10:27
  • 1
    That will allow you to debug, but it hardly "solves the problem". Now the problem is why the app requires admin rights when the developer doesn't expect it to. – David Heffernan Oct 25 '12 at 10:27
-1

There is a number of limitations that needs administrator's rights. For example: you cannot write data directly into program files directory.

Darthman
  • 457
  • 4
  • 21