From 2d14b04541d05546d2a70b6f7db76d9c70ff0ef4 Mon Sep 17 00:00:00 2001 From: loucass003 Date: Wed, 11 Mar 2026 19:01:25 +0100 Subject: [PATCH 1/6] Make installer compatible with electron + nix flake --- .gitignore | 1 + flake.lock | 61 +++++++++++++++ flake.nix | 44 +++++++++++ windows/web/slimevr_web_installer.nsi | 106 +++----------------------- 4 files changed, 117 insertions(+), 95 deletions(-) create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..82e0cdf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/result \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..3848312 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1772963539, + "narHash": "sha256-9jVDGZnvCckTGdYT53d/EfznygLskyLQXYwJLKMPsZs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9dcb002ca1690658be4a04645215baea8b95f31d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..36ee102 --- /dev/null +++ b/flake.nix @@ -0,0 +1,44 @@ +{ + description = "Build environment for SlimeVR-Installer"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + packages.default = pkgs.stdenv.mkDerivation { + pname = "slimevr-installer"; + version = "1.0.0"; + src = ./.; + + nativeBuildInputs = [ pkgs.nsis ]; + + buildPhase = '' + makensis windows/web/slimevr_web_installer.nsi + ''; + + installPhase = '' + mkdir -p $out + cp windows/web/slimevr_web_installer.exe $out/ + ''; + }; + + devShells.default = pkgs.mkShell { + buildInputs = with pkgs; [ + nsis + wineWow64Packages.stable + ]; + + shellHook = '' + echo "SlimeVR Installer Dev Shell" + echo "Run 'makensis .nsi' to compile manually." + ''; + }; + }); +} \ No newline at end of file diff --git a/windows/web/slimevr_web_installer.nsi b/windows/web/slimevr_web_installer.nsi index 356b2a4..b789d42 100644 --- a/windows/web/slimevr_web_installer.nsi +++ b/windows/web/slimevr_web_installer.nsi @@ -39,10 +39,6 @@ Unicode True !define MVCDLURL "https://aka.ms/vc14/vc_redist.x64.exe" !define MVCDLFileZip "vc_redist.x64.exe" -!define WV2Version "" -!define WV2URLType "url" ; "url" or "local" -!define WV2DLURL "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -!define WV2DLFileZip "MicrosoftEdgeWebView2RuntimeInstaller.exe" # Define the Java Version Strings and to Check (JRE\relase -> JAVA_RUNTIME_VERSION=) !define JREVersion "17.0.17+10" !define JREURLType "url" ; "url" or "local" @@ -89,7 +85,7 @@ InstallDir "$PROGRAMFILES\SlimeVR Server" ; $InstDir default value. Defaults to ShowInstDetails show ShowUninstDetails show -BrandingText "SlimeVR Installer 3.0.0" +BrandingText "SlimeVR Installer 4.0.0" # Admin rights are required for: # 1. Removing Start Menu shortcut in Windows 7+ @@ -149,7 +145,7 @@ FunctionEnd Function .onInstFailed ${If} $SELECTED_INSTALLER_ACTION == "" - Call cleanInstDir + RMDir /r $INSTDIR ${Endif} FunctionEnd @@ -157,28 +153,6 @@ Function .onGUIEnd Call cleanTemp FunctionEnd -Function cleanInstDir - Delete "$INSTDIR\uninstall.exe" - Delete "$INSTDIR\run.bat" - Delete "$INSTDIR\run.ico" - Delete "$INSTDIR\slimevr*" - Delete "$INSTDIR\firewall*.bat" - Delete "$INSTDIR\MagnetoLib.dll" - Delete "$INSTDIR\steamvr.ps1" - Delete "$INSTDIR\log*" - Delete "$INSTDIR\*.log" - Delete "$INSTDIR\*.lck" - Delete "$INSTDIR\vrconfig.yml" - Delete "$INSTDIR\LICENSE*" - - RMDir /r "$INSTDIR\Recordings" - RMdir /r "$INSTDIR\jre" - RMdir /r "$INSTDIR\driver" - RMDir /r "$INSTDIR\logs" - RMdir /r "$INSTDIR\Feeder-App" - - RMDir $INSTDIR -FunctionEnd # Init functions end # Page Custom startPage startPageLeave @@ -311,7 +285,7 @@ Function endPageLeave ${If} $0 = 1 CreateDirectory "$SMPROGRAMS\SlimeVR Server" CreateShortcut "$SMPROGRAMS\SlimeVR Server\Uninstall SlimeVR Server.lnk" "$INSTDIR\uninstall.exe" - CreateShortcut "$SMPROGRAMS\SlimeVR Server\SlimeVR Server.lnk" "$INSTDIR\slimevr.exe" "" + CreateShortcut "$SMPROGRAMS\SlimeVR Server\SlimeVR Server.lnk" "$INSTDIR\SlimeVR.exe" "" ${Else} Delete "$SMPROGRAMS\Uninstall SlimeVR Server.lnk" Delete "$SMPROGRAMS\SlimeVR Server.lnk" @@ -319,7 +293,7 @@ Function endPageLeave ${Endif} ${If} $1 = 1 - CreateShortcut "$DESKTOP\SlimeVR Server.lnk" "$INSTDIR\slimevr.exe" "" + CreateShortcut "$DESKTOP\SlimeVR Server.lnk" "$INSTDIR\SlimeVR.exe" "" ${Else} Delete "$DESKTOP\SlimeVR Server.lnk" ${EndIf} @@ -330,7 +304,7 @@ Function endPageLeave ${If} $3 = 1 # use explorer to open it so it inherits the user token and starts as normal user - Exec '"$WINDIR\explorer.exe" "$INSTDIR\slimevr.exe"' + Exec '"$WINDIR\explorer.exe" "$INSTDIR\SlimeVR.exe"' ${EndIf} FunctionEnd @@ -449,44 +423,21 @@ Section "SlimeVR Server" SEC_SERVER SetOutPath $INSTDIR !insertmacro dlFile "${SVRServerURLType}" "SlimeVR Server" "${SVRServerVersion}" "${SVRServerDLURL}" "${SVRServerDLFileZip}" - !insertmacro unzipFile "SlimeVR Server" "${SVRServerVersion}" "${SLIMETEMP}\${SVRServerDLFileZip}" "${SLIMETEMP}\SlimeVR" - ${If} $SELECTED_INSTALLER_ACTION == "update" - Delete "$INSTDIR\slimevr-ui.exe" - ${EndIf} + CreateDirectory "${SLIMETEMP}\SlimeVR" + !insertmacro unzipFile "SlimeVR Server" "${SVRServerVersion}" "${SLIMETEMP}\${SVRServerDLFileZip}" "${SLIMETEMP}\SlimeVR" DetailPrint "Copying SlimeVR Server to installation folder..." - CopyFiles /SILENT "${SLIMETEMP}\SlimeVR\SlimeVR\*" $INSTDIR - - IfFileExists "$INSTDIR\slimevr-ui.exe" found not_found - found: - Delete "$INSTDIR\slimevr.exe" - Rename "$INSTDIR\slimevr-ui.exe" "$INSTDIR\slimevr.exe" - not_found: + CopyFiles /SILENT "${SLIMETEMP}\SlimeVR\*" $INSTDIR Delete "$INSTDIR\run.bat" + Delete "$INSTDIR\slimevr-ui.exe" Delete "$INSTDIR\run.ico" # Create the uninstaller WriteUninstaller "$INSTDIR\uninstall.exe" SectionEnd -Section "Webview2" SEC_WEBVIEW - SectionIn RO - # Read Only protects it from Installing when it is not needed - - !insertmacro dlFile "${WV2URLType}" "webview2" "${WV2Version}" "${WV2DLURL}" "${WV2DLFileZip}" - - DetailPrint "Installing webview2!" - nsExec::ExecToLog '"${SLIMETEMP}\MicrosoftEdgeWebView2RuntimeInstaller.exe" /silent /install' $0 - Pop $0 - DetailPrint "Installing finished with $0." - ${If} $0 != 0 - Abort "Failed to install webview 2" - ${EndIf} - -SectionEnd - Section "Java JRE" SEC_JRE SectionIn RO @@ -682,7 +633,7 @@ Section "-" SEC_REGISTERAPP WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ "UninstallString" '"$INSTDIR\uninstall.exe"' WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ - "DisplayIcon" "$INSTDIR\slimevr.exe" + "DisplayIcon" "$INSTDIR\SlimeVR.exe" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ "HelpLink" "https://docs.slimevr.dev/" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ @@ -713,7 +664,6 @@ Function componentsPre ${If} $SELECTED_INSTALLER_ACTION == "update" SectionSetFlags ${SEC_FIREWALL} ${SF_SELECTED} SectionSetFlags ${SEC_REGISTERAPP} 0 - SectionSetFlags ${SEC_WEBVIEW} ${SF_SELECTED} SectionSetFlags ${SEC_MSVCPP} ${SF_SELECTED} SectionSetFlags ${SEC_USBDRIVERS} ${SF_SECGRP} SectionSetFlags ${SEC_SERVER} ${SF_SELECTED} @@ -738,18 +688,6 @@ Function componentsPre SectionSetFlags ${SEC_JRE} ${SF_USELECTED} ${EndIf} - # Detect WebView2 - # https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#detect-if-a-suitable-webview2-runtime-is-already-installed - # Trying to solve #41 Installer doesn't always install WebView2 - # Ignoring only user installed WebView2 it seems to make problems - ${If} ${RunningX64} - ReadRegStr $0 HKLM "SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv" - ReadRegStr $1 HKCU "Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv" - ${Else} - ReadRegStr $0 HKLM "SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv" - ReadRegStr $1 HKCU "Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv" - ${EndIf} - ${If} $0 == "" ${OrIf} $0 == "0.0.0.0" StrCpy $0 "" @@ -764,12 +702,6 @@ Function componentsPre StrCpy $1 "1" ${EndIf} - ${If} $0 == "" - ${AndIf} $1 == "" - SectionSetFlags ${SEC_WEBVIEW} ${SF_SELECTED}|${SF_RO} - ${Else} - SectionSetFlags ${SEC_WEBVIEW} ${SF_USELECTED} - ${EndIf} FunctionEnd Function .onSelChange @@ -792,23 +724,9 @@ Section "-un.SlimeVR Server" un.SEC_SERVER Delete "$SMPROGRAMS\Uninstall SlimeVR Server.lnk" Delete "$SMPROGRAMS\SlimeVR Server.lnk" Delete "$DESKTOP\SlimeVR Server.lnk" - Delete "$INSTDIR\slimevr-ui.exe" - Delete "$INSTDIR\run.bat" - Delete "$INSTDIR\run.ico" # Ignore errors on the files above, they are optional to remove and may not even exist ClearErrors - Delete "$INSTDIR\slimevr*" - Delete "$INSTDIR\MagnetoLib.dll" - Delete "$INSTDIR\log*" - Delete "$INSTDIR\*.log" - Delete "$INSTDIR\*.lck" - Delete "$INSTDIR\vrconfig.yml" - Delete "$INSTDIR\LICENSE*" - Delete "$INSTDIR\ThirdPartyNotices.txt" - - RMDir /r "$INSTDIR\Recordings" - RMdir /r "$INSTDIR\jre" - RMDir /r "$INSTDIR\logs" + RMDir /r $INSTDIR IfErrors fail success fail: @@ -854,7 +772,6 @@ SectionEnd LangString DESC_SEC_SERVER ${LANG_ENGLISH} "Installs latest SlimeVR Server." LangString DESC_SEC_JRE ${LANG_ENGLISH} "Downloads and copies Java JRE 17 to installation folder. Required for SlimeVR Server." -LangString DESC_SEC_WEBVIEW ${LANG_ENGLISH} "Downloads and install Webview2 if not already installed. Required for the SlimeVR GUI" LangString DESC_SEC_VRDRIVER ${LANG_ENGLISH} "Installs latest SteamVR Driver for SlimeVR." LangString DESC_SEC_USBDRIVERS ${LANG_ENGLISH} "A list of USB drivers that are used by various boards." LangString DESC_SEC_FEEDER_APP ${LANG_ENGLISH} "Installs SlimeVR Feeder App that sends position of SteamVR trackers (Vive trackers, controllers) to SlimeVR Server. Required for elbow tracking." @@ -870,7 +787,6 @@ LangString DESC_PROCESS_ERROR ${LANG_ENGLISH} "An error happend while trying for !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SEC_SERVER} $(DESC_SEC_SERVER) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_JRE} $(DESC_SEC_JRE) - !insertmacro MUI_DESCRIPTION_TEXT ${SEC_WEBVIEW} $(DESC_SEC_WEBVIEW) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_VRDRIVER} $(DESC_SEC_VRDRIVER) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_FEEDER_APP} $(DESC_SEC_FEEDER_APP) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVCPP} $(DESC_SEC_MSVCPP) From 40c891d6a2e52d2d36cc2469c62a0fd4c4b288e7 Mon Sep 17 00:00:00 2001 From: loucass003 Date: Wed, 11 Mar 2026 20:47:03 +0100 Subject: [PATCH 2/6] Add review changes --- windows/web/slimevr_web_installer.nsi | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/windows/web/slimevr_web_installer.nsi b/windows/web/slimevr_web_installer.nsi index b789d42..d6443e0 100644 --- a/windows/web/slimevr_web_installer.nsi +++ b/windows/web/slimevr_web_installer.nsi @@ -304,7 +304,7 @@ Function endPageLeave ${If} $3 = 1 # use explorer to open it so it inherits the user token and starts as normal user - Exec '"$WINDIR\explorer.exe" "$INSTDIR\SlimeVR.exe"' + ShellExecAsUser::ShellExec "open" "$INSTDIR\SlimeVR.exe" ${EndIf} FunctionEnd @@ -430,9 +430,15 @@ Section "SlimeVR Server" SEC_SERVER DetailPrint "Copying SlimeVR Server to installation folder..." CopyFiles /SILENT "${SLIMETEMP}\SlimeVR\*" $INSTDIR - Delete "$INSTDIR\run.bat" - Delete "$INSTDIR\slimevr-ui.exe" - Delete "$INSTDIR\run.ico" + ${If} $SELECTED_INSTALLER_ACTION == "update" + IfFileExists "$LOCALAPPDATA\dev.slimevr.SlimeVR" 0 SEC_TAURI_DIRNOTFOUND + RMDir /r "$LOCALAPPDATA\dev.slimevr.SlimeVR" + SEC_TAURI_DIRNOTFOUND: + + IfFileExists "$APPDATA\dev.slimevr.SlimeVR\electron" 0 SEC_ELECTON_DIRNOTFOUND + RMDir /r "$APPDATA\dev.slimevr.SlimeVR\electron" + SEC_ELECTON_DIRNOTFOUND: + ${EndIf} # Create the uninstaller WriteUninstaller "$INSTDIR\uninstall.exe" @@ -724,6 +730,8 @@ Section "-un.SlimeVR Server" un.SEC_SERVER Delete "$SMPROGRAMS\Uninstall SlimeVR Server.lnk" Delete "$SMPROGRAMS\SlimeVR Server.lnk" Delete "$DESKTOP\SlimeVR Server.lnk" + RMDir /r "$LOCALAPPDATA\dev.slimevr.SlimeVR" + RMDir /r "$APPDATA\dev.slimevr.SlimeVR\electron" # Ignore errors on the files above, they are optional to remove and may not even exist ClearErrors RMDir /r $INSTDIR From 84d0e9dbf6a5013a63e3b66826bd1e06e2696e38 Mon Sep 17 00:00:00 2001 From: loucass003 Date: Fri, 13 Mar 2026 06:56:44 +0100 Subject: [PATCH 3/6] test with v19 --- windows/web/slimevr_web_installer.nsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/web/slimevr_web_installer.nsi b/windows/web/slimevr_web_installer.nsi index d6443e0..00f0e24 100644 --- a/windows/web/slimevr_web_installer.nsi +++ b/windows/web/slimevr_web_installer.nsi @@ -45,9 +45,9 @@ Unicode True !define JREDLURL "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.17%2B10/OpenJDK17U-jre_x64_windows_hotspot_17.0.17_10.zip" !define JREDLFileZip "OpenJDK17U-jre_x64_windows_hotspot_17.0.17_10.zip" -!define SVRServerVersion "latest" +!define SVRServerVersion "v19.0.0-rc.1" !define SVRServerURLType "url" ; "url" or "local" -!define SVRServerDLURL "https://github.com/SlimeVR/SlimeVR-Server/releases/latest/download/SlimeVR-win64.zip" +!define SVRServerDLURL "https://github.com/SlimeVR/SlimeVR-Server/releases/download/v19.0.0-rc.1/SlimeVR-win64.zip" !define SVRServerDLFileZip "SlimeVR-Server-latest.zip" !define SVRDriverVersion "latest" From 5b1649ab6337ae334a738cf7600a338e17b9910e Mon Sep 17 00:00:00 2001 From: loucass003 Date: Fri, 13 Mar 2026 06:59:40 +0100 Subject: [PATCH 4/6] Ci test? --- windows/web/slimevr_web_installer.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/web/slimevr_web_installer.nsi b/windows/web/slimevr_web_installer.nsi index 00f0e24..3602883 100644 --- a/windows/web/slimevr_web_installer.nsi +++ b/windows/web/slimevr_web_installer.nsi @@ -304,7 +304,7 @@ Function endPageLeave ${If} $3 = 1 # use explorer to open it so it inherits the user token and starts as normal user - ShellExecAsUser::ShellExec "open" "$INSTDIR\SlimeVR.exe" + ; ShellExecAsUser::ShellExec "open" "$INSTDIR\SlimeVR.exe" ${EndIf} FunctionEnd From faaab475444d5e8464d99dbf40b9f041b2f8e943 Mon Sep 17 00:00:00 2001 From: loucass003 Date: Fri, 13 Mar 2026 07:00:43 +0100 Subject: [PATCH 5/6] Go back to exec with explorer.exe --- windows/web/slimevr_web_installer.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/web/slimevr_web_installer.nsi b/windows/web/slimevr_web_installer.nsi index 3602883..ed3595f 100644 --- a/windows/web/slimevr_web_installer.nsi +++ b/windows/web/slimevr_web_installer.nsi @@ -304,7 +304,7 @@ Function endPageLeave ${If} $3 = 1 # use explorer to open it so it inherits the user token and starts as normal user - ; ShellExecAsUser::ShellExec "open" "$INSTDIR\SlimeVR.exe" + Exec '"$WINDIR\explorer.exe" "$INSTDIR\SlimeVR.exe"' ${EndIf} FunctionEnd From e8b30664b478457827bf7b675f81a8332fe7de10 Mon Sep 17 00:00:00 2001 From: loucass003 Date: Fri, 13 Mar 2026 07:13:49 +0100 Subject: [PATCH 6/6] back to latest --- windows/web/slimevr_web_installer.nsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/web/slimevr_web_installer.nsi b/windows/web/slimevr_web_installer.nsi index ed3595f..a29dcfa 100644 --- a/windows/web/slimevr_web_installer.nsi +++ b/windows/web/slimevr_web_installer.nsi @@ -45,9 +45,9 @@ Unicode True !define JREDLURL "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.17%2B10/OpenJDK17U-jre_x64_windows_hotspot_17.0.17_10.zip" !define JREDLFileZip "OpenJDK17U-jre_x64_windows_hotspot_17.0.17_10.zip" -!define SVRServerVersion "v19.0.0-rc.1" +!define SVRServerVersion "latest" !define SVRServerURLType "url" ; "url" or "local" -!define SVRServerDLURL "https://github.com/SlimeVR/SlimeVR-Server/releases/download/v19.0.0-rc.1/SlimeVR-win64.zip" +!define SVRServerDLURL "https://github.com/SlimeVR/SlimeVR-Server/releases/latest/download/SlimeVR-win64.zip" !define SVRServerDLFileZip "SlimeVR-Server-latest.zip" !define SVRDriverVersion "latest"