Вопрос

I'm facing a problem with running my C# application on Windows Server 2003. I have internal manifest file with following lines

  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
      </requestedPrivileges>
    </security>
  </trustInfo>

And it works fine for Windows 7 or 8, UAC is prompted when user is trying to run application without admin rights. But on windows server 2003 user can launch it without admin rights and UAC is not prompted and as a result application is not working properly.

Это было полезно?

Решение

UAC simply does not exist in Windows Server 2003, it was only introduced in Windows Vista and Windows Server 2008.

Your application will have to accept that it may be started without administrative privileges. It must therefore perform its own check for administrative privileges, and if it finds it is being run by someone other than an administrator, it should tell the user so and then exit.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top