Changes

Jump to: navigation, search

Building Gramps AIO cx freeze-based

742 bytes added, 23:04, 25 May 2020
Get the tools
{{man note|Note|The first Gramps AIO package was created by an advanced Windows power-user named Josip. He is the one who evolved the AIO package and modified the AIO package over the years as Gramps has changed. Everything documented here initially done by him; this just documents some changes and tries to explain it for others. Any Gramps Windows user owes him a large debt of gratitude.}}
{{man notetip|Note|In this tutorial I you will be creating a 32-bit AIO. The steps for creating a 64-bit version are quite similar, just a few editing changes to the files and scripts. }}
==Prerequisites==
{{man note|Note|Josip uses a cx_Freeze with some changes he made to make the process a bit easier. I attempted to make similar changes, but we will have to build the utility. }}
Download https://gramps-project.org/wiki/images/a/a3/Mingw-w64-python-cx_Freeze.zip [[:File:Mingw-w64-python-cx_Freeze.zip| (stored here)]] to a convenient location with your browser.  I do my builds in the <code>c:\msys64\home\user\builds</code> directory, so we will make a new sub-directory for cx_Freeze there. 
I use 7-zip to extract to the <code>c:\msys64\home\user\builds\cx_Freeze</code> directory.
The patches included in the zip should fix up cx_Freeze for a bug where it tries to load an sqlite3.dll file, and to add properly optimized base files for Python startup (In the original version the 'optimize' functionality doesn't work).
 
NSIS is a tool to build the actual installer. As of NSIS version 3.05 the standard nsis available from the MINGW archive works.
pacman -S mingw-w64-i686-nsis
 
If you have NSIS version 3.04, The version in the mingw system has a bug that makes displaying of the font files during the AIO install messed up. I've created a patch, so we need to build our own.
Download https://gramps-project.org/wiki/index.php/File:Mingw-w64-nsis.zip [[:File:Mingw-w64-nsis.zip| (stored here)]] to a convenient location with your browser.
 
Unzip and cd into the directory then:
{{man note|Note|Use <code>MSYS2 MSYS</code> shell.}}
MINGW_INSTALLS=mingw32 makepkg-mingw -sLf
pacman -U mingw-w64-i686-nsis-3.0.4-1-any.pkg.tar.xz
=== Get a reference AIO ===
It will then ask where you want it installed. You can install it where you want, as it is only a temporary location which you may delete afterward. But make a note of the folder since you will need to know it later. Also, it needs to be a new (empty) folder, not an already existing one.
In this tutorial we'll say you tell the installer to put it into a new "<code>C:\Program Files (x86)\GrampsAIO32-45.21.80</code>" folder.
Then double-click on the AIO executable to start the 45.21.8 0 installation. (If your Windows asks whether you will allow that program to change things on your computer, say yes of course.)
You can put it anywhere you want but if you do, change the string "<code>C:\Program Files (x86)\GrampsAIO32-45.21.80</code>" in this tutorial to the actual name you used. But every time I use "<code>C:\Program Files (x86)\GrampsAIO32-45.21.80</code>" I mean the top of the tree where you installed the "old" AIO.
After the installer is finished, the last window will offer you the opportunity to "Run" the Gramps you just installed, so you should un-click that box before you hit "Finish", since there is no need to run the old one.
cd ~
cp -r "/c/Program Files (x86)/GrampsAIO32-45.21.80/src" aio
=== Modifying the setup.py script ===
<pre>
!define APPNAME "GrampsAIO32"
!define APPVERSION "45.21.80"
!define APPBUILD "1"
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}"
===== Increase the version number =====
Change the '''APPVERSION''' line from "45.21.80" to "45.21.91" instead (or higher if making a newer version).
===== If needed update APPNAME and APPBUILD =====
{{man note|Experimenting with NSIS compression|See [[Building Gramps AIO#Appendix_B|Appendix B]] for power-user details, at this stage.}}
The result is in <code>C:\msys64\home\user\aio\mingw32\src\GrampsAIO-45.21.91-1_win32.exe</code>.
{{man warn|If you do this more than once, make sure to delete the result file, or it will get encoded into the next AIO. }}
If you are a power user, you might have downloaded or used git to checkout the latest code in the grampsxx branch:
https://codeload.github.com/gramps-project/gramps/zip/maintenance/gramps42gramps51
but in any case, if you have downloaded something other than a gramps-release tar.gz (or .zip) file, say this in your top directory <code>~/grampsdev</code> (assuming you have installed Git for Windows):
but if it is an AIO for a maintenance branch, make a Snapshots folder in that branch and put it there, e.g.:
http://sourceforge.net/projects/gramps/files/Stable/45.21.21/Snapshots
so then the APPBUILD numbers will uniquely define that AIO.
But note that the NSIS-generated filename will say (for instance) "45.1.2.3" even though it is really a "45.21.21" with bugs fixed, which is why it belongs in 45.21.21/Snapshots.
Also see [[What to do for a release]]

Navigation menu