attempt with nsis installer

This commit is contained in:
DJ2LS 2024-01-30 21:41:25 +01:00
parent d86d36a16e
commit f4e11f190c
4 changed files with 92 additions and 11 deletions

View file

@ -36,16 +36,6 @@ jobs:
with: with:
python-version: "3.11" 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 - name: Install Linux dependencies
# if: matrix.os == 'ubuntu-20.04' # if: matrix.os == 'ubuntu-20.04'
if: ${{startsWith(matrix.os, 'ubuntu')}} if: ${{startsWith(matrix.os, 'ubuntu')}}

47
.github/workflows/build_server_nsis.yml vendored Normal file
View file

@ -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

View file

@ -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

View file

@ -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"}