From f6ced0416abfcbdf6e0f3b6ac2f112047a36da8d Mon Sep 17 00:00:00 2001 From: suika <2320837+Suika@users.noreply.github.com> Date: Fri, 7 May 2021 17:39:09 +0200 Subject: [PATCH] Add windows build files InnoSetup, Pyinstaller, ffmpeg --- static/build_files/windows/InnoSetup.iss | 69 ++++++++++++++++++++ static/build_files/windows/client-win.spec | 50 ++++++++++++++ static/build_files/windows/server-win.spec | 38 +++++++++++ static/build_files/windows/windows_build.yml | 65 ++++++++++++++++++ 4 files changed, 222 insertions(+) create mode 100644 static/build_files/windows/InnoSetup.iss create mode 100644 static/build_files/windows/client-win.spec create mode 100644 static/build_files/windows/server-win.spec create mode 100644 static/build_files/windows/windows_build.yml diff --git a/static/build_files/windows/InnoSetup.iss b/static/build_files/windows/InnoSetup.iss new file mode 100644 index 00000000..ff9c0296 --- /dev/null +++ b/static/build_files/windows/InnoSetup.iss @@ -0,0 +1,69 @@ +[Icons] +Name: {group}\hydrus client; Filename: {app}\client.exe; WorkingDir: {app}; Tasks: programgroupicons +Name: {group}\hydrus server; Filename: {app}\server.exe; WorkingDir: {app}; Tasks: programgroupicons +Name: {group}\help; Filename: {app}\help\index.html; WorkingDir: {app}; Tasks: programgroupicons +Name: {group}\uninstall hydrus network; Filename: {uninstallexe}; WorkingDir: {app}; Tasks: programgroupicons; IconFilename: {app}\static\cross.ico +Name: {userdesktop}\hydrus client; Filename: {app}\client.exe; WorkingDir: {app}; Tasks: desktopicons +Name: {userdesktop}\hydrus server; Filename: {app}\server.exe; WorkingDir: {app}; Tasks: desktopicons +[Setup] +InternalCompressLevel=ultra64 +OutputDir=dist +OutputBaseFilename=HydrusInstaller +Compression=lzma/ultra64 +AppName=Hydrus Network +AppVerName=Hydrus Network +DefaultDirName={sd}\Hydrus Network +DefaultGroupName=Hydrus Network +DisableProgramGroupPage=yes +DisableReadyPage=yes +DisableDirPage=no +ShowLanguageDialog=no +SetupIconFile=hydrus\static\hydrus.ico +Uninstallable=IsComponentSelected('install') +UninstallDisplayIcon={app}\static\hydrus.ico +[Tasks] +Name: desktopicons; Description: Create desktop icons; Flags: unchecked; Components: install +Name: programgroupicons; Description: Create program group icons; Components: install +[Messages] +SelectDirBrowseLabel=To continue, click Next. If you would like to select a different folder, click Browse. Databases will be created beneath the install dir, so make sure the hard drive has enough spare space for your purposes and your user has permission to write there! If you install to program files, you'll need to run the programs as administrator! +[Components] +Name: install; Description: Install; Types: install; Flags: fixed +[Types] +Name: install; Description: Install +Name: extract; Description: Extract only +[Run] +Filename: {app}\help\index.html; Description: Open help/getting started guide (highly recommended for new users); Flags: postinstall unchecked shellexec +Filename: {app}\client.exe; Description: Open the client; Flags: postinstall nowait unchecked +[Files] +Source: dist\Hydrus Network\* ; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs +[InstallDelete] +Name: {app}\Crypto; Type: filesandordirs; Components: install +Name: {app}\tcl; Type: filesandordirs; Components: install +Name: {app}\tk; Type: filesandordirs; Components: install +Name: {app}\wx; Type: filesandordirs; Components: install +Name: {app}\lz4-3.0.2-py3.7.egg-info; Type: filesandordirs; Components: install +Name: {app}\lz4-2.1.6-py3.6.egg-info; Type: filesandordirs; Components: install +Name: {app}\cryptography-2.9-py3.7.egg-info; Type: filesandordirs; Components: install +Name: {app}\cryptography-2.4.2-py3.6.egg-info; Type: filesandordirs; Components: install +Name: {app}\lib2to3; Type: filesandordirs; Components: install +Name: {app}\mpl-data; Type: filesandordirs; Components: install +Name: {app}\matplotlib; Type: filesandordirs; Components: install +Name: {app}\cryptography; Type: filesandordirs; Components: install +Name: {app}\opencv_ffmpeg344_64.dll; Type: files; Components: install +Name: {app}\opencv_ffmpeg400_64.dll; Type: files; Components: install +Name: {app}\opencv_ffmpeg410_64.dll; Type: files; Components: install +Name: {app}\opencv_videoio_ffmpeg411_64.dll; Type: files; Components: install +Name: {app}\opencv_videoio_ffmpeg412_64.dll; Type: files; Components: install +Name: {app}\opencv_videoio_ffmpeg420_64.dll; Type: files; Components: install +Name: {app}\opencv_videoio_ffmpeg440_64.dll; Type: files; Components: install +Name: {app}\wxmsw30u_core_vc140_x64.dll; Type: files; Components: install +Name: {app}\wxmsw30u_adv_vc140_x64.dll; Type: files; Components: install +Name: {app}\wxbase30u_vc140_x64.dll; Type: files; Components: install +Name: {app}\wxbase30u_net_vc140_x64.dll; Type: files; Components: install +Name: {app}\tk86t.dll; Type: files; Components: install +Name: {app}\tcl86t.dll; Type: files; Components: install +Name: {app}\_tkinter.pyd; Type: files; Components: install +Name: {app}\_yaml.cp36-win_amd64.pyd; Type: files; Components: install +Name: {app}\_yaml.cp37-win_amd64.pyd; Type: files; Components: install +Name: {app}\_cffi_backend.cp36-win_amd64.pyd; Type: files; Components: install +Name: {app}\_distutils_findvs.pyd; Type: files; Components: install \ No newline at end of file diff --git a/static/build_files/windows/client-win.spec b/static/build_files/windows/client-win.spec new file mode 100644 index 00000000..27269336 --- /dev/null +++ b/static/build_files/windows/client-win.spec @@ -0,0 +1,50 @@ +# -*- mode: python ; coding: utf-8 -*- + +block_cipher = None + + +a = Analysis(['hydrus\\client.pyw'], + pathex=['.'], + binaries=[], + datas=[ + ('hydrus\\bin', 'bin'), + ('hydrus\\help', 'help'), + ('hydrus\\static', 'static'), + ('hydrus\\client.pyw', '.'), + ('hydrus\\client.py', '.'), + ('hydrus\\server.py', '.'), + ('dist\\server\\server.exe*', '.'), + ('hydrus\\license.txt', '.'), + ('hydrus\\Readme.txt', '.'), + ('hydrus\\help my client will not boot.txt', '.'), + ('hydrus\\db', 'db') + ], + hiddenimports=['hydrus\\server.py'], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + [], + exclude_binaries=True, + name='client', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=False, + icon='hydrus\\static\\hydrus.ico' ) +coll = COLLECT(exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=False, + upx_exclude=[], + name='Hydrus Network') diff --git a/static/build_files/windows/server-win.spec b/static/build_files/windows/server-win.spec new file mode 100644 index 00000000..6146dd7a --- /dev/null +++ b/static/build_files/windows/server-win.spec @@ -0,0 +1,38 @@ +# -*- mode: python ; coding: utf-8 -*- + +block_cipher = None + + +a = Analysis(['hydrus\\server.py'], + pathex=['.'], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + [], + exclude_binaries=True, + name='server', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=False, + console=False, + icon='hydrus\\static\\hydrus.ico' ) +coll = COLLECT(exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=False, + upx_exclude=[], + name='server') diff --git a/static/build_files/windows/windows_build.yml b/static/build_files/windows/windows_build.yml new file mode 100644 index 00000000..471dd323 --- /dev/null +++ b/static/build_files/windows/windows_build.yml @@ -0,0 +1,65 @@ +name: Release +on: + push: + tags: + - 'v*' + +jobs: + build-windows: + runs-on: [windows-latest] + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + path: hydrus + - uses: FedericoCarboni/setup-ffmpeg@v1 + id: setup_ffmpeg + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + architecture: x64 + - name: Cache Qt + id: cache-qt + uses: actions/cache@v2.1.4 + with: + path: Qt + key: ${{ runner.os }}-QtCache + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + install-deps: true + setup-python: 'false' + modules: qtcharts qtwidgets qtgui qtcore + cached: ${{ steps.cache-qt.outputs.cache-hit }} + - name: Pip Installer + uses: BSFishy/pip-action@v1 + with: + packages: pyinstaller + requirements: hydrus\requirements.txt + - name: build with pyinstaller + run: | + move ${{ steps.setup_ffmpeg.outputs.ffmpeg-path }} hydrus\bin\ + move hydrus\static\build_files\windows\client-win.spec client-win.spec + move hydrus\static\build_files\windows\server-win.spec server-win.spec + pyinstaller server-win.spec + pyinstaller client-win.spec + dir -r + - name: InnoSetup + run: | + move hydrus\static\build_files\windows\InnoSetup.iss InnoSetup.iss + ISCC.exe InnoSetup.iss + - name: Upload a Build Artifact + uses: actions/upload-artifact@v2 + with: + name: Windows-Extract + path: dist\Hydrus Network + - name: Upload a Build Artifact + uses: actions/upload-artifact@v2 + with: + name: Windows-Install + path: dist\HydrusInstaller.exe + if-no-files-found: error + retention-days: 2 \ No newline at end of file