Windows UAC manifest, pos link and resource file



  • 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
    @



  • 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.



  • Thanks its help. And how set Company name?



  • 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 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



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.