Follow the instructions for setting up the development environment for building Windows applications.
By default the application is built with most recent supported version of Visual Studio installed in the system (either 2012 or 2008). To explicitly specify the version of Visual Studio add msvc
parameter to win32
section of build.yml
:
win32: msvc: 2012
2012
or 2008
To build and run the application issue command:
$ rake run:win32
To clean all temporary and binary files execute command:
$ rake clean:win32
Download NSIS installer tool.
Add path to NSIS complier to ‘rhobuild.yml’ in 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
To build installer bundle use command:
$ rake device:win32:production
There is separate rake command for Windows XP Embedded platform. To build installer bundle use command:
$ rake device:winxpe:production
After the build process is finished you can find the installer bundle named <application-name>-setup.exe
in <application-root>/bin/target/win32
folder.
Rholog.txt is placed in <rhodes folder>\platform\wm\bin\win32\rhodes\Debug\rho
PATH
variable, e.g. C:\Perl\bin;C:\Ruby\bin;C:\Python;...
C:\Qt\Qt5-src
(rename qt-everywhere-opensource-src-5.1.1
to Qt5-src
)C:\Qt\icu
First of all you may download our build of the Qt binaries that we use in our development process and in production builds of RhoSimulator. Exctract downloaded archive to C:\Qt
(Qt5-rhoxp
folder will be created) and set QTDIR
system variable to C:\Qt\Qt5-rhoxp
.
You may use our precompiled binaries of Qt libraries for development and testing, but your production builds may require your own build of Qt libraries (you need to consult with Qt and OpenSSL license agreements to begin with). |
So, if your application needs HTTPS or Windows XP compatibility, then you need to build the Qt libraries for Visual Studio 2012 as described below:
QTDIR
= C:\Qt\Qt5-ssl
(this will be the installation folder for the compiled Qt libraries)Open C:\Qt\icu\source\allinone\allinone.sln
solution in Visual Studio 2012 and:
cal
down to makeconv
, select Project -> Properties from top menu, select Configuration = “All Configurations”, Platform = “Win32”, go to Configuration Properties -> General, set “Visual Studio 2012 - Windows XP (v110_xp)” in Platform Toolset field, and click Applypkgdata
down to uconv
, repeat the previous step, and close the Properties windowRelease
with platform Win32
in the toolbar and build the solution, close Visual Studio 2012 after build is finishedPatch Qt source code to make it Windows XP compatible:
C:\Qt\Qt5-src\qtbase\qmake\Makefile.win32
file in text editor and add -D_USING_V110_SDK71_
option to CFLAGS_BARE
variable (e.g. at line 44 after -DUNICODE
)C:\Qt\Qt5-src\qtbase\mkspecs\win32-msvc2012\qmake.conf
and:
-D_USING_V110_SDK71_
option to QMAKE_CFLAGS
variable (line 24)QMAKE_LFLAGS_CONSOLE
variable (at line 72) to /SUBSYSTEM:CONSOLE,5.01
QMAKE_LFLAGS_WINDOWS
variable (at line 73) to /SUBSYSTEM:WINDOWS,5.01
Create C:\Qt\Qt5-build
folder and in that folder create new build.bat
file with the following content (change the paths according to your system setup and folders you have extracted the archives into):
call "%VS110COMNTOOLS%..\..\VC\vcvarsall.bat" x86 set CL=/MP /D_USING_V110_SDK71_ %CL% set PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Bin;%PATH% set PATH=%PATH%;C:\Qt\icu\bin;C:\Qt\Qt5-src\gnuwin32\bin set INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Include;%INCLUDE% set INCLUDE=%INCLUDE%;C:\Qt\icu\include set LIB=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Lib;%LIB% set LIB=%LIB%;C:\Qt\icu\lib mkdir qtbase\include\QtZlib copy C:\Qt\Qt5-src\qtbase\include\QtZlib\*.h qtbase\include\QtZlib mkdir qtbase\src\3rdparty\zlib copy C:\Qt\Qt5-src\qtbase\src\3rdparty\zlib\*.h qtbase\src\3rdparty\zlib call ..\Qt5-src\configure.bat -opensource -confirm-license ^ -prefix C:/Qt/Qt5-ssl -debug-and-release -platform win32-msvc2012 -mp ^ -icu -shared -c++11 -make libs -nomake tests -nomake examples -angle ^ -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -openssl-linked ^ -I <path-to-rhodes>/lib/extensions/openssl.so/ext/win32/include ^ -L <path-to-rhodes>/lib/extensions/openssl.so/ext/win32/lib nmake nmake install nmake clean copy C:\Qt\icu\bin\icudt52.dll C:\Qt\Qt5-ssl\bin\ copy C:\Qt\icu\bin\icuin52.dll C:\Qt\Qt5-ssl\bin\ copy C:\Qt\icu\bin\icuuc52.dll C:\Qt\Qt5-ssl\bin\ copy "%VS110COMNTOOLS%..\..\VC\bin\D3Dcompiler_46.dll" C:\Qt\Qt5-ssl\bin\
Open Visual Studio 2012 Command Prompt. This is accomplished using VS2012 x86 Native Tools Command Prompt
in Apps view of Windows 8 OS. To build Qt libraries run in Visual Studio 2012 Command Prompt:
> C: > cd \Qt\Qt5-build > build.bat
Be aware that it will take a while to build the Qt libraries from sources (maybe few hours or even a day).
Now when you build your application the usual way, the HTTPS protocol support will be enabled automatically.
It’s recommended to build Windows desktop applications with Visual Studio 2012. However if you can’t use VS2012, then you need to use a custom build of the Qt libraries for Visual Studio 2008 (since there are no official binaries of Qt 5.1.1 libraries for VS2008).
First of all you may download our build of the Qt binaries that we use in our development and testing process. Exctract downloaded archive to C:\Qt
(Qt5-vs2008
folder will be created) and set QTDIR
system variable to C:\Qt\Qt5-vs2008
.
You may use our precompiled binaries of Qt libraries for development and testing, but your production builds may require your own build of Qt libraries (you need to consult with Qt and OpenSSL license agreements to begin with). |
To build your own binaries of the Qt libraries for Visual Studio 2008:
C:\Cygwin
(you will need it to compile ICU 52.1 libraries). Make sure you have installed make
, bash
, and dos2unix
.QTDIR
= C:\Qt\Qt5-vs2008
(this will be the installation folder for the compiled Qt libraries)Open Visual Studio 2008 Command Prompt. This is accomplished using Start » All Programs » Microsoft Visual Studio 2008 » Visual Studio Tools » Visual Studio 2008 Command Prompt. To build ICU 52.1 libraries run in Visual Studio 2008 Command Prompt:
> set PATH=C:\Cygwin\bin;%ProgramFiles%\Microsoft SDKs\Windows\v7.1\Bin;%PATH% > set INCLUDE=%ProgramFiles%\Microsoft SDKs\Windows\v7.1\Include;%INCLUDE% > set LIB=%ProgramFiles%\Microsoft SDKs\Windows\v7.1\Lib;%LIB% > call "%VS90COMNTOOLS%..\..\VC\vcvarsall.bat" x86 > cd \Qt\icu\source > dos2unix * > dos2unix -f configure > bash ./runConfigureICU Cygwin/MSVC --prefix=/cygdrive/c/Qt/Qt5-icu > make > make check > make install
C:\Qt\Qt5-icu
, so you may safely delete C:\Qt\icu
folder.Create C:\Qt\Qt5-build
folder and in that folder create new build.bat
file with the following content (change the paths according to your system setup and folders you have extracted the archives into):
call "%VS90COMNTOOLS%..\..\VC\vcvarsall.bat" x86 set CL=/MP %CL% set PATH=%ProgramFiles%\Microsoft SDKs\Windows\v7.1\Bin;%PATH% set PATH=%PATH%;C:\Qt\Qt5-icu\bin;C:\Qt\Qt5-src\gnuwin32\bin set INCLUDE=%ProgramFiles%\Microsoft SDKs\Windows\v7.1\Include;%INCLUDE% set INCLUDE=%INCLUDE%;C:\Qt\Qt5-icu\include set LIB=%ProgramFiles%\Microsoft SDKs\Windows\v7.1\Lib;%LIB% set LIB=%LIB%;C:\Qt\Qt5-icu\lib mkdir qtbase\include\QtZlib copy C:\Qt\Qt5-src\qtbase\include\QtZlib\*.h qtbase\include\QtZlib mkdir qtbase\src\3rdparty\zlib copy C:\Qt\Qt5-src\qtbase\src\3rdparty\zlib\*.h qtbase\src\3rdparty\zlib call ..\Qt5-src\configure.bat -opensource -confirm-license ^ -prefix C:/Qt/Qt5-vs2008 -debug-and-release -platform win32-msvc2008 -mp ^ -icu -shared -c++11 -make libs -nomake tests -nomake examples -angle ^ -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -openssl-linked ^ -I <path-to-rhodes>/lib/extensions/openssl.so/ext/win32/include ^ -L <path-to-rhodes>/lib/extensions/openssl.so/ext/win32/msvc2008/lib nmake nmake install nmake clean copy C:\Qt\Qt5-icu\bin\icudt52.dll C:\Qt\Qt5-vs2008\bin\ copy C:\Qt\Qt5-icu\bin\icuin52.dll C:\Qt\Qt5-vs2008\bin\ copy C:\Qt\Qt5-icu\bin\icuuc52.dll C:\Qt\Qt5-vs2008\bin\
Open Visual Studio 2008 Command Prompt again. This is accomplished using Start » All Programs » Microsoft Visual Studio 2008 » Visual Studio Tools » Visual Studio 2008 Command Prompt. To build Qt library run in Visual Studio 2008 Command Prompt:
> C: > cd \Qt\Qt5-build > build.bat
Be aware that it will take a while to build the Qt libraries from sources (maybe few hours or even a day).
Now when you build your application the usual way, the HTTPS protocol support will be enabled automatically.