sanjay
sanjay

Reputation: 765

How to create qtcreator installer from its source code?

I have created Qt creator plugin and used Qt creator source code from git repo. But i could not find how to make installer package for windows at least. If you go to https://www.qt.io/download-open-source/#section-2 , you can see that Qt creator installer are created so that we can install only Qt creator. Qt is using Qt installer framework for creating installers. Where is the script for building Qt creator installer ?

Upvotes: 0

Views: 804

Answers (1)

stephane petithomme
stephane petithomme

Reputation: 19

Requirement: You need 7zip installed (7z), python (2.7) and IFW.

Answer is based on Windows. you may need slightly different case with linux

My working structure is:

/home
 /Qt5.5.1
 /qt-creator3.6  (Qt creator  source)  
 /qtcreator3.6  (Qt creator build)
 /So-ADE
  /So-ADEDebugger   (My plugin)

The script is in /home

This is my script for doing the same thing: Please adapt with your own plug-in directory (Mine is So-ADEDebugger) and file structure.

Use /tmp as a build directory

mkdir c:\tmp
rmdir /s /q c:\tmp\out

Move to my plugin directory, build it

cd So-ADEDebugger
..\..\Qt5.5.1\5.5\mingw492_32\bin\qmake.exe

Add gcc to windows path (in case)

set PATH=%CD%\..\..\Qt5.5.1\Tools\mingw492_32\bin\;C:\Program Files\7-Zip\;%PATH%
..\..\Qt5.5.1\Tools\mingw492_32\bin\mingw32-make.exe

move to qtcreator build directory (shadow build) and install to target directory (/tmp)

cd ..
cd ..\qtcreator3.6
set INSTALL_ROOT=c:\tmp\out
..\Qt5.5.1\Tools\mingw492_32\bin\mingw32-make.exe -j 4 install

Copy Qt windows dll in place

cd ..\So-ADE
xcopy /i/s ..\Qt5.5.1\5.5\mingw492_32\bin\*.dll c:\tmp\out\bin
mkdir c:\tmp\out\bin\plugins
xcopy /i/s ..\Qt5.5.1\5.5\mingw492_32\plugins\designer c:\tmp\out\bin\plugins\designer
xcopy /i/s ..\Qt5.5.1\5.5\mingw492_32\plugins\iconengines c:\tmp\out\bin\plugins\iconengines
xcopy /i/s ..\Qt5.5.1\5.5\mingw492_32\plugins\imageformats c:\tmp\out\bin\plugins\imageformats
xcopy /i/s ..\Qt5.5.1\5.5\mingw492_32\plugins\platforms c:\tmp\out\bin\plugins\platforms
xcopy /i/s ..\Qt5.5.1\5.5\mingw492_32\plugins\printsupport c:\tmp\out\bin\plugins\printsupport
xcopy /i/s ..\Qt5.5.1\5.5\mingw492_32\plugins\sqldrivers c:\tmp\out\bin\plugins\sqldrivers
mkdir c:\tmp\out\lib\vcredist_msvc2013
xcopy /i/s ..\Qt5.5.1\vcredist\vcredist_msvc2013_x86.exe c:\tmp\out\lib\vcredist_msvc2013\
move c:\tmp\out\lib\vcredist_msvc2013\vcredist_msvc2013_x86.exe c:\tmp\out\lib\vcredist_msvc2013\vcredist_x86.exe 

and reject the debug one

del /s c:\tmp\out\bin\*d.dll

Now install the plugin in target

cd So-ADEDebugger
..\..\Qt5.5.1\Tools\mingw492_32\bin\mingw32-make.exe -j 4 install

In my plugin i have a copy of qt-creator/dist/installer directory with my custom setup for the installer (optional pass). i copy it back to qt to build the installer with my setup

xcopy /i /s /y installer ..\..\qt-creator3.6\dist\installer
xcopy /i /s /y qt.conf c:\tmp\out\bin
cd ..

in case....

strip c:\tmp\out\bin\* c:\tmp\out\lib\qtcreator\plugins\*

Build the tar for the installer (bindist_installer target of make)

cd ..\qt-creator3.6
set IFW_PATH=C:\Qt\QtIFW2.0.1
..\Qt5.5.1\Tools\mingw492_32\bin\mingw32-make.exe bindist_installer

and finally package it. Changes this with your setup

c:\Python27\python -u .\scripts\packageIfw.py -i "C:\Qt\QtIFW2.0.1" -v 2.0.0 -a "qt-creator-windows-3.6.1-installer-archive.7z" ..\So-ADE\So-ADEdebugger.2.0.0.win  

Upvotes: 1

Related Questions