From 7141ebecf7a148126ad5a8251c70f3e0f5c5fb82 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Wed, 22 Feb 2017 14:28:50 -0800 Subject: [PATCH] Update Windows build script to work with PyInstaller, update readme about only having onionshare-gui.exe, and update PyInstaller spec to create an 'onionshare' folder instead of an 'onionshare-gui' one --- BUILD.md | 4 ++-- install/build_exe.bat | 12 +++++++----- install/pyinstaller.spec | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/BUILD.md b/BUILD.md index 6762fd9d..6d0bbeb5 100644 --- a/BUILD.md +++ b/BUILD.md @@ -114,11 +114,11 @@ If you want to sign binaries with Authenticode: For PyInstaller to work, you might need to edit `Scripts\pyinstaller-script.py` in your Python 3.5 folder, to work around [this bug](https://stackoverflow.com/questions/31808180/installing-pyinstaller-via-pip-leads-to-failed-to-create-process) in pip. -* Open a command prompt, cd into the onionshare directory, and type: `pyinstaller install\pyinstaller.spec`. `onionshare.exe`, `onionshare-gui.exe`, and all of their supporting files will get created inside the `build` folder. +* Open a command prompt, cd into the onionshare directory, and type: `pyinstaller install\pyinstaller.spec`. `onionshare-gui.exe` and all of their supporting files will get created inside the `dist` folder. ### To build the installer: -Note that you must have a codesigning certificate installed in order to use the `install\build_exe.bat` script, because it codesigns `onionshare.exe`, `uninstall.exe`, and `OnionShare_Setup.exe`. +Note that you must have a codesigning certificate installed in order to use the `install\build_exe.bat` script, because it codesigns `onionshare-gui.exe`, `uninstall.exe`, and `OnionShare_Setup.exe`. Open a command prompt, cd to the onionshare directory, and type: `install\build_exe.bat` diff --git a/install/build_exe.bat b/install/build_exe.bat index bfbb998e..0763560a 100644 --- a/install/build_exe.bat +++ b/install/build_exe.bat @@ -1,12 +1,14 @@ -REM build onionshare.exe, onionshare-gui.exe +REM delete old build files +rmdir /s /q build +rmdir /s /q dist + +REM build onionshare-gui.exe pyinstaller install\pyinstaller.spec -y -REM sign onionshare.exe, onionshare-gui.exe -signtool.exe sign /v /d "OnionShare" /a /tr http://timestamp.globalsign.com/scripts/timstamp.dll /fd sha256 build\exe.win32-3.5\onionshare.exe -signtool.exe sign /v /d "OnionShare" /a /tr http://timestamp.globalsign.com/scripts/timstamp.dll /fd sha256 build\exe.win32-3.5\onionshare-gui.exe +REM sign onionshare-gui.exe +signtool.exe sign /v /d "OnionShare" /a /tr http://timestamp.globalsign.com/scripts/timstamp.dll /fd sha256 dist\onionshare\onionshare-gui.exe REM build an installer, dist\OnionShare_Setup.exe -mkdir dist makensis.exe install\onionshare.nsi REM sign OnionShare_Setup.exe diff --git a/install/pyinstaller.spec b/install/pyinstaller.spec index 1b8be28c..50be975d 100644 --- a/install/pyinstaller.spec +++ b/install/pyinstaller.spec @@ -46,7 +46,7 @@ coll = COLLECT( a.datas, strip=False, upx=True, - name='onionshare-gui') + name='onionshare') if p == 'Darwin': app = BUNDLE(