From: Andrew Knight Date: Thu, 6 Mar 2014 09:35:37 +0000 (+0200) Subject: winrtrunner: Display developer license dialog X-Git-Tag: upstream/5.2.90+alpha~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c43805b6d6edfba6a962201db5aa7d9f14dc2f26;p=platform%2Fupstream%2Fqttools.git winrtrunner: Display developer license dialog ... when the license is expired. The installation can then continue. Change-Id: I11bc13643406ad59611c53da22bdf32dfcd715e7 Reviewed-by: Oliver Wolff --- diff --git a/src/winrtrunner/appxengine.cpp b/src/winrtrunner/appxengine.cpp index d847017..678946a 100644 --- a/src/winrtrunner/appxengine.cpp +++ b/src/winrtrunner/appxengine.cpp @@ -49,6 +49,7 @@ #include #include +#include #include #include #include @@ -470,6 +471,17 @@ bool AppxEngine::install(bool removeFirst) qCWarning(lcWinRtRunner) << "Unable to register package:" << QString::fromWCharArray(WindowsGetStringRawBuffer(errorText, 0)); } + if (HRESULT_CODE(errorCode) == ERROR_INSTALL_POLICY_FAILURE) { + // The user's license has expired. Give them the opportunity to renew it. + FILETIME expiration; + hr = AcquireDeveloperLicense(GetForegroundWindow(), &expiration); + if (FAILED(hr)) { + qCWarning(lcWinRtRunner) << "Unable to renew developer license:" + << qt_error_string(hr); + } + if (SUCCEEDED(hr)) + return install(false); + } return false; } diff --git a/src/winrtrunner/winrtrunner.pro b/src/winrtrunner/winrtrunner.pro index bda4d9d..a321d4a 100644 --- a/src/winrtrunner/winrtrunner.pro +++ b/src/winrtrunner/winrtrunner.pro @@ -11,7 +11,7 @@ DEFINES += RTRUNNER_NO_APPX RTRUNNER_NO_XAP win32-msvc2012|win32-msvc2013 { SOURCES += appxengine.cpp HEADERS += appxengine.h - LIBS += -lruntimeobject + LIBS += -lruntimeobject -lwsclient DEFINES -= RTRUNNER_NO_APPX include(../shared/corecon/corecon.pri)