-
-
Notifications
You must be signed in to change notification settings - Fork 23
Electron installer #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
2d14b04
40c891d
84d0e9d
5b1649a
faaab47
e8b3066
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /result |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 <file>.nsi' to compile manually." | ||
| ''; | ||
| }; | ||
| }); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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,36 +145,14 @@ FunctionEnd | |
|
|
||
| Function .onInstFailed | ||
| ${If} $SELECTED_INSTALLER_ACTION == "" | ||
| Call cleanInstDir | ||
| RMDir /r $INSTDIR | ||
| ${Endif} | ||
| FunctionEnd | ||
|
|
||
| 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,15 +285,15 @@ 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" | ||
| RMdir /r "$SMPROGRAMS\SlimeVR Server" | ||
| ${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,27 @@ 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\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" | ||
| 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 +639,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 +670,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 +694,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 +708,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 +730,11 @@ 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" | ||
| 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 | ||
| 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" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hm not scope of this pr probably, but i see here, that we don't remove the I think it would be a good idea to clean that up on uninstall
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think reason was to keep user config. but ig we could delete these too. if you unintall it should be expected that your settings will be cleared
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As of discusion in Discord: |
||
| RMDir /r $INSTDIR | ||
|
|
||
| IfErrors fail success | ||
| fail: | ||
|
|
@@ -854,7 +780,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 +795,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) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a update from non electron to electron what has to be deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slimevr-ui is really old and prob does not exists anymore
the only gui file used to be slimevr.exe which is replaced by the unzip of electron.