From f4e11f190c71bed7b07eb46b64eeef32b905ab0e Mon Sep 17 00:00:00 2001 From: DJ2LS Date: Tue, 30 Jan 2024 21:41:25 +0100 Subject: [PATCH] attempt with nsis installer --- .github/workflows/build_server.yml | 10 ------ .github/workflows/build_server_nsis.yml | 47 +++++++++++++++++++++++++ freedata-server-nsis-config.nsi | 45 +++++++++++++++++++++++ modem/callsign_reverse_db.txt | 1 - 4 files changed, 92 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/build_server_nsis.yml create mode 100644 freedata-server-nsis-config.nsi delete mode 100644 modem/callsign_reverse_db.txt diff --git a/.github/workflows/build_server.yml b/.github/workflows/build_server.yml index 80890af9..a9472a3d 100644 --- a/.github/workflows/build_server.yml +++ b/.github/workflows/build_server.yml @@ -36,16 +36,6 @@ jobs: with: python-version: "3.11" - - name: Create modem/dist - working-directory: modem - run: | - mkdir -p dist - - - name: Create modem/dist/modem - working-directory: modem - run: | - mkdir -p dist/modem - - name: Install Linux dependencies # if: matrix.os == 'ubuntu-20.04' if: ${{startsWith(matrix.os, 'ubuntu')}} diff --git a/.github/workflows/build_server_nsis.yml b/.github/workflows/build_server_nsis.yml new file mode 100644 index 00000000..27a0f2b2 --- /dev/null +++ b/.github/workflows/build_server_nsis.yml @@ -0,0 +1,47 @@ +name: Build and Release Installer + +on: + push: + branches: + - main # or any branch you prefer + +jobs: + build-and-release: + runs-on: windows-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Build binaries + working-directory: modem + run: | + python3 -m nuitka --remove-output --assume-yes-for-downloads --follow-imports --include-data-dir=lib=lib --include-data-files=lib/codec2/*=lib/codec2/ --include-data-files=config.ini.example=config.ini --standalone server.py --output-filename=freedata-server + + - name: Create installer + uses: joncloud/makensis-action@v4 + with: + script-file: "freedata-server-nsis-config.nsi" + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: 'FreeData-Server-Installer' + path: ../FreeData-Server-Installer.exe + + - name: Upload Installer to Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/v') + with: + draft: true + files: ./FreeData-Server-Installer.exe diff --git a/freedata-server-nsis-config.nsi b/freedata-server-nsis-config.nsi new file mode 100644 index 00000000..5cab0150 --- /dev/null +++ b/freedata-server-nsis-config.nsi @@ -0,0 +1,45 @@ +; NSIS Script for FreeData Server + +; Name of the installer +OutFile "FreeData-Server-Installer.exe" + +; Default installation directory +InstallDir "$PROGRAMFILES\FreeData Server" + +; Registry key to store the installation directory +InstallDirRegKey HKCU "Software\FreeDataServer" "Install_Dir" + +; Show installation details +ShowInstDetails show + +; Show uninstallation details +ShowUninstDetails show + +Section "MainSection" SEC01 + + ; Set the output path to the installation directory + SetOutPath $INSTDIR + + ; Add the entire FreeData Server directory + File /r "modem/server.dist/*.*" + + ; Write the installation path to the registry + WriteRegStr HKCU "Software\FreeDataServer" "Install_Dir" "$INSTDIR" + + ; Create a desktop shortcut for easy access + CreateShortCut "$DESKTOP\FreeData Server.lnk" "$INSTDIR\freedata-server.exe" + +SectionEnd + +Section "Uninstall" + + ; Delete the entire FreeData Server directory + RMDir /r $INSTDIR + + ; Remove the registry entry + DeleteRegKey HKCU "Software\FreeDataServer" + + ; Delete the desktop shortcut + Delete "$DESKTOP\FreeData Server.lnk" + +SectionEnd \ No newline at end of file diff --git a/modem/callsign_reverse_db.txt b/modem/callsign_reverse_db.txt deleted file mode 100644 index d3e169f7..00000000 --- a/modem/callsign_reverse_db.txt +++ /dev/null @@ -1 +0,0 @@ -{"DJ2LS-0": "22864b", "IW2DHW-0": "fcef94", "BEACON": "5492c7", "EI7IG-0": "0975c8", "G0HWW-0": "2cb363", "LA3QMA-0": "2b9fac", "EA7KOH-0": "9e1c3e", "OK6MS-0": "5f75ed", "N1QM-0": "e045a0"} \ No newline at end of file