[Interest] Qt "Desktop App" for Microsoft Store

Ian Clark mrrooster at gmail.com
Tue May 2 02:03:46 CEST 2017


On 30 April 2017 at 07:57, Robert Iakobashvili <coroberti at gmail.com> wrote:
> Hi,
>
> Has anybody tried to make and publish a Qt-based Windows "Desktop App"
> at the Microsoft App Store?
>
I'm currently trying to do just that.

I've managed to build and package an app that I can sign and install
locally, It also passes the app certification test.

> Any experience you have to share?
>
Not a huge amount yet, you need to request permission before you can
publish desktop bridge apps, I'm currently waiting for this to be done
so I can release.

This is just a little hobby project using Qt 5.8, nothing large. I
used the manual conversion process outlined in the documentation.

The only thing to remember is to include the VC runtime dependencies
in your manifest:

https://blogs.msdn.microsoft.com/vcblog/2016/07/07/using-visual-c-runtime-in-centennial-project/

A slightly simplified version of my build script is below. It also
calls another script that sets the environment up (adds qmake to path,
qt vars, calls VS setvars.bat and adds the git bash tools to the path
as I use sed to writing the correct version into the manifest).

The build process is basically....

1. Checkout project from git
2. qmake then build the project for release
3. create an install folder, cd to it. This is the folder that will
appear in 'program files'.
4. copy all the needed bits of Qt and the just built app exe to the
install folder
5. Copy any other files needed to the install folder, this includes
the icons as png.
6. copy the 44x44 png icon with the correct extension so it's 'unplated'.
7. create the ApplicationManifest.xml file in the install folder.
8. run the resource generation tool for the unplated icons. (This is
so the taskbar icon looks okay).
9. package the install folder into an .appx file
10. Sign the package with a local cert so it can be installed to test.

Cheers,

Ian

<----
@Echo off
REM ------------- Settings
SET VERSION=1.0.0.0
SET COPY_TO_FOLDER=%USERPROFILE%\Desktop
SET GIT_ROOT="ssh://someone@some.example.com/project.git"
SET GIT_BRANCH=master
SET BUILD_DIR=%TEMP%\_win_store_build
REM ------------- Settings end

SET SCRIPT_FOLDER=%~dp0

IF EXIST %BUILD_DIR% (
 echo Build dir exists!
 goto error
)

MKDIR %BUILD_DIR%
pushd %BUILD_DIR%
SET BUILD_DIR=%CD%
set BUILD_SRC_DIR=%BUILD_DIR%\project
set BUILD_TARGET_DIR=%BUILD_DIR%\project_build_x64
set INSTALL_TARGET_DIR=%BUILD_DIR%\project_install_x64

REM Set the env variables
echo Setting build environment...
call ***SCRIPT_THAT_ADDS_COMPILER_PLUS_GIT_BASH_TOOLS_TO_PATH***

echo Cloning...
git clone %GIT_ROOT%
cd %BUILD_SRC_DIR%
git checkout %GIT_BRANCH%

echo Creating build directory...
mkdir %BUILD_TARGET_DIR%
cd %BUILD_TARGET_DIR%

echo Running qmake...
qmake -config release %BUILD_SRC_DIR%\project.pro

echo Building...
nmake /nologo

echo Creating install folder...
cd %BUILD_DIR%
mkdir %INSTALL_TARGET_DIR%

echo Setting up install contents...
copy %BUILD_TARGET_DIR%\project\release\project.exe %INSTALL_TARGET_DIR%
copy %QT_DIR%\bin\Qt5Core.dll %INSTALL_TARGET_DIR%
copy %QT_DIR%\bin\Qt5Network.dll %INSTALL_TARGET_DIR%
copy %QT_DIR%\bin\Qt5Widgets.dll %INSTALL_TARGET_DIR%
copy %QT_DIR%\bin\Qt5Gui.dll %INSTALL_TARGET_DIR%
copy %QT_DIR%\bin\Qt5Script.dll %INSTALL_TARGET_DIR%
copy %QT_DIR%\bin\libGLESv2.dll %INSTALL_TARGET_DIR%
mkdir %INSTALL_TARGET_DIR%\platforms
mkdir %INSTALL_TARGET_DIR%\imageformats
copy %QT_DIR%\plugins\platforms\qwindows.dll %INSTALL_TARGET_DIR%\platforms
copy %QT_DIR%\plugins\imageformats\qico.dll %INSTALL_TARGET_DIR%\imageformats
copy %BUILD_SRC_DIR%\resources\Qt_licence.txt %INSTALL_TARGET_DIR%\
copy %SCRIPT_FOLDER%\project_icon_*.png %INSTALL_TARGET_DIR%\
copy %SCRIPT_FOLDER%\project_icon_44x44.png
%INSTALL_TARGET_DIR%\project_icon_44x44.targetsize-44_altform-unplated.png

:clean
cd %BUILD_TARGET_DIR%
echo Cleaning....
nmake /nologo clean > :nul 2>&1

cd %BUILD_DIR%
echo Create manifest...
sed "s:__VERSION__:%VERSION%:" %SCRIPT_FOLDER%\win_store_manifest.xml
> %INSTALL_TARGET_DIR%\AppxManifest.xml

echo Resources....
pushd %INSTALL_TARGET_DIR%
makepri createconfig /cf priconfig.xml /dq en-gb
makepri new /pr %INSTALL_TARGET_DIR% /cf %INSTALL_TARGET_DIR%\priconfig.xml
popd

Echo Building app package...
MakeAppx.exe pack /d  %INSTALL_TARGET_DIR% /p project.appx
signtool sign -f %SCRIPT_FOLDER%\project.pfx -fd SHA256 -v
%BUILD_DIR%\project.appx
cp %BUILD_DIR%\project.appx %COPY_TO_FOLDER%\

goto :end

:error
pause
exit /b 1

:end
popd
pause
rmdir /S /Q %BUILD_DIR%
<----



More information about the Interest mailing list