mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-02 11:04:33 +12:00
Create new instructions to Package Manuskript for Windows with PyInstaller
parent
530e963819
commit
0c98574bdd
121
Package-Manuskript-for-Windows-with-PyInstaller.md
Normal file
121
Package-Manuskript-for-Windows-with-PyInstaller.md
Normal file
|
@ -0,0 +1,121 @@
|
|||
# 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](https://pyinstaller.readthedocs.io/en/stable/usage.html#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](https://github.com/pyinstaller/pyinstaller/issues/2174).
|
||||
- Binary package [wheels are provided for Python v3.5 and later for 64-bit Linux, OS X and 32-bit and 64-bit Windows](https://www.riverbankcomputing.com/software/pyqt/download5).
|
||||
|
||||
_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](https://github.com/olivierkes/manuskript/releases) using Windows Explorer.
|
||||
|
||||
Be sure to include optional software such as Markdown and PyEnchant so that these are included in the package.
|
||||
|
||||
- See [Run Manuskript from Source Code on Windows](https://github.com/olivierkes/manuskript/wiki/Run-Manuskript-from-Source-Code-on-Windows).
|
||||
|
||||
## Add Icon for Windows EXE
|
||||
|
||||
These steps build the icon file using Linux.
|
||||
|
||||
1. Open `manuskript/icons/Manuskript/ico-512px.png` in gimp.
|
||||
|
||||
2. Image resize to 48x48.
|
||||
|
||||
3. Export as ".ico" format and save as `manuskript.ico` file.
|
||||
|
||||
## Install Prerequisite Software Packages
|
||||
|
||||
Install all the necessary software required for creating the manuskript package.
|
||||
|
||||
1. 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.
|
||||
|
||||
1. Create the Manuskript package.
|
||||
|
||||
cd manuskript
|
||||
C:\Python34\Scripts\pyInstaller --icon=manuskript.ico manuskript.spec
|
||||
|
||||
This should create a `build` directory and a `dist` directory under the current working directory.
|
||||
|
||||
The `dist` directory contains the self-contained manuskript folder.
|
||||
|
||||
The log file with the warnings and erros is at `build\manuskript\warnmanuskript.txt`.
|
||||
|
||||
**NOTE: The icon does not appear to be applied to the manuskript.exe file**
|
||||
|
||||
2. Create a zip file using the manuskript files under the `dist` directory.
|
||||
|
||||
In Windows Explorer navigate to `dist` directory, right click on `manuskript`, select **Send To -> Compressed (zipped) Folder**.
|
||||
|
||||
This will create a `manuskript.zip` in the `dist` directory.
|
||||
|
||||
Rename `manuskript.zip` to `manuskript-#.#.#{-#}-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 TEST INSTALLATION
|
||||
|
||||
Use the following steps on a different computer or Virtual Machine to test that the manuskript package works.
|
||||
|
||||
1. Copy the manuskript-#.#.#{-#}-win32.zip file and extract using Windows Explorer.
|
||||
|
||||
2. Install a different language dictionary (e.g. French).
|
||||
|
||||
**SKIP THIS STEP for now as instructions are Linux specific**
|
||||
|
||||
sudo apt install aspell-fr
|
||||
|
||||
3. Download and install pandoc from [http://pandoc.org](http://pandoc.org) for more export format options.
|
||||
|
||||
4. Run manuskript and open/create a project.
|
||||
|
||||
.\manuskript\manuskript.exe
|
||||
# Open/create a project
|
||||
|
||||
5. Check for extra language dictionaries (e.g., French).
|
||||
|
||||
# Check *Tools -> Dictionary* for French "fr" dictionaries.
|
||||
|
||||
6. Check for additional pandoc export options.
|
||||
|
||||
# Select *File -> Compile*
|
||||
# Check *Export to:* drop down for pandoc export options.
|
||||
|
||||
7. Exit manuskript.
|
||||
|
||||
# REFERENCES
|
||||
|
||||
- [Using PyInstaller](https://pyinstaller.readthedocs.io/en/stable/usage.html)
|
||||
- [What is PyQT?](https://riverbankcomputing.com/software/pyqt/intro)
|
Loading…
Reference in a new issue