Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Windows UAC manifest, pos link and resource file
Forum Updated to NodeBB v4.3 + New Features

Windows UAC manifest, pos link and resource file

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 9.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stima_ua
    wrote on last edited by
    #1

    my resource file:
    //myapp.rc
    @
    IDI_ICON1 ICON DISCARDABLE "images/autorun.ico"
    CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "autorun.exe.manifest"
    @

    my pro file:
    @
    RC_FILE = myapp.rc

    win32 {
    WINSDK_DIR = C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A
    WIN_PWD = $$replace(PWD, /, \)
    OUT_PWD_WIN = $$replace(OUT_PWD, /, \)
    QMAKE_POST_LINK = $$WINSDK_DIR/bin/mt.exe
    -manifest $$quote($$WIN_PWD\$$basename(TARGET).manifest)
    -outputresource:$$quote($$OUT_PWD_WIN\${DESTDIR_TARGET};1)
    }
    @

    my manifest file:
    //autorun.exe.manifest
    @
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

    <assembly manifestVersion="1.0">
    <trustInfo >
    <security>
    <requestedPrivileges >
    <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
    </requestedPrivileges>
    </security>
    </trustInfo>
    </assembly>
    @

    I try require run as administrator , but I have linking error:
    @
    Error: Invalid macro invocation found in D:\Projects\utilities\dev.build\autorun\Makefile.Release line 112
    command failed with exit code 2
    @

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rcari
      wrote on last edited by
      #2

      If you need your manifest only to have this requireAdministrator execution level, you should use something like this instead:
      @QMAKE_LFLAGS += /MANIFESTUAC:"level='requireAdministrator' uiAccess='false'"@
      This is a command line switch for the Visual Studio Linker which basically does the same thing.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stima_ua
        wrote on last edited by
        #3

        Thanks its help. And how set Company name?

        1 Reply Last reply
        0
        • R Offline
          R Offline
          rcari
          wrote on last edited by
          #4

          I don't think that is possible on the command line.
          Maybe you should just set your own manifest file using @QMAKE_LFLAGS += /MANIFEST /MANIFESTFILE:[Your file]@

          See "here":http://msdn.microsoft.com/fr-fr/library/fft52235

          1 Reply Last reply
          0
          • S Offline
            S Offline
            stima_ua
            wrote on last edited by
            #5

            [quote author="rcari" date="1337787312"]I don't think that is possible on the command line.
            Maybe you should just set your own manifest file using @QMAKE_LFLAGS += /MANIFEST /MANIFESTFILE:[Your file]@

            See "here":http://msdn.microsoft.com/fr-fr/library/fft52235[/quote]

            Sorry but i can not understand.

            I token manifest from msdn:
            @
            <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

            <assembly manifestVersion="1.0">

            <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="myapp" type="win32"/>

            <description>Description of your application</description>

            <!-- Identify the application security requirements. -->
            <trustInfo >
            <security>
            <requestedPrivileges>
            <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
            </requestedPrivileges>
            </security>
            </trustInfo>
            </assembly>
            @

            And add to .pro
            QMAKE_LFLAGS += /MANIFEST /MANIFESTFILE:[myapp.exe.manifest]
            But its not wokr

            1 Reply Last reply
            0
            • A Offline
              A Offline
              amahta
              wrote on last edited by
              #6

              I also have this problem. Did you guys found a way to this?

              Thou shalt programme
              http://www.amin-ahmadi.com

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved