From 5dd0915f152e159dba75b34a2a55006c81e91f25 Mon Sep 17 00:00:00 2001 From: gimick Date: Tue, 22 Jun 2010 00:35:04 +0100 Subject: [PATCH] add walkthrough of py2exe for python26/fpdb0.20 --- .../windows/py2exeWalkthroughPython26.txt | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 packaging/windows/py2exeWalkthroughPython26.txt diff --git a/packaging/windows/py2exeWalkthroughPython26.txt b/packaging/windows/py2exeWalkthroughPython26.txt new file mode 100644 index 00000000..c7ad72fe --- /dev/null +++ b/packaging/windows/py2exeWalkthroughPython26.txt @@ -0,0 +1,147 @@ +PY2EXE walkthrough for Python 2.6 & FPDB 0.20 +created by Gimick on 22nd June 2010 + + +Step 0 Get a fresh XP installation +---------------------------------- + +0.1/ Using XPhome 32bit + +Step 1, Python install +---------------------- + +1.1/ install the following in sequence (accept all default options) there should be no errors ! + +Python 2.6.5 ... http://www.python.org/ftp/python/2.6.5/python-2.6.5.msi +pywin 214 ... http://sourceforge.net/projects/pywin32/files/pywin32/Build%20214/pywin32-214.win32-py2.6.exe/download +numpy 1.4.1 ... http://sourceforge.net/projects/numpy/files/NumPy/1.4.1/numpy-1.4.1-win32-superpack-python2.6.exe/download +matplotlib 0.99.3 ... http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/matplotlib-0.99.3.win32-py2.6.exe/download +pygtk 2.16.0 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.16/pygtk-2.16.0.win32-py2.6.exe +pycairo 1.8.6 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.8/pycairo-1.8.6.win32-py2.6.exe +pyGobject 2.20.0 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.20/pygobject-2.20.0.win32-py2.6.exe +py2exe 0.6.9 ... http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.6.exe/download + + +Step 2 Setup GTK +----------------- + +There are quite a few GTK packages needed, and rather than install them individually, I used the official AllinOne from the GTK project. + +2,1/ Create a new folder c:\GTK + +2.2/ Extract the following zip file into c:\GTK + +GTK+ all in one 2.20.0 ... http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.20/gtk+-bundle_2.20.0-20100406_win32.zip + +2.3/ If everything has worked, you should have c:\GTK\bin \etc \lib \src and so on created. + + +Step 3 Set GTK into the PATH variable +------------------------------------- + +The path for GTK isn't set by default, so need to let the o/s know where the GTK stuff is. + +3.1/ Rightclick on mycomputer to show system properties +3.2/ select advanced/environment Variables +3.3/ in "system variables" NOT "user variables" do the following +3.3.1/ create a new item as name: GTK_BASEPATH value: c:\GTK +3.3.2/ edit the item "path", press home to get to the first character and insert the following text, (no quotes, including semicolon) %GTK_BASEPATH%\bin; + +3.4/ to check, open command prompt and do: + +dos>path ... system should respond with ... PATH=c:\GTK\bin;C:\WIN........ + +3.5/ Give it a spin to test (hopefully an application will start, if not, something has gone wrong) + +dos> gtk-demo + +Step 4 Get the fpdb GIT tree +---------------------------- + +4.1/ Best to take a copy to work with; following steps will assume that the fpdb folder is on the Desktop + + +Step 5 Put MSVCP90.dll temporarily into the fpdb folder +------------------------------------------------------- + +py2exe will check for MSVCP90.dll. The version installed by python2.6.5runtime is not in the path, so we will put it in place TEMPORARILY. This will/must be removed manually once the exe has been created, as we do not have a licence to redistribute. + +Search for MSVCP90.dll (should be found in C:\WINDOWS\WinSxS\... +copy this file TEMPORARILY to the Desktop\fpdb\pyfpdb folder + +Step 6 Run py2exe to generate fpdb.exe +-------------------------------------- + +6.1/ Run the script to create the fpdb.exe bundle + +dos> cd Desktop\fpdb\pyfpdb +dos> c:\python26\python.exe py2exe_setup.py py2exe + +wait a while, watch lots of copying and whatever. + +6.2/ You should next get prompted for the GTK folder. +c:\GTK + +6.3/ If there are no errors reported, it has probably worked, we will test soon. + +Step 7 Delete C++runtime +------------------------ + +This is really really important, this file must NOT be distributed, so get rid of it now to avoid issues. + +7.1/ in Desktop\fpdb\pyfpdb\ remove the file msvcp90.dll + +Step 8 Drag out the completed bundle +------------------------------------ + +py2exe creates a new folder for the created software bundle, drag this out to the desktop for ease of working + +8.1/ Drag Desktop\fpdb\pyfpdb\fpdb-yyyymmdd-exe to Desktop\ + + +Step 9 Initial run +------------------ + +9.1/ Open the Desktop\fpdb-yyyymmdd-exe folder +9.2/ In explorer...tools...folder options...View uncheck "Hide extensions for known file types" +9.3/ Double click run_fpdb.bat +9.4/ check the contents of pyfpdb\fpdb.exe.log, deal with any errors thrown + +Step 10 drum roll....... +------------------------ + +10.1/ hopefully, fpdb will run +10.2/ Try out a few options, deal with any errors reported + +Observe that the msvcp90.dll was provided by the python runtime package, so we don't have to install the separate package from Microsoft. End-users will, however need the dependency. + +Step 11 pruning +--------------- + +11.1/ The generated folder is 100+MB and can be pruned by removing the following directories: + +pyfpdb/lib/glib-2.0 +pyfpdb/lib/gtk-2.0/include +pyfpdb/lib/pkgconfig +pyfpdb/share/aclocal +pyfpdb/share/doc +pyfpdb/share/glib-2.0 +pyfpdb/share/gtk-2.0 +pyfpdb/share/gtk-doc +pyfpdb/share/locale +pyfpdb/share/man + +Step 12 rename folder +--------------------- + +12/ Rename the folder to something meaningful to the community + +Step 13 Compress to executable archive +-------------------------------------- + +13.1/ Download and install 7zip 914 ... http://sourceforge.net/projects/sevenzip/files/7-Zip/9.14/7z914.exe/download +13.2/ Rightclick on fpdb executable folder, select 7zip Add to archive... select SFX archive option switch +13.3/ Test the created exe file + + +