diff --git a/windows/web/CH343SER/CH343PORTS.dll b/windows/web/CH343SER/CH343PORTS.dll new file mode 100644 index 0000000..72871a9 Binary files /dev/null and b/windows/web/CH343SER/CH343PORTS.dll differ diff --git a/windows/web/CH343SER/CH343PORTSA64.dll b/windows/web/CH343SER/CH343PORTSA64.dll new file mode 100644 index 0000000..f010100 Binary files /dev/null and b/windows/web/CH343SER/CH343PORTSA64.dll differ diff --git a/windows/web/CH343SER/CH343PT.DLL b/windows/web/CH343SER/CH343PT.DLL new file mode 100644 index 0000000..7e719ce Binary files /dev/null and b/windows/web/CH343SER/CH343PT.DLL differ diff --git a/windows/web/CH343SER/CH343S64.sys b/windows/web/CH343SER/CH343S64.sys new file mode 100644 index 0000000..6f2a18c Binary files /dev/null and b/windows/web/CH343SER/CH343S64.sys differ diff --git a/windows/web/CH343SER/CH343SER.CAT b/windows/web/CH343SER/CH343SER.CAT new file mode 100644 index 0000000..b060cd6 Binary files /dev/null and b/windows/web/CH343SER/CH343SER.CAT differ diff --git a/windows/web/CH343SER/CH343SER.INF b/windows/web/CH343SER/CH343SER.INF new file mode 100644 index 0000000..ab49d7d --- /dev/null +++ b/windows/web/CH343SER/CH343SER.INF @@ -0,0 +1,223 @@ +; CH343SER.INF +; Driver for CH342/CH343/CH910X (USB=>ENHANCED SERIAL CHIP) V1.5 +; DRIVER for Windows 2000/XP/Vista/7/8/8.1/10/SERVER 2003/2008/2012/2016/2019 +; Copyright (C) WCH 2001-2021 +; + +[Version] +Signature = "$Chicago$" +Class = Ports +ClassGuid = {4D36E978-E325-11CE-BFC1-08002BE10318} +Provider = %WinChipHead% +DriverVer = 08/08/2021, 1.5.2021.8 +CatalogFile = CH343SER.CAT + +[ControlFlags] +ExcludeFromSelect = USB\VID_1A86&PID_55D2&MI_00 +ExcludeFromSelect = USB\VID_1A86&PID_55D2&MI_02 +ExcludeFromSelect = USB\VID_1A86&PID_55D3 +ExcludeFromSelect = USB\VID_1A86&PID_55D5&MI_00 +ExcludeFromSelect = USB\VID_1A86&PID_55D5&MI_02 +ExcludeFromSelect = USB\VID_1A86&PID_55D5&MI_04 +ExcludeFromSelect = USB\VID_1A86&PID_55D5&MI_06 +ExcludeFromSelect = USB\VID_1A86&PID_55D8 +ExcludeFromSelect = USB\VID_1A86&PID_55D4 +ExcludeFromSelect = USB\VID_1A86&PID_55D7&MI_00 +ExcludeFromSelect = USB\VID_1A86&PID_55D7&MI_02 +ExcludeFromSelect = USB\VID_1A86&PID_55D6 + +[Manufacturer] +%WinChipHead% = WinChipHead,NT,NTamd64,NTia64 + +[WinChipHead] +%CH342SERM0.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D2&MI_00 +%CH342SERM1.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D2&MI_02 +%CH343SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D3 +%CH344SERM0.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_00 +%CH344SERM1.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_02 +%CH344SERM2.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_04 +%CH344SERM3.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_06 +%CH9101SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D8 +%CH9102SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D4 +%CH9103SERM0.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D7&MI_00 +%CH9103SERM1.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D7&MI_02 +%CH9143SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D6 + +[WinChipHead.NT] +%CH342SERM0.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D2&MI_00 +%CH342SERM1.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D2&MI_02 +%CH343SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D3 +%CH344SERM0.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_00 +%CH344SERM1.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_02 +%CH344SERM2.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_04 +%CH344SERM3.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_06 +%CH9101SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D8 +%CH9102SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D4 +%CH9103SERM0.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D7&MI_00 +%CH9103SERM1.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D7&MI_02 +%CH9143SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D6 + +[WinChipHead.NTamd64] +%CH342SERM0.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D2&MI_00 +%CH342SERM1.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D2&MI_02 +%CH343SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D3 +%CH344SERM0.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_00 +%CH344SERM1.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_02 +%CH344SERM2.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_04 +%CH344SERM3.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_06 +%CH9101SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D8 +%CH9102SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D4 +%CH9103SERM0.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D7&MI_00 +%CH9103SERM1.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D7&MI_02 +%CH9143SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D6 + +[WinChipHead.NTia64] +%CH342SERM0.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D2&MI_00 +%CH342SERM1.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D2&MI_02 +%CH343SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D3 +%CH344SERM0.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_00 +%CH344SERM1.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_02 +%CH344SERM2.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_04 +%CH344SERM3.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D5&MI_06 +%CH9101SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D8 +%CH9102SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D4 +%CH9103SERM0.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D7&MI_00 +%CH9103SERM1.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D7&MI_02 +%CH9143SER.DeviceDesc% = CH343SER_Inst, USB\VID_1A86&PID_55D6 + +[CH343SER_Inst.NT] +CopyFiles = CH343SER.NT.CopyFiles.SYS, CH343SER.CopyFiles.DLL +AddReg = CH343SER.NT.AddReg, CH343SER.AddReg + +[CH343SER_Inst.NT.HW] +AddReg = CH343SER.NT.HW.AddReg + +[CH343SER_Inst.NTamd64] +CopyFiles = CH343SER.NT.CopyFiles.SYSA64, CH343SER.CopyFiles.DLLA64 +AddReg = CH343SER.NTamd64.AddReg, CH343SER.AddReg + +[CH343SER_Inst.NTamd64.HW] +AddReg = CH343SER.NT.HW.AddReg + +[CH343SER_Inst.NTia64] +CopyFiles = CH343SER.NT.CopyFiles.SYSI64 +AddReg = CH343SER.NT.AddReg, CH343SER.AddReg + +[CH343SER_Inst.NTia64.HW] +AddReg = CH343SER.NT.HW.AddReg + +[CH343SER.NT.CopyFiles.SYS] +CH343SER.SYS, , , 2 + +[CH343SER.NT.CopyFiles.SYSA64] +CH343S64.SYS, , , 2 + +[CH343SER.NT.CopyFiles.SYSI64] +;CH343I64.SYS, , , 2 + +[CH343SER.CopyFiles.DLL] +CH343PT.DLL, , , 2 +CH343PORTS.DLL, , , 2 + +[CH343SER.CopyFiles.DLLA64] +CH343PT.DLL, , , 2 +CH343PORTSA64.DLL, , , 2 +;安装DLL是可选的,DLL可以用于识别CH340/1/2/3、CH9102端口、监视CH341端口的插拔事件和GPIO操作 + +[CH343SER.NT.AddReg] +HKR,,EnumPropPages32,,"CH343PORTS.dll,SerialPortPropPageProvider" + +[CH343SER.NTamd64.AddReg] +HKR,,EnumPropPages32,,"CH343PORTSA64.dll,SerialPortPropPageProvider" + +[CH343SER.NT.HW.AddReg] +;HKR,,"UpperFilters",0x00010000,"serenum" +;上面这行用于枚举接在串口的即插即用设备,启动时将产生DTR和RTS信号,如果需要枚举,请将上面这行的分号去掉 + +[CH343SER.AddReg] +HKLM, SOFTWARE\WinChipHead\IC\CH343SER, WDM, 0x00010001, 0x00000034 +HKLM, SOFTWARE\WinChipHead\IC\CH341PORT, DLL, 0x00010001, 0x00000010 +HKLM, SOFTWARE\WinChipHead\IC\CH343SER, Function, , "USB=>Serial" +;HKLM, SYSTEM\CurrentControlSet\Services\CH343SER, UserRemoval, 0x00010001, 0x00000001 +;上面这行用于在系统托盘中显示“安全删除USB转SERIAL硬件设备”,便于用户手工删除硬件 + +[CH343SER_Inst.NT.Services] +AddService = CH343SER, 2, CH343SER.Service +AddService = Serenum, , Serenum_Service_Inst + +[CH343SER_Inst.NTamd64.Services] +AddService = CH343SER_A64, 2, CH343SER.ServiceA64 +AddService = Serenum, , Serenum_Service_Inst + +[CH343SER_Inst.NTia64.Services] +AddService = CH343SER_I64, 2, CH343SER.ServiceI64 +AddService = Serenum, , Serenum_Service_Inst + +[CH343SER.Service] +DisplayName = "CH343SER" +ServiceType = 1 +StartType = 3 +ErrorControl = 1 +ServiceBinary = %10%\System32\Drivers\CH343SER.SYS + +[CH343SER.ServiceA64] +DisplayName = "CH343SER_A64" +ServiceType = 1 +StartType = 3 +ErrorControl = 1 +ServiceBinary = %10%\System32\Drivers\CH343S64.SYS + +[CH343SER.ServiceI64] +DisplayName = "CH343SER_I64" +ServiceType = 1 +StartType = 3 +ErrorControl = 1 +ServiceBinary = %10%\System32\Drivers\CH343I64.SYS + +[Serenum_Service_Inst] +DisplayName = "SerEnum" +ServiceType = 1 +StartType = 3 +ErrorControl = 1 +ServiceBinary = %12%\serenum.sys +LoadOrderGroup = PNP Filter + +[DestinationDirs] +DefaultDestDir = 10, System32\Drivers +CH343SER.NT.CopyFiles.SYS = 10, System32\Drivers +CH343SER.CopyFiles.DLL = 11 +CH343SER.CopyFiles.DLLA64 = 11 +CH343SER.NT.CopyFiles.SYSA64 = 10, System32\Drivers + +[SourceDisksFiles] +CH343SER.SYS = 1 +CH343PT.DLL = 1 +CH343S64.SYS = 1 +CH343PORTS.DLL = 1 +CH343PORTSA64.DLL = 1 + +[SourceDisksNames] +1 = %DISK_NAME%, , , + +[SourceDisksNames.amd64] +1 = %DISK_NAME%, , , + +[SourceDisksNames.ia64] +1 = %DISK_NAME%, , , + +[Strings] +WinChipHead = "wch.cn" +CH342SERM0.DeviceDesc = "USB-Enhanced-SERIAL-A CH342" +CH342SERM1.DeviceDesc = "USB-Enhanced-SERIAL-B CH342" +CH343SER.DeviceDesc = "USB-Enhanced-SERIAL CH343" +CH344SERM0.DeviceDesc = "USB-Enhanced-SERIAL-A CH344" +CH344SERM1.DeviceDesc = "USB-Enhanced-SERIAL-B CH344" +CH344SERM2.DeviceDesc = "USB-Enhanced-SERIAL-C CH344" +CH344SERM3.DeviceDesc = "USB-Enhanced-SERIAL-D CH344" +CH9101SER.DeviceDesc = "USB-Enhanced-SERIAL CH9101" +CH9102SER.DeviceDesc = "USB-Enhanced-SERIAL CH9102" +CH9103SERM0.DeviceDesc = "USB-Enhanced-SERIAL-A CH9103" +CH9103SERM1.DeviceDesc = "USB-Enhanced-SERIAL-B CH9103" +CH9143SER.DeviceDesc = "USB-BLE-SERIAL CH9143" +DISK_NAME = "CH34X&CH910X USB To Serial Installation Disk" + diff --git a/windows/web/CH343SER/CH343SER.sys b/windows/web/CH343SER/CH343SER.sys new file mode 100644 index 0000000..790fa6c Binary files /dev/null and b/windows/web/CH343SER/CH343SER.sys differ diff --git a/windows/web/logo.bmp b/windows/web/logo.bmp new file mode 100644 index 0000000..7565d57 Binary files /dev/null and b/windows/web/logo.bmp differ diff --git a/windows/web/slimevr_web_installer.nsi b/windows/web/slimevr_web_installer.nsi index 77a9b04..19fd15e 100644 --- a/windows/web/slimevr_web_installer.nsi +++ b/windows/web/slimevr_web_installer.nsi @@ -4,9 +4,16 @@ Unicode True !include LogicLib.nsh ; For conditional operators !include nsDialogs.nsh ; For custom pages !include FileFunc.nsh ; For GetTime function +!include MUI2.nsh + +!define MUI_ICON "run.ico" +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_BITMAP "logo.bmp" +!define MUI_HEADERIMAGE_BITMAP_STRETCH "NoStretchNoCrop" +!define MUI_HEADERIMAGE_RIGHT # Define name of installer -Name SlimeVR Installer +Name "SlimeVR" SpaceTexts none # Don't show required disk space since we don't know for sure SetOverwrite on @@ -17,6 +24,11 @@ OutFile "slimevr_web_installer.exe" # Define installation directory InstallDir "$PROGRAMFILES\SlimeVR Server" ; $InstDir default value. Defaults to user's local appdata to avoid asking admin rights +ShowInstDetails show +ShowUninstDetails show + +BrandingText "SlimeVR Installer 0.1.2" + # Admin rights are required for: # 1. Removing Start Menu shortcut in Windows 7+ # 2. Adding/removing firewall rules @@ -31,7 +43,7 @@ Var SELECTED_INSTALLER_ACTION # End page actions Var CREATE_DESKTOP_SHORTCUT Var CREATE_STARTMENU_SHORTCUTS -Var DOCUMENTATION_LINK +Var OPEN_DOCUMENTATION # Detected Steam folder Var STEAMDIR @@ -79,6 +91,12 @@ Function cleanTemp RMDir /r "$TEMP\slimevr_usb_drivers_inst" FunctionEnd +Function .onInstFailed + ${If} $SELECTED_INSTALLER_ACTION == "" + Call cleanInstDir + ${Endif} +FunctionEnd + Function .onGUIEnd Call cleanTemp FunctionEnd @@ -111,16 +129,30 @@ FunctionEnd # Init functions end # Page Custom startPage startPageLeave -Page Directory dirPre ; This page might change $InstDir + +!define MUI_PAGE_CUSTOMFUNCTION_PRE componentsPre +!insertmacro MUI_PAGE_COMPONENTS + +!define MUI_PAGE_CUSTOMFUNCTION_PRE installerActionPre +!insertmacro MUI_PAGE_DIRECTORY + Page Custom steamVrDirectoryPage -Page InstFiles cleanTemp ; Clean temp on pre-install to avoid any leftover files failing the installation, temp files will be removed in .onGUIEnd + +!define MUI_PAGE_CUSTOMFUNCTION_PRE cleanTemp ; Clean temp on pre-install to avoid any leftover files failing the installation, temp files will be removed in .onGUIEnd +!insertmacro MUI_PAGE_INSTFILES + Page Custom endPage endPageLeave -UninstPage UninstConfirm -UninstPage InstFiles +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES -Function startPage +!insertmacro MUI_LANGUAGE "English" + +LangString START_PAGE_TITLE ${LANG_ENGLISH} "Welcome" +LangString START_PAGE_SUBTITLE ${LANG_ENGLISH} "Welcome to SlimeVR Setup!" +Function startPage + !insertmacro MUI_HEADER_TEXT $(START_PAGE_TITLE) $(START_PAGE_SUBTITLE) nsDialogs::Create 1018 Pop $0 @@ -128,14 +160,11 @@ Function startPage Abort ${EndIf} - ${NSD_CreateLabel} 0 0 100% 12u "Welcome to SlimeVR Installer!" - Pop $0 - ReadRegStr $0 HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR InstallLocation ${If} $0 != "" StrCpy $INSTDIR $0 - ${NSD_CreateLabel} 0 15u 100% 20u 'An existing installation was detected in "$0". Choose an option and click Next to proceed.' + ${NSD_CreateLabel} 0 0 100% 20u 'An existing installation was detected in "$0". Choose an option and click Next to proceed.' ${NSD_CreateRadioButton} 0 40u 100% 10u "Update" Pop $UPDATE ${NSD_CreateRadioButton} 0 55u 100% 10u "Repair" @@ -149,7 +178,7 @@ Function startPage SendMessage $UPDATE ${BM_SETCHECK} 1 0 ${EndIf} ${Else} - ${NSD_CreateLabel} 0 15u 100% 50u "Click Next to proceed with installation." + ${NSD_CreateLabel} 0 0 100% 50u "Click Next to proceed with installation." Pop $0 ${EndIf} @@ -182,9 +211,9 @@ Function endPage ${NSD_CreateLabel} 0 0 100% 12u "The installation is finished!" Pop $0 - ${NSD_CreateLink} 0 15u 100% 20u 'For further instructions, click here to visit the documentation.' - Pop $DOCUMENTATION_LINK - ${NSD_OnClick} $DOCUMENTATION_LINK openDocumentationLink + ${NSD_CreateCheckbox} 0 25u 100% 10u "Open SlimeVR documentation" + Pop $OPEN_DOCUMENTATION + ${NSD_Check} $OPEN_DOCUMENTATION ${If} $SELECTED_INSTALLER_ACTION != "update" ${NSD_CreateCheckbox} 0 40u 100% 10u "Create Desktop shortcut" @@ -199,15 +228,11 @@ Function endPage FunctionEnd -Function openDocumentationLink - Pop $0 - ExecShell "open" "https://docs.slimevr.dev/slimevr-setup.html" -FunctionEnd - Function endPageLeave ${NSD_GetState} $CREATE_DESKTOP_SHORTCUT $0 ${NSD_GetState} $CREATE_STARTMENU_SHORTCUTS $1 + ${NSD_GetState} $OPEN_DOCUMENTATION $2 ${If} $0 = 1 CreateDirectory "$SMPROGRAMS\SlimeVR Server" @@ -217,6 +242,9 @@ Function endPageLeave ${If} $1 = 1 CreateShortcut "$DESKTOP\SlimeVR Server.lnk" "$INSTDIR\run.bat" "" "$INSTDIR\run.ico" ${EndIf} + ${If} $2 = 1 + ExecShell "open" "https://docs.slimevr.dev/slimevr-setup.html" + ${EndIf} FunctionEnd @@ -262,7 +290,7 @@ Function browseDest FunctionEnd # Pre-hook for directory selection function -Function dirPre +Function installerActionPre # Skip directory selection if existing installation was detected and user selected an action ${If} $SELECTED_INSTALLER_ACTION != "" Abort @@ -313,33 +341,34 @@ Function DumpLog Exch $5 FunctionEnd -# InstFiles section start -Section - ${If} $SELECTED_INSTALLER_ACTION != "update" - Var /GLOBAL DownloadedJreFile - DetailPrint "Downloading Java JRE..." - ${If} ${RunningX64} - NScurl::http GET "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.12%2B7/OpenJDK11U-jre_x64_windows_hotspot_11.0.12_7.zip" "$TEMP\OpenJDK11U-jre_x64_windows_hotspot_11.0.12_7.zip" /CANCEL /RESUME /END - StrCpy $DownloadedJreFile "OpenJDK11U-jre_x64_windows_hotspot_11.0.12_7" - ${Else} - NScurl::http GET "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.12%2B7/OpenJDK11U-jre_x86-32_windows_hotspot_11.0.12_7.zip" "$TEMP\OpenJDK11U-jre_x86-32_windows_hotspot_11.0.12_7.zip" /CANCEL /RESUME /END - StrCpy $DownloadedJreFile "OpenJDK11U-jre_x86-32_windows_hotspot_11.0.12_7" - ${EndIf} - Pop $0 ; Status text ("OK" for success) - ${If} $0 != "OK" - Abort "Failed to download Java JRE. Reason: $0." - ${EndIf} - DetailPrint "Downloaded!" - ${Endif} - - DetailPrint "Downloading SlimeVR Driver..." - NScurl::http GET "https://github.com/SlimeVR/SlimeVR-OpenVR-Driver/releases/latest/download/slimevr-openvr-driver-win64.zip" "$TEMP\slimevr-openvr-driver-win64.zip" /CANCEL /RESUME /END +Section "-" SEC_JRE + Var /GLOBAL DownloadedJreFile + DetailPrint "Downloading Java JRE..." + ${If} ${RunningX64} + NScurl::http GET "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.12%2B7/OpenJDK11U-jre_x64_windows_hotspot_11.0.12_7.zip" "$TEMP\OpenJDK11U-jre_x64_windows_hotspot_11.0.12_7.zip" /CANCEL /RESUME /END + StrCpy $DownloadedJreFile "OpenJDK11U-jre_x64_windows_hotspot_11.0.12_7" + ${Else} + NScurl::http GET "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.12%2B7/OpenJDK11U-jre_x86-32_windows_hotspot_11.0.12_7.zip" "$TEMP\OpenJDK11U-jre_x86-32_windows_hotspot_11.0.12_7.zip" /CANCEL /RESUME /END + StrCpy $DownloadedJreFile "OpenJDK11U-jre_x86-32_windows_hotspot_11.0.12_7" + ${EndIf} Pop $0 ; Status text ("OK" for success) ${If} $0 != "OK" - Abort "Failed to download SlimeVR Driver. Reason: $0." + Abort "Failed to download Java JRE. Reason: $0." ${EndIf} DetailPrint "Downloaded!" + DetailPrint "Unzipping Java JRE to installation folder...." + nsisunz::Unzip "$TEMP\$DownloadedJreFile.zip" "$TEMP\$DownloadedJreFile\" + Pop $0 + DetailPrint "Unzipping finished with $0." + CopyFiles /SILENT "$TEMP\$DownloadedJreFile\jdk-11.0.12+7-jre\*" "$INSTDIR\jre" +SectionEnd + +Section "SlimeVR Server" SEC_SERVER + SectionIn RO + + SetOutPath $INSTDIR + DetailPrint "Downloading SlimeVR Server..." NScurl::http GET "https://github.com/SlimeVR/SlimeVR-Server/releases/latest/download/SlimeVR.zip" "$TEMP\SlimeVR.zip" /CANCEL /RESUME /END Pop $0 ; Status text ("OK" for success) @@ -348,18 +377,59 @@ Section ${EndIf} DetailPrint "Downloaded!" - DetailPrint "Unpacking downloaded files..." - nsisunz::Unzip "$TEMP\slimevr-openvr-driver-win64.zip" "$TEMP\slimevr-openvr-driver-win64\" + nsisunz::Unzip "$TEMP\SlimeVR.zip" "$TEMP\SlimeVR\" Pop $0 DetailPrint "Unzipping finished with $0." - nsisunz::Unzip "$TEMP\SlimeVR.zip" "$TEMP\SlimeVR\" + DetailPrint "Copying SlimeVR Server to installation folder..." + CopyFiles /SILENT "$TEMP\SlimeVR\SlimeVR\*" $INSTDIR + + # Include modified run.bat that will run bundled JRE + File "run.bat" + File "run.ico" + + # Create the uninstaller + WriteUninstaller "$INSTDIR\uninstall.exe" +SectionEnd + +Section "SlimeVR Driver" SEC_VRDRIVER + SectionIn RO + + SetOutPath $INSTDIR + + DetailPrint "Downloading SlimeVR Driver..." + NScurl::http GET "https://github.com/SlimeVR/SlimeVR-OpenVR-Driver/releases/latest/download/slimevr-openvr-driver-win64.zip" "$TEMP\slimevr-openvr-driver-win64.zip" /CANCEL /RESUME /END + Pop $0 ; Status text ("OK" for success) + ${If} $0 != "OK" + Abort "Failed to download SlimeVR Driver. Reason: $0." + ${EndIf} + DetailPrint "Downloaded!" + + DetailPrint "Unpacking downloaded files..." + nsisunz::Unzip "$TEMP\slimevr-openvr-driver-win64.zip" "$TEMP\slimevr-openvr-driver-win64\" Pop $0 DetailPrint "Unzipping finished with $0." - ${If} $SELECTED_INSTALLER_ACTION != "update" - DetailPrint "Installing USB drivers...." + # Include SteamVR powershell script to register/unregister driver + File "steamvr.ps1" + DetailPrint "Copying SlimeVR Driver to SteamVR..." + ${If} $STEAMVRDIR == "" + ${DisableX64FSRedirection} + nsExec::ExecToLog '"$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass -File "$INSTDIR\steamvr.ps1" -SteamPath "$STEAMDIR" -DriverPath "$TEMP\slimevr-openvr-driver-win64\slimevr"' $0 + ${EnableX64FSRedirection} + Pop $0 + ${If} $0 != 0 + Abort "Failed to copy SlimeVR Driver. Make sure you have SteamVR installed." + ${EndIf} + ${Else} + CopyFiles /SILENT "$TEMP\slimevr-openvr-driver-win64\slimevr" "$STEAMVRDIR\drivers\slimevr" + ${Endif} +SectionEnd + +SectionGroup "USB drivers" SEC_USBDRIVERS + + Section "CP210x driver" SEC_CP210X # CP210X drivers (NodeMCU v2) SetOutPath "$TEMP\slimevr_usb_drivers_inst\CP201x" DetailPrint "Installing CP210x driver..." @@ -377,7 +447,9 @@ Section ${Else} Abort "Failed to install CP210x driver. Error code: $0." ${Endif} + SectionEnd + Section "CH340 driver" SEC_CH340 # CH340 drivers (NodeMCU v3) SetOutPath "$TEMP\slimevr_usb_drivers_inst\CH341SER" DetailPrint "Installing CH340 driver..." @@ -393,90 +465,86 @@ Section ${ElseIf} $0 == 3010 DetailPrint "The requested operation completed successfully and a system reboot is required." ${Else} - Abort "Failed to install CP210x driver. Error code: $0." + Abort "Failed to install CH340 driver. Error code: $0." ${Endif} - ${Endif} - - # Set the installation directory as the destination for the following actions - SetOutPath $INSTDIR - - ${If} $SELECTED_INSTALLER_ACTION != "update" - DetailPrint "Unzipping Java JRE to installation folder...." - nsisunz::Unzip "$TEMP\$DownloadedJreFile.zip" "$TEMP\$DownloadedJreFile\" - Pop $0 - DetailPrint "Unzipping finished with $0." - CopyFiles /SILENT "$TEMP\$DownloadedJreFile\jdk-11.0.12+7-jre\*" "$INSTDIR\jre" - ${Endif} + SectionEnd - DetailPrint "Copying SlimeVR Server to installation folder..." - CopyFiles /SILENT "$TEMP\SlimeVR\SlimeVR\*" $INSTDIR - - # Include modified run.bat that will run bundled JRE - File "run.bat" - File "run.ico" - # Include SteamVR powershell script to register/unregister driver - File "steamvr.ps1" - - DetailPrint "Copying SlimeVR Driver to SteamVR..." - ${If} $STEAMVRDIR == "" + Section /o "CH9102x driver" SEC_CH9102X + # CH343 drivers (NodeMCU v2.1, some NodeMCU v3?) + SetOutPath "$TEMP\slimevr_usb_drivers_inst\CH343SER" + DetailPrint "Installing CH910x driver..." + File /r "CH343SER\*" ${DisableX64FSRedirection} - nsExec::ExecToLog '"$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass -File "$INSTDIR\steamvr.ps1" -SteamPath "$STEAMDIR" -DriverPath "$TEMP\slimevr-openvr-driver-win64\slimevr"' $0 - ${EnableX64FSRedirection} + nsExec::Exec '"$SYSDIR\PnPutil.exe" -i -a "$TEMP\slimevr_usb_drivers_inst\CH343SER\CH343SER.INF"' $0 Pop $0 - ${If} $0 != 0 - ${If} $SELECTED_INSTALLER_ACTION != "update" - Call cleanInstDir - ${Endif} - Abort "Failed to copy SlimeVR Driver. Make sure you have SteamVR installed." - ${EndIf} - ${Else} - CopyFiles /SILENT "$TEMP\slimevr-openvr-driver-win64\slimevr" "$STEAMVRDIR\drivers\slimevr" - ${Endif} + ${EnableX64FSRedirection} + ${If} $0 == 0 + DetailPrint "Success!" + ${ElseIf} $0 == 259 + DetailPrint "No devices match the supplied driver or the target device is already using a better or newer driver than the driver specified for installation." + ${ElseIf} $0 == 3010 + DetailPrint "The requested operation completed successfully and a system reboot is required." + ${Else} + Abort "Failed to install CH910x driver. Error code: $0." + ${Endif} + SectionEnd +SectionGroupEnd + +Section "-" SEC_FIREWALL ${If} $SELECTED_INSTALLER_ACTION == "repair" DetailPrint "Removing SlimeVR Server from firewall exceptions...." nsExec::Exec '"$INSTDIR\firewall_uninstall.bat"' ${Endif} - ${If} $SELECTED_INSTALLER_ACTION != "update" - DetailPrint "Adding SlimeVR Server to firewall exceptions...." - nsExec::Exec '"$INSTDIR\firewall.bat"' - ${Endif} + DetailPrint "Adding SlimeVR Server to firewall exceptions...." + nsExec::Exec '"$INSTDIR\firewall.bat"' +SectionEnd - ${If} $SELECTED_INSTALLER_ACTION != "update" - DetailPrint "Registering installation..." - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ - "InstallLocation" "$INSTDIR" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ - "DisplayName" "SlimeVR" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ - "UninstallString" '"$INSTDIR\uninstall.exe"' - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ - "DisplayIcon" "$INSTDIR\run.ico" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ - "HelpLink" "https://docs.slimevr.dev/" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ - "URLInfoAbout" "https://slimevr.dev/" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ - "URLUpdateInfo" "https://github.com/SlimeVR/SlimeVR-Installer/releases" - ${EndIf} - ${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6 +Section "-" SEC_REGISTERAPP + DetailPrint "Registering installation..." WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ - "InstallDate" "$2$1$0" - - # Create the uninstaller - WriteUninstaller "$INSTDIR\uninstall.exe" + "InstallLocation" "$INSTDIR" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ + "DisplayName" "SlimeVR" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ + "UninstallString" '"$INSTDIR\uninstall.exe"' + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ + "DisplayIcon" "$INSTDIR\run.ico" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ + "HelpLink" "https://docs.slimevr.dev/" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ + "URLInfoAbout" "https://slimevr.dev/" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ + "URLUpdateInfo" "https://github.com/SlimeVR/SlimeVR-Installer/releases" +SectionEnd +Section # Grant all users full access to the installation folder to avoid using elevated rights # when installing to folders with limited access AccessControl::GrantOnFile $INSTDIR "(BU)" "FullAccess" Pop $0 + # Add/update installation date + ${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6 + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SlimeVR" \ + "InstallDate" "$2$1$0" + + # Write install.log StrCpy $0 "$INSTDIR\install.log" Push $0 Call DumpLog SectionEnd -# InstFiles section end + +Function componentsPre + ${If} $SELECTED_INSTALLER_ACTION == "update" + SectionSetFlags ${SEC_FIREWALL} 0 + SectionSetFlags ${SEC_JRE} 0 + SectionSetFlags ${SEC_REGISTERAPP} 0 + SectionSetFlags ${SEC_USBDRIVERS} ${SF_SECGRP} + Abort + ${EndIf} +FunctionEnd # Uninstaller section start Section "uninstall" @@ -502,4 +570,20 @@ Section "uninstall" DetailPrint "Done." SectionEnd -# Uninstaller section end \ No newline at end of file +# Uninstaller section end + +LangString DESC_SEC_SERVER ${LANG_ENGLISH} "Installs latest SlimeVR Server. Additionally downloads Java JRE 11." +LangString DESC_SEC_VRDRIVER ${LANG_ENGLISH} "Installs latest SlimeVR Driver in SteamVR." +LangString DESC_SEC_USBDRIVERS ${LANG_ENGLISH} "A list of USB drivers that are used by various boards." +LangString DESC_SEC_CP210X ${LANG_ENGLISH} "Installs CP210X USB driver that comes with the following boards: NodeMCU v2, Wemos D1 Mini." +LangString DESC_SEC_CH340 ${LANG_ENGLISH} "Installs CH340 USB driver that comes with the following boards: NodeMCU v3, SlimeVR, Wemos D1 Mini." +LangString DESC_SEC_CH9102x ${LANG_ENGLISH} "Installs CH9102x USB driver that comes with the following boards: NodeMCU v2.1." + +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SEC_SERVER} $(DESC_SEC_SERVER) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC_VRDRIVER} $(DESC_SEC_VRDRIVER) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC_USBDRIVERS} $(DESC_SEC_USBDRIVERS) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC_CP210X} $(DESC_SEC_CP210X) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC_CH340} $(DESC_SEC_CH340) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC_CH9102x} $(DESC_SEC_CH9102x) +!insertmacro MUI_FUNCTION_DESCRIPTION_END \ No newline at end of file diff --git a/windows/web/steamvr.ps1 b/windows/web/steamvr.ps1 index 26bc4f5..051a353 100644 --- a/windows/web/steamvr.ps1 +++ b/windows/web/steamvr.ps1 @@ -39,7 +39,7 @@ foreach ($Match in $res.Matches) { $SteamVrPaths += "$LibraryPath\steamapps\common\SteamVR" } -Write-Host "Attempting to find SteamVR and install SlimeVR Driver..." +Write-Host "Attempting to find SteamVR..." $DriverFolder = Split-Path -Path $DriverPath -Leaf foreach ($SteamVrPath in $SteamVrPaths) { if (Test-Path -Path "$SteamVrPath\bin") {