diff --git a/.github/workflows/build_server_nsis.yml b/.github/workflows/build_nsis_bundle.yml similarity index 68% rename from .github/workflows/build_server_nsis.yml rename to .github/workflows/build_nsis_bundle.yml index 4fe89779..d1c6f588 100644 --- a/.github/workflows/build_server_nsis.yml +++ b/.github/workflows/build_nsis_bundle.yml @@ -14,6 +14,21 @@ jobs: with: python-version: "3.11" + - name: Electron Builder + env: # Setting environment variables for the entire job + GH_TOKEN: ${{ secrets.github_token }} + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} + APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + working-directory: gui + run: | + npm i + npm run build + + - name: LIST ALL FILES + run: ls -R + - name: Install Python dependencies run: | python -m pip install --upgrade pip @@ -38,7 +53,7 @@ jobs: - name: Create installer uses: joncloud/makensis-action@v4 with: - script-file: "freedata-server-nsis-config.nsi" + script-file: "freedata-nsis-config.nsi" arguments: '/V3' - name: LIST ALL FILES @@ -47,12 +62,12 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: 'FreeData-Server-Installer' - path: ./FreeData-Server-Installer.exe + name: 'FreeDATA-Installer' + path: ./FreeDATA-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 + files: ./FreeDATA-Installer.exe diff --git a/freedata-server-nsis-config.nsi b/freedata-nsis-config.nsi similarity index 51% rename from freedata-server-nsis-config.nsi rename to freedata-nsis-config.nsi index a7ec2948..b862ea7a 100644 --- a/freedata-server-nsis-config.nsi +++ b/freedata-nsis-config.nsi @@ -4,16 +4,14 @@ RequestExecutionLevel admin ; The name and file name of the installer -Name "FreeData Server" -OutFile "FreeData-Server-Installer.exe" +Name "FreeDATA Installer" +OutFile "FreeDATA-Installer.exe" -; Default installation directory -; InstallDir "$PROGRAMFILES\FreeData\freedata-server" - -InstallDir "$LOCALAPPDATA\FreeData\freedata-server" +; Default installation directory for the server +InstallDir "$LOCALAPPDATA\FreeDATA" ; Registry key to store the installation directory -InstallDirRegKey HKCU "Software\FreeData\freedata-server" "Install_Dir" +InstallDirRegKey HKCU "Software\FreeDATA" "Install_Dir" ; Modern UI settings !define MUI_ABORTWARNING @@ -22,19 +20,15 @@ InstallDirRegKey HKCU "Software\FreeData\freedata-server" "Install_Dir" !define MUI_ICON "documentation\icon.ico" !define MUI_UNICON "documentation\icon.ico" ; Icon for the uninstaller - ; Define the welcome page text -!define MUI_WELCOMEPAGE_TEXT "Welcome to the FreeData Server Setup Wizard. This wizard will guide you through the installation process." +!define MUI_WELCOMEPAGE_TEXT "Welcome to the FreeDATA Setup Wizard. This wizard will guide you through the installation process." !define MUI_FINISHPAGE_TEXT "Folder: $INSTDIR" - - -!define MUI_DIRECTORYPAGE_TEXT_TOP "Please select the installation folder. Its recommended using the suggested one for avoiding permission problems." - +!define MUI_DIRECTORYPAGE_TEXT_TOP "Please select the installation folder. It's recommended to use the suggested one to avoid permission problems." ; Pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "LICENSE" -;!insertmacro MUI_PAGE_COMPONENTS +!insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH @@ -50,53 +44,43 @@ InstallDirRegKey HKCU "Software\FreeData\freedata-server" "Install_Dir" ; Installer Sections Section "FreeData Server" SEC01 - ; Set output path to the installation directory - SetOutPath $INSTDIR + SetOutPath $INSTDIR\freedata-server - ; Check if "config.ini" exists and back it up - IfFileExists $INSTDIR\config.ini backupConfig - -doneBackup: ; Add your application files here - File /r "modem\server.dist\*.*" - - ; Restore the original "config.ini" if it was backed up - IfFileExists $INSTDIR\config.ini.bak restoreConfig - - + File /r "modem\server.dist\*" ; Create a shortcut in the user's desktop - CreateShortCut "$DESKTOP\FreeData Server.lnk" "$INSTDIR\freedata-server.exe" + CreateShortCut "$DESKTOP\FreeDATA Server.lnk" "$INSTDIR\freedata-server.exe" ; Create Uninstaller WriteUninstaller "$INSTDIR\Uninstall.exe" +SectionEnd -; Backup "config.ini" before overwriting files -backupConfig: - Rename $INSTDIR\config.ini $INSTDIR\config.ini.bak - Goto doneBackup - -; Restore the original "config.ini" -restoreConfig: - Delete $INSTDIR\config.ini - Rename $INSTDIR\config.ini.bak $INSTDIR\config.ini +Section "FreeData GUI" SEC02 + ; Set output path to the GUI installation directory + SetOutPath $INSTDIR\freedata-gui + ; Add GUI files here + File /r "gui\release\windows-unpacked\*" + ; Create a shortcut on the desktop for the GUI + CreateShortCut "$DESKTOP\FreeDATA GUI.lnk" "$INSTDIR\freedata-gui\freedata.exe" SectionEnd ; Uninstaller Section Section "Uninstall" - - ; Delete files and directories + ; Delete files and directories for the server Delete $INSTDIR\freedata-server.exe - RMDir /r $INSTDIR + RMDir /r $INSTDIR\freedata-server - ; Remove the shortcut - Delete "$DESKTOP\FreeData Server.lnk" + ; Delete files and directories for the GUI + Delete $INSTDIR\freedata-gui\*.* + RMDir /r $INSTDIR\freedata-gui + + ; Remove the desktop shortcuts + Delete "$DESKTOP\FreeDATA Server.lnk" + Delete "$DESKTOP\FreeDATA GUI.lnk" ; Additional uninstallation commands here - SectionEnd - - diff --git a/gui/electron-builder.json5 b/gui/electron-builder.json5 index cf11795a..c1b5d6cd 100644 --- a/gui/electron-builder.json5 +++ b/gui/electron-builder.json5 @@ -45,7 +45,7 @@ "icon": "build/icon.png", "target": [ { - "target": "nsis", + "target": "portable", "arch": ["arm64", "x64"] } ],