سؤال

So I spent the better part of my afternoon fiddling with the Qt 4.8.5 handling of MANIFESTUAC for VS2008. I eventually got it fixed by avoiding special (read: broken) processing in msvc_objectmodel.cpp. I'll post my solution as an answer, but I'd like to know if anyone else has run into this before (and has a better solution).

Related: Qt (on Windows) setting privilege-level to "requireAdministrator"

هل كانت مفيدة؟

المحلول

Lines 1352-1371 in the source have optimized parsing for the MANIFESTUAC flag. I'm not sure what they did wrong, but if you allow that code path to be triggered nothing gets set right. I noticed that EnableUAC was not set at all for the level case. I experimented with setting the flag by itself first to no avail.

Simply prepending an extra space for the option allows you to skip the broken processing and get the option appended as an additional parameter. Whew!

Workaround as follows:

QMAKE_LFLAGS += " /MANIFESTUAC:level=\'requireAdministrator\'"

There has to be a more elegant solution, but this seems to work for now.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top