This guide documents the use of Microsoft Visual Studio 2015 or 2012 or 2008 to build RhoMobile apps for Windows desktop editions, including Windows XP and XP Embedded (XPE). Visual Studio is required to build apps that target ‘big’ Windows, and along with the RhoMobile Suite should be installed prior to starting this guide. If RhoMobile is already installed, it must be configured according to the native SDK setup instructions for building Windows apps.
Building apps for Windows also relies on the Qt cross-platform application framework. As of RMS 7.0, the following Qt versions are supported:
Qt 5.1.1.0 exhibits inconsistent behavior when a finger or stylus is used for input. |
Microsoft Visual Studio 2012 and 2008 should be used only for XP builds |
About Windows XP target support: Qt 5.1.1.0 is the only Qt version supported for making RhoMobile apps with Visual Studio 2008 or 2012 that target Windows XP and XPE. Zebra has built binaries from Qt source to make them compatible with Windows XP and to support zlib, SSL, .png, .jpg, FreeType fonts, etc. These freely distributable binaries are linked against OpenSSL and implement the HTTPS protocol. If additional or different binaries are required for your app, please refer to Qt’s documentation for Configure Options and Building from Source.
C:\Qt\Qt5-ssl
on the development host.1. On the Windows Desktop, right-click ‘Computer’ and select -> Properties.
2. Select ‘Advanced System Settings’ in the System Properties window.
3. In the ‘Advanced’ tab, click the ‘Environment Variables’ button to bring up a window similar to the one below:
4. Click the lower ‘New…’ button to create a new System Variable. (If a variable called ‘QTDIR’ already exists, double-click to edit it).
5. Enter ‘QTDIR’ in the Variable name field.
6. Enter C:\Qt\Qt5-ssl
in the Variable value field.
7. Click ‘OK’ to close the dialog and OK again to close and save the setting.
8. Restart the system for changes to take effect.
If the development host has just a single version of Visual Studio installed, skip to the Build section; the system is now ready to build.
If more than one version of Visual Studio is installed, the system by default will build the application using the newest supported version (2015 or 2012 or 2008). To explicitly specify the version of Visual Studio to use, add an msvc
parameter to the win32
section of your build.yml
and specify 2015
, 2012
or 2008
:
win32: msvc: 2015
The system is now ready to build with the selected Visual Studio edition.
To build and run the application, execute the following command:
$ rake run:win32
To clean all temporary and binary files, execute the following command:
$ rake clean:win32
To build an installer bundle:
$ rake device:win32:production
After the build process is finished you will find an installer bundle named:
<application-name>-setup.exe
in the folder:
<application-root>/bin/target/win32
After the development host has been configured for Windows XP Embedded according to the Setup section above, use the following commands to build for XPE. To optimize the size of the XPE executable and its runtime footprint, please refer to Minimize the target footprint, below.
Clean out temporary and binary files by executing the following command:
$ rake clean:winxpe
Build an installer bundle:
$ rake device:winxpe:production
After the build process is finished you will find an installer bundle named:
<application-name>-setup.exe
in the folder:
<application-root>/bin/target/win32
The size of the Windows executable can be minimized by excluding Qt and/or Visual C runtime libraries, and the target configured to execute multiple apps from a single shared instance of those DLLs.
Important: Optimized apps will not run on the target unless it has been configured as described this section; excluded DLLs must be installed separately on every target. Zebra simplifies this process with a set of target runtime installers that automatically install all required Qt DLLs into a shared location and configure target path settings accordingly. Alternatively, Qt5 DLLs can be copied to a folder on the target, the path to which must be added to the PATH
environment variable and the QTDIR
system variable removed.
Zebra runtime installers include Zebra's Qt library builds, and should not be used if different Qt DLLs are required. |
1. Add one or both of the boolean parameters deployqt
and deploymsvc
to the win32
section of your build.yml
and exclude the corresponding runtimes by setting their values to 0, as below:
win32: deployqt: 0 deploymsvc: 0
2. Rebuild the app; the resulting executable will exclude the specified DLLs.
RhoRuntime Qt installers optimize memory footprint by installing a single instance of the Qt runtime libraries and define a path on the target to allow sharing of the libraries by multiple applications.
1. On the target(s), download and execute the appropriate installer:
2. Restart the target to activate new path settings.
Download the Microsoft Visual C++ runtime and install it. The installer configures the target to allow sharing of the runtime by multiple applications.
The Nullsoft Scriptable Install System (NSIS) is an open source platform for creating installation files for Windows apps. Follow these instructions to make an installer for your app:
1. Download and install the NSIS installer tool.
2. Add path to the NSIS complier in your rhobuild.yml
file, which is in the \rhodes
folder:
On 32-bit platform:
env: paths: nsis: C:/Program Files/NSIS/makensis.exe
On 64-bit platform:
env: paths: nsis: C:/Program Files (x86)/NSIS/makensis.exe
3. To present a user license agreement, place the license in a file called LICENSE.txt
in the root of application folder. This will be displayed on separate page during installation and allows the installer to accept the license.
4. To present a Readme file, place the readme text in a file called README.html in the root of application folder. It will be displayed by the installer when the installation concludes.
For more information, please refer to the NSIS User Guide.
The application log ‘Rholog.txt’ is placed in <Application folder>\rho
RhoMobile applications can be built only with Visual Studio 2008, Visual Studio 2012 or Visual Studio 2015, and only with Qt 5.1.1, Qt 5.5.0 or Qt 5.9.6 If after following the steps above a different version of Qt is desired, follow these steps to make the switch:
C:\Qt\Qt<QtVersion>\<QtVersion>\<VSVersion>
msvc
parameter in the Build.yml
to reflect the desired Visual Studio version, if necessary.deployqt
and deploymsvc
parameters in the build.yml
both contain a value of 0.<application-root>/bin/target/win32/tmp
from the development host to the C:\<application-root>
of the target. This is the newly built application.C:\<application-root>\<Application>.exe
.