1. Bjarne Johansson’s avatar

    Hej Fredrik,

    Jag använder Embarcadero Rad Studio 2009 under Vista 32. Jag vill köra program som administratör via Delphi kod. Jag hittade din blog.

    http://blog.fredrikhaglund.se/blog/2007/03/19/vista-user-account-control-and-command-line-applications/

    Jag fick fölljande meddelande, message:

    (Jag var med i Swebug.)

    [MSBuild Error] BRCC32-aktiviteten misslyckades oväntat.
    System.IO.FileNotFoundException: Det gick inte att hitta filen C:\Users\Bjarne\Downloads\24512_example_console_app_with_user_account_control_uac_support\ExecutionLevelAsInvokerManifest.rc.
    Filnamn: C:\Users\Bjarne\Downloads\24512_example_console_app_with_user_account_control_uac_support\ExecutionLevelAsInvokerManifest.rc
    vid System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    vid System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
    vid Borland.Build.Tasks.Common.CommandLineTask.CreateTempFileIfNecessary(ITaskItem basedOn)
    vid Borland.Build.Tasks.Common.CommandLineTask.Execute()
    vid Microsoft.Build.BuildEngine.TaskEngine.ExecuteTask(ExecutionMode howToExecuteTask, Hashtable projectItemsAvailableToTask, BuildPropertyGroup projectPropertiesAvailableToTask, Boolean& taskClassWasFound)

    Reply

  2. Stephen Cooke’s avatar

    Hello,
    I have a database program that I wrote using Delphi 7.

    When a customer installs my program on a windows vista computer, I have to show them how to;
    1. Locate my program (I put it in a new folder on the C:\ drive)
    2. Right click my appliaction.exe file
    3. Select the Comapibility tab.
    4. Check the box “Run as Administrator”
    Only then when will my program run correctly.

    Obviously, this is a little annoying and puts off some of my customers.
    My question is;
    Is there a way to Run my application automatically as an administrator or in the alternative, automatically get the users permission to run my appliaction as an Administrator.

    Kind Regards
    Steve

    Reply

    1. Fredrik Haglund’s avatar

      Hi Steve!

      Download my presentation about Delphi and UAC from http://www.meetup.com/delphi-sthlm/files/

      Look at slide 37 to 40 about how you add a manifest that requires the exe-file to execute as administrator.

      Reply