@@ -31,22 +31,36 @@ Unicode True
3131!define MUI_HEADERIMAGE_RIGHT
3232!define SLIMETEMP " $TEMP\SlimeVRInstaller"
3333
34+ # Define all download URLs and versions here for easy editing
35+ !define MVCVersion " "
36+ !define MVCURLType " url" ; "url" or "local"
37+ !define MVCDLURL " https://aka.ms/vs/17/release/vc_redist.x64.exe"
38+ !define MVCDLFileZip " vc_redist.x64.exe"
39+
40+ !define WV2Version " "
41+ !define WV2URLType " url" ; "url" or "local"
42+ !define WV2DLURL " https://go.microsoft.com/fwlink/p/?LinkId=2124703"
43+ !define WV2DLFileZip " MicrosoftEdgeWebView2RuntimeInstaller.exe"
3444# Define the Java Version Strings and to Check (JRE\relase -> JAVA_RUNTIME_VERSION=)
3545!define JREVersion " 17.0.15+6"
36- !define JREDownloadURL " https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jre_x64_windows_hotspot_17.0.15_6.zip"
37- !define JREDownloadedFileZip " OpenJDK17U-jre_x64_windows_hotspot_17.0.15_6.zip"
46+ !define JREURLType " url" ; "url" or "local"
47+ !define JREDLURL " https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jre_x64_windows_hotspot_17.0.15_6.zip"
48+ !define JREDLFileZip " OpenJDK17U-jre_x64_windows_hotspot_17.0.15_6.zip"
3849
3950!define SVRServerVersion " latest"
40- !define SVRServerDownloadURL " https://github.com/SlimeVR/SlimeVR-Server/releases/latest/download/SlimeVR-win64.zip"
41- !define SVRServerDownloadedFileZip " SlimeVR-Server-latest.zip"
51+ !define SVRServerURLType " url" ; "url" or "local"
52+ !define SVRServerDLURL " https://github.com/SlimeVR/SlimeVR-Server/releases/latest/download/SlimeVR-win64.zip"
53+ !define SVRServerDLFileZip " SlimeVR-Server-latest.zip"
4254
4355!define SVRDriverVersion " latest"
44- !define SVRDriverDownloadURL " https://github.com/SlimeVR/SlimeVR-OpenVR-Driver/releases/latest/download/slimevr-openvr-driver-win64.zip"
45- !define SVRDriverDownloadedFileZip " slimevr-openvr-driver-win64.zip"
56+ !define SVRDriverURLType " url" ; "url" or "local"
57+ !define SVRDriverDLURL " https://github.com/SlimeVR/SlimeVR-OpenVR-Driver/releases/latest/download/slimevr-openvr-driver-win64.zip"
58+ !define SVRDriverDLFileZip " slimevr-openvr-driver-win64.zip"
4659
4760!define SVRFeederVersion " latest"
48- !define SVRFeederDownloadURL " https://github.com/SlimeVR/SlimeVR-Feeder-App/releases/latest/download/SlimeVR-Feeder-App-win64.zip"
49- !define SVRFeederDownloadedFileZip " SlimeVR-Feeder-App-latest.zip"
61+ !define SVRFeederURLType " url" ; "url" or "local"
62+ !define SVRFeederDLURL " https://github.com/SlimeVR/SlimeVR-Feeder-App/releases/latest/download/SlimeVR-Feeder-App-win64.zip"
63+ !define SVRFeederDLFileZip " SlimeVR-Feeder-App-latest.zip"
5064
5165Var JREneedInstall
5266Var /GLOBAL SteamVRResult
@@ -424,7 +438,8 @@ Section "SlimeVR Server" SEC_SERVER
424438
425439 SetOutPath $INSTDIR
426440
427- !insertmacro dlFiles " SlimeVR Server" " ${SVRServerVersion}" " ${SVRServerDownloadURL}" " ${SVRServerDownloadedFileZip}" " SlimeVR"
441+ !insertmacro dlFile " ${SVRServerURLType}" " SlimeVR Server" " ${SVRServerVersion}" " ${SVRServerDLURL}" " ${SVRServerDLFileZip}"
442+ !insertmacro unzipFile " SlimeVR Server" " ${SVRServerVersion}" " ${SLIMETEMP}\${SVRServerDLFileZip}" " SlimeVR"
428443
429444 ${If} $SELECTED_INSTALLER_ACTION == " update"
430445 Delete " $INSTDIR\slimevr-ui.exe"
@@ -448,10 +463,9 @@ SectionEnd
448463
449464Section " Webview2" SEC_WEBVIEW
450465 SectionIn RO
451-
452466 # Read Only protects it from Installing when it is not needed
453- DetailPrint " Downloading webview2! "
454- NScurl::http GET " https://go.microsoft.com/fwlink/p/?LinkId=2124703 " " ${SLIMETEMP}\MicrosoftEdgeWebView2RuntimeInstaller.exe " /CANCEL /RESUME /END
467+
468+ !insertmacro dlFile " ${WV2URLType} " " webview2 " " ${WV2Version} " " ${WV2DLURL} " " ${WV2DLFileZip} "
455469
456470 DetailPrint " Installing webview2!"
457471 nsExec::ExecToLog ' "${SLIMETEMP}\MicrosoftEdgeWebView2RuntimeInstaller.exe" /silent /install' $0
@@ -465,8 +479,9 @@ SectionEnd
465479
466480Section " Java JRE" SEC_JRE
467481 SectionIn RO
468-
469- !insertmacro dlFiles " Java JRE" " ${JREVersion}" " ${JREDownloadURL}" " ${JREDownloadedFileZip}" " OpenJDK"
482+
483+ !insertmacro dlFile " ${JREURLType}" " Java JRE" " ${JREVersion}" " ${JREDLURL}" " ${JREDLFileZip}"
484+ !insertmacro unzipFile " Java JRE" " ${JREVersion}" " ${SLIMETEMP}\${JREDLFileZip}" " OpenJDK"
470485
471486 # Make sure to delete all files on a update from jre, so if there is a new version no old files are left.
472487 IfFileExists " $INSTDIR\jre" 0 SEC_JRE_DIRNOTFOUND
@@ -488,7 +503,8 @@ SectionEnd
488503Section " SteamVR Driver" SEC_VRDRIVER
489504 SetOutPath $INSTDIR
490505
491- !insertmacro dlFiles " SteamVR Driver" " ${SVRDriverVersion}" " ${SVRDriverDownloadURL}" " ${SVRDriverDownloadedFileZip}" " slimevr-openvr-driver-win64"
506+ !insertmacro dlFile " ${SVRDriverURLType}" " SteamVR Driver" " ${SVRDriverVersion}" " ${SVRDriverDLURL}" " ${SVRDriverDLFileZip}"
507+ !insertmacro unzipFile " SteamVR Driver" " ${SVRDriverVersion}" " ${SLIMETEMP}\${SVRDriverDLFileZip}" " slimevr-openvr-driver-win64"
492508
493509 # Include SteamVR powershell script to register/unregister driver
494510 File " steamvr.ps1"
@@ -512,7 +528,9 @@ SectionEnd
512528Section " SlimeVR Feeder App" SEC_FEEDER_APP
513529 SetOutPath $INSTDIR
514530
515- !insertmacro dlFiles " SlimeVR Feeder App" " ${SVRFeederVersion}" " ${SVRFeederDownloadURL}" " ${SVRFeederDownloadedFileZip}" " "
531+ !insertmacro dlFile " ${SVRFeederURLType}" " SlimeVR Feeder App" " ${SVRFeederVersion}" " ${SVRFeederDLURL}" " ${SVRFeederDLFileZip}"
532+ # The zip contains a folder named SlimeVR-Feeder-App-win64
533+ !insertmacro unzipFile " SlimeVR Feeder App" " ${SVRFeederVersion}" " ${SLIMETEMP}\${SVRFeederDLFileZip}" " "
516534
517535 DetailPrint " Copying SlimeVR Feeder App..."
518536 CopyFiles /SILENT " ${SLIMETEMP}\SlimeVR-Feeder-App-win64\*" " $INSTDIR\Feeder-App"
@@ -523,13 +541,9 @@ SectionEnd
523541
524542Section " Microsoft Visual C++ Redistributable" SEC_MSVCPP
525543 SetOutPath $INSTDIR
526- DetailPrint " Downloading Microsoft Visual C++ Redistributable..."
527- NScurl::http GET " https://aka.ms/vs/17/release/vc_redist.x64.exe" " ${SLIMETEMP}\vc_redist.x64.exe" /CANCEL /RESUME /END
528- Pop $0 ; Status text ("OK" for success)
529- ${If} $0 != " OK"
530- Abort " Failed to download Microsoft Visual C++ Redistributable. Reason: $0."
531- ${EndIf}
532- DetailPrint " Downloaded!"
544+
545+ !insertmacro dlFile " ${MVCURLType}" " Microsoft Visual C++ Redistributable" " ${MVCVersion}" " ${MVCDLURL}" " ${MVCDLFileZip}"
546+
533547 DetailPrint " Installing Microsoft Visual C++ Redistributable..."
534548 nsExec::ExecToLog ' "${SLIMETEMP}\vc_redist.x64.exe" /install /passive /norestart' $0
535549 Pop $0 ; Status text ("OK" for success)
0 commit comments