Skip to content

Commit

Permalink
Initial creation of windows packaging version 2 (#117)
Browse files Browse the repository at this point in the history
* First Windows build that works

The build works.
THe builds starts as a terminal window, which has to be corrected.
There is no icon for the exe file.
THere is no installer for the exe file.

* Made windows executable building more complete

* Icon on exe is now present
* Command to create package contains relative paths where possible
* There is no longer a console window opening when starting the exe
* Documentation adopted accordingly

* Added installer and portable

* Installer added by adopting the existing inno setup script file
* Portable version creation documented
* Removed binary files from repository (They get attached
to the tag or release
  • Loading branch information
Topas authored Feb 25, 2019
1 parent 49f999b commit b648837
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 91 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ Thumbs.db
# --------
*.dll
*.exe
*portable.zip
*.qmlc
58 changes: 58 additions & 0 deletions packaging/PACKAGING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# General note

The binary files are not put into the repository. They are attached to the version on github.

# Build Windows package
Building an executable is done by [pyinstaller](https://www.pyinstaller.org/ "pyinstaller").

## Prerequisites

The following software is needed for building the package for windows:
* Windows 10 build: 1809
* Python installation in version 3.7.2 (64 bit)
* Qt in Version 5.12

The python installation needs the follwing packages to be installed using pip:
* PyQt5
* pyinstaller
* sip

Qt needs the follwing items to be installed:
* MSVC 2017 (64 bit)

## Starting the package build

Open powershell with administrative rights in folder

QTodoTxt2\packaging\Windows\output

and call (replace the missing paths before calling it):

& "C:\<PATH TO YOUR PYTHON>\python.exe" -m PyInstaller --paths C:\Windows\System32\downlevel\ --paths "<PATH TO YOUR GIT REPOSITORY LOCATION>\QTodoTxt2" --paths "<PATH TO YOUR QT INSTALLATION FOLDER>\Qt\5.12.0\msvc2017_64\bin" --paths "<PATH TO YOUR PYTHON INSTALLATION>\Lib" --add-data '<PATH TO YOUR GIT REPOSITORY LOCATION>\QTodoTxt2\qtodotxt2\qml;.\qtodotxt2\qml' "<PATH TO YOUR GIT REPOSITORY LOCATION>\QTodoTxt2\bin\qtodotxt"

The current call on the developers machine looks like:

& "C:\Program Files\python_installed\python.exe" -m PyInstaller --paths "C:\Windows\System32\downlevel\" --paths .\..\..\..\ --paths "C:\Qt\5.12.0\msvc2017_64\bin" --paths "C:\Program Files\python_installed\Lib" --add-data '.\..\..\..\qtodotxt2\qml;.\qtodotxt2\qml' --icon ".\..\..\..\packaging\Windows\qTodo.ico" --noconsole ".\..\..\..\bin\qtodotxt"


## Portable version

The portable Version is created by creating a zip file from folder

QTodoTxt2/packaging/Windows/output/dist/qtodotxt

and

* naming it to qtodotxt_<version>_portable.zip

and

* moving it to the folder

QTodoTxt2/packaging/Windows/output/portable

## Installer

Creating an installer is done using [Inno Setup](http://www.jrsoftware.org/isinfo.php "Inno Setup") and the file

installer.iss
8 changes: 4 additions & 4 deletions packaging/Windows/installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "QTodoTxt"
#define MyAppVersion "1.6.1"
#define MyAppVersion "2.0.0"
#define MyAppPublisher "QTT Development Team"
#define MyAppURL "https://github.com/QTodoTxt/QTodoTxt"
#define MyAppURL "https://github.com/QTodoTxt/QTodoTxt2"
#define MyAppExeName "qtodotxt.exe"

[Setup]
Expand All @@ -23,7 +23,7 @@ DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=..\..\gpl.txt
OutputDir=build\installer
OutputDir=output\installer
OutputBaseFilename=qtodotxt_{#MyAppVersion}
Compression=lzma
SolidCompression=yes
Expand All @@ -36,7 +36,7 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Files]
Source: "dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "output\dist\qtodotxt\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Expand Down
Binary file added packaging/Windows/qTodo.ico
Binary file not shown.
87 changes: 0 additions & 87 deletions packaging/Windows/setup.py

This file was deleted.

0 comments on commit b648837

Please sign in to comment.