don't delete config on update, adjusted audio device fetching

This commit is contained in:
DJ2LS 2024-03-03 09:49:21 +01:00
parent f6170604a6
commit 1c6109a25a
4 changed files with 27 additions and 9 deletions

View File

@ -47,14 +47,34 @@ Section "FreeData Server" SEC01
; Set output path to the installation directory
SetOutPath $INSTDIR\freedata-server
; Check if "config.ini" exists and back it up
IfFileExists $INSTDIR\freedata-server\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\freedata-server\config.ini.bak restoreConfig
; Create a shortcut in the user's desktop
CreateShortCut "$DESKTOP\FreeDATA Server.lnk" "$INSTDIR\freedata-server.exe"
; Create Uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
; Backup "config.ini" before overwriting files
backupConfig:
Rename $INSTDIR\freedata-server\config.ini $INSTDIR\freedata-server\config.ini.bak
Goto doneBackup
; Restore the original "config.ini"
restoreConfig:
Delete $INSTDIR\freedata-server\config.ini
Rename $INSTDIR\freedata-server\config.ini.bak $INSTDIR\freedata-server\config.ini
SectionEnd
Section "FreeData x64 GUI" SEC02

View File

@ -117,9 +117,10 @@ app.whenReady().then(() => {
//serverProcess.unref(); // Allow the server process to continue running independently of the parent process
// break;
case "win32":
console.log(`Starting server with path: ${serverPath}`);
serverPath = join(basePath, "freedata-server", "freedata-server.exe");
serverProcess = spawn('cmd.exe', ['/c', 'start', 'cmd.exe', '/k', serverPath], { shell: true });
console.log(`Starting server with path: ${serverPath}`);
serverProcess = spawn('cmd.exe', ['/c', 'start', 'cmd.exe', '/c', serverPath], { shell: true });
console.log(`Started server | PID: ${serverProcess.pid}`);
break;
default:
@ -142,8 +143,6 @@ serverProcess.stderr.on('data', (data) => {
console.error(`stderr: ${data}`);
});
//)
});
app.on('before-quit', () => {

View File

@ -134,12 +134,7 @@ export function eventDispatcher(data) {
displayToast("success", "bi-ethernet", message, 5000);
stateStore.modem_connection = "connected";
getRemote().then(() => {
//initConnections();
getModemState();
});
//getRemote();
getModemState();
getOverallHealth();
loadAudioDevices();

View File

@ -32,8 +32,12 @@ const tooltipList = [...tooltipTriggerList].map(
import { getRemote } from "./store/settingsStore";
import { initConnections } from "./js/event_sock.js";
import { getModemState } from "./js/api";
import { loadAudioDevices, loadSerialDevices } from "./js/deviceFormHelper.ts";
getRemote().then(() => {
initConnections();
loadAudioDevices();
loadSerialDevices();
getModemState();
});