4 Package Manuskript for Windows with PyInstaller
Tobias Frisch edited this page 2021-04-30 15:48:06 +02:00

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:

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.

  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 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 errors is at build\manuskript\warnmanuskript.txt.

  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 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.

  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 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