From 23f186104ae4f82d3c753d627df1f55b951517aa Mon Sep 17 00:00:00 2001 From: Zen-CODE Date: Fri, 29 Mar 2013 02:36:52 -0500 Subject: [PATCH 1/3] Revisions to /guide/packaging-windows.rst --- doc/sources/guide/packaging-windows.rst | 66 ++++++++++++++----------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/doc/sources/guide/packaging-windows.rst b/doc/sources/guide/packaging-windows.rst index ea494dc57..bd3faad1b 100644 --- a/doc/sources/guide/packaging-windows.rst +++ b/doc/sources/guide/packaging-windows.rst @@ -1,12 +1,12 @@ -Create package for Windows -========================== +Create a package for Windows +============================ -Packaging your application for Windows platform can be done only inside the -Windows OS. The following method have been tested only inside VirtualBox and -Windows Seven, using the portable package of Kivy. +Packaging your application for the Windows platform can only be done inside the +Windows OS. The following process has only been tested inside VirtualBox using +Windows 7 and the portable package of Kivy. -The package will be 32 bits, and can be run on both 32/64 bits windows -platform. +The package is 32 bits but can be run on both 32 and 64 bit Windows +platforms. .. _packaging-windows-requirements: @@ -14,41 +14,47 @@ Requirements ------------ * Latest Kivy (the whole portable package, not only the github sourcecode) - * PyInstaller 2.0: http://www.pyinstaller.org/#Downloads + * `PyInstaller 2.0 `_ .. _Create-the-spec-file: Create the spec file -------------------- -For the example, we'll package touchtracer example, using a custom icon. The -touchtracer is the `kivy/examples/demo/touchtracer/` directory, and the main -file is named `main.py` +For this example, we'll package the touchtracer example and embed a custom icon. +The touchtracer example is the `kivy/examples/demo/touchtracer` directory, and +the main file is named `main.py`. -#. Double click on the Kivy.bat, a console will open +#. Double click on the Kivy.bat and a console will open. #. Go to the pyinstaller 2.0 directory, and create the initial specs:: cd pyinstaller-2.0 - python pyinstaller.py --name touchtracer ..\kivy\examples\demo\touchtracer\main.py + python pyinstaller.py --name touchtracer ../kivy/examples/demo/touchtracer/main.py - Alternatively, you can add an icon.ico to the main executable. If you don't have an .ico file available, you can convert your icon.png file to ico with the http://www.convertico.com/. Save the icon.ico in the touchtracer directory and do:: + You can also add an `icon.ico` file to the application folder in order to create an icon + for the executable. If you don't have an .ico file available, you can convert your + `icon.png` file to ico using the web app `ConvertICO `_. + Save the `icon.ico` in the touchtracer directory and type:: - python pyinstaller.py --name touchtracer --icon ..\kivy\examples\demo\touchtracer\icon.ico ..\kivy\examples\demo\touchtracer\main.py + python pyinstaller.py --name touchtracer --icon ../kivy/examples/demo/touchtracer/icon.ico ../kivy/examples/demo/touchtracer/main.py -#. The specs file is located on `touchtracer/touchtracer.spec` inside the - pyinstaller directory. Now we need to edit the spec file to add kivy hooks - to correctly build the exe. - Open the spec file with your favorite editor and put theses lines at the - start of the spec:: + For more options, please consult the + `PyInstaller 2 Manual `_. + +#. The spec file will be `touchtracer.spec` located in inside the + pyinstaller + `/touchtracer` directory. Now we need to edit the spec file to add + kivy hooks to correctly build the exe. + Open the spec file with your favorite editor and add theses lines at the + beginning of the spec:: from kivy.tools.packaging.pyinstaller_hooks import install_hooks install_hooks(globals()) - In the `Analysis()` command, remove the `hookspath=None` parameters. - Otherwise, the kivy package hook will not be used at all. + In the `Analysis()` function, remove the `hookspath=None` parameter. + If you don't do this, the kivy package hook will not be used at all. - Then, you need to change the `COLLECT()` call to add the data of touchtracer - (`touchtracer.kv`, `particle.png`, ...). Change the line to add a Tree() + Then you need to change the `COLLECT()` call to add the data for touchtracer + (`touchtracer.kv`, `particle.png`, ...). Change the line to add a `Tree()` object. This Tree will search and add every file found in the touchtracer directory to your final package:: @@ -57,24 +63,24 @@ file is named `main.py` #... ) -#. This is done, your spec is ready to be executed ! +#. We are done. Your spec is ready to be executed! .. _Build-the-spec: Build the spec -------------- -#. Double click on Kivy.bat +#. Double click on `Kivy.bat` #. Go to the pyinstaller directory, and build the spec:: cd pyinstaller-2.0 - python pyinstaller.py touchtracer\\touchtracer.spec + python pyinstaller.py touchtracer/touchtracer.spec -#. The package will be in the `touchtracer\\dist\\touchtracer` directory ! +#. The package will be in the `touchtracer/dist/touchtracer` directory. Including Gstreamer ------------------- -If you wish to use Gstreamer, refer to the most up-to-date documentation in the -:doc:`packaging-macosx`. +If you wish to use Gstreamer, please refer to the most up-to-date documentation +in :doc:`packaging-macosx`. From fa3c208a3f428562792d03330ce554360aededcb Mon Sep 17 00:00:00 2001 From: Zen-CODE Date: Fri, 29 Mar 2013 02:39:44 -0500 Subject: [PATCH 2/3] Restored 'will be' --- doc/sources/guide/packaging-windows.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sources/guide/packaging-windows.rst b/doc/sources/guide/packaging-windows.rst index bd3faad1b..0cdde300e 100644 --- a/doc/sources/guide/packaging-windows.rst +++ b/doc/sources/guide/packaging-windows.rst @@ -5,7 +5,7 @@ Packaging your application for the Windows platform can only be done inside the Windows OS. The following process has only been tested inside VirtualBox using Windows 7 and the portable package of Kivy. -The package is 32 bits but can be run on both 32 and 64 bit Windows +The package will be 32 bits but can be run on both 32 and 64 bit Windows platforms. .. _packaging-windows-requirements: From c6d8ee41931bc8597434b10d2816f7409da866a8 Mon Sep 17 00:00:00 2001 From: Zen-CODE Date: Fri, 29 Mar 2013 13:11:07 -0500 Subject: [PATCH 3/3] Reworked the folder separators --- doc/sources/guide/packaging-windows.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/sources/guide/packaging-windows.rst b/doc/sources/guide/packaging-windows.rst index 0cdde300e..7c79b1f98 100644 --- a/doc/sources/guide/packaging-windows.rst +++ b/doc/sources/guide/packaging-windows.rst @@ -22,27 +22,27 @@ Create the spec file -------------------- For this example, we'll package the touchtracer example and embed a custom icon. -The touchtracer example is the `kivy/examples/demo/touchtracer` directory, and +The touchtracer example is the `kivy\examples\demo\touchtracer` directory, and the main file is named `main.py`. #. Double click on the Kivy.bat and a console will open. #. Go to the pyinstaller 2.0 directory, and create the initial specs:: cd pyinstaller-2.0 - python pyinstaller.py --name touchtracer ../kivy/examples/demo/touchtracer/main.py + python pyinstaller.py --name touchtracer ..\kivy\examples\demo\touchtracer\main.py You can also add an `icon.ico` file to the application folder in order to create an icon for the executable. If you don't have an .ico file available, you can convert your `icon.png` file to ico using the web app `ConvertICO `_. - Save the `icon.ico` in the touchtracer directory and type:: + Save the `icon.ico` in the touchtracer dxirectory and type:: - python pyinstaller.py --name touchtracer --icon ../kivy/examples/demo/touchtracer/icon.ico ../kivy/examples/demo/touchtracer/main.py + python pyinstaller.py --name touchtracer --icon ..\kivy\examples\demo\touchtracer\icon.ico ..\kivy\examples\demo\touchtracer\main.py For more options, please consult the `PyInstaller 2 Manual `_. #. The spec file will be `touchtracer.spec` located in inside the - pyinstaller + `/touchtracer` directory. Now we need to edit the spec file to add + pyinstaller + `\touchtracer` directory. Now we need to edit the spec file to add kivy hooks to correctly build the exe. Open the spec file with your favorite editor and add theses lines at the beginning of the spec:: @@ -74,9 +74,9 @@ Build the spec #. Go to the pyinstaller directory, and build the spec:: cd pyinstaller-2.0 - python pyinstaller.py touchtracer/touchtracer.spec + python pyinstaller.py touchtracer\touchtracer.spec -#. The package will be in the `touchtracer/dist/touchtracer` directory. +#. The package will be in the `touchtracer\dist\touchtracer` directory. Including Gstreamer