Package Manuskript for Windows with PyInstaller - olivierkes/manuskript GitHub Wiki
SUMMARY
This guide describes the steps for packaging Manuskript for Windows. The resulting package runs on x86 (32 bit) and x86-64 bit Windows computers.
CONSIDERATIONS
Before embarking on this procedure consider creating a clean 32-bit Virtual Machine of Windows XP for the purpose of creating Manuskript PyInstaller packages. The reasons are three-fold:
- Need to use oldest version of Windows you plan to support. See Making Linux Apps Forward-Compatible.
- Ensure no QT4 installed on system. Otherwise pyinstaller attempts to include unneeded QT4 in the package if QT4 is found on the system. See PyQt5.QtCore and PyQt4.QtCore modules both wrap the QObject class.
- Binary package wheels are provided for Python v3.5 and later for 64-bit Linux, OS X and 32-bit and 64-bit Windows.
Note: I chose to create a Windows XP SP3 32-bit VM in order to support manuskript on a large number of Windows versions.
INSTALLATION
Install Manuskript
A working version of Manuskipt is required. If creating an official release, then download and extract an official source code release zip or tarball file using Windows Explorer.
Be sure to include optional software such as Markdown and PyEnchant so that these are included in the package.
Install Prerequisite Software Packages
Install all the necessary software required for creating the manuskript package.
-
Install PyInstaller
C:\ cd \Python34\Scripts pip install pyinstaller
PACKAGE CREATION
Create a zip file package that can be installed and run on Windows 32 bit and 64 bit computers.
-
Create the Manuskript package.
cd manuskript C:\Python34\Scripts\pyinstaller manuskript.spec
This should create a
build
directory and adist
directory under the current working directory.The
dist
directory contains the self-contained manuskript folder.The log file with the warnings and errors is at
build\manuskript\warnmanuskript.txt
. -
Create a zip file using the manuskript files under the
dist
directory.In Windows Explorer navigate to
dist
directory, right click onmanuskript
, select Send To -> Compressed (zipped) Folder.This will create a
manuskript.zip
in thedist
directory.Rename
manuskript.zip
tomanuskript-#.#.#{-#}-win32.zip
Note that the
-#
within the curly braces is optional. It is used to indicate updated packages of the same manuskript#-#-#
version. The curly braces are not included in the file name.For example:
First packaging of manuskript v0.4.0 would be named:
manuskript-0.4.0-win32.zip
Or:
manuskript-0.4.0-1-win32.zip
Second repackaging of manuskript v0.4.0 would be named:
manuskript-0.4.0-2-win32.zip
And so on until the version of manuskript changed.
PACKAGE CREATION FROM LINUX
Run the build_for_windows.sh script to setup a 32bit wine prefix automatically. It installs any requirements mentioned above and creates the full package with the Windows version of PyInstaller. The prefix is completely fresh for every build and will be removed after the whole process.
PACKAGE TEST INSTALLATION
Use the following steps on a different computer or Virtual Machine to test that the manuskript package works.
-
Copy the manuskript-#.#.#{-#}-win32.zip file and extract using Windows Explorer.
-
Install a different language dictionary (e.g. French).
SKIP THIS STEP for now as instructions are Linux specific
sudo apt install aspell-fr
-
Download and install pandoc from http://pandoc.org for more export format options.
-
Run manuskript and open/create a project.
.\manuskript\manuskript.exe # Open/create a project
-
Check for extra language dictionaries (e.g., French).
# Check *Tools -> Dictionary* for French "fr" dictionaries.
-
Check for additional pandoc export options.
# Select *File -> Compile* # Check *Export to:* drop down for pandoc export options.
-
Exit manuskript.