-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
259 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+52.5 KB
OpenVR-SpaceCalibratorDriver/000spacecalibrator/bin/win64/driver_000spacecalibrator.dll
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
OpenVR-SpaceCalibratorDriver/000spacecalibrator/driver.vrdrivermanifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"alwaysActivate": true, | ||
"name" : "000spacecalibrator", | ||
"directory" : "", | ||
"resourceOnly" : false | ||
} |
5 changes: 5 additions & 0 deletions
5
OpenVR-SpaceCalibratorDriver/000spacecalibrator/resources/driver.vrresources
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"jsonid" : "vrresources", | ||
"statusicons" : { | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
OpenVR-SpaceCalibratorDriver/000spacecalibrator/resources/settings/default.vrsettings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"driver_000spacecalibrator" : { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
|
||
;-------------------------------- | ||
;Include Modern UI | ||
|
||
!include "MUI2.nsh" | ||
|
||
;-------------------------------- | ||
;General | ||
|
||
!define OVERLAY_BASEDIR "..\client_overlay\bin\win64" | ||
!define DRIVER_RESDIR "..\OpenVR-SpaceCalibratorDriver\000spacecalibrator" | ||
|
||
;Name and file | ||
Name "OpenVR-SpaceCalibrator" | ||
OutFile "OpenVR-SpaceCalibrator.exe" | ||
|
||
;Default installation folder | ||
InstallDir "$PROGRAMFILES64\OpenVR-SpaceCalibrator" | ||
|
||
;Get installation folder from registry if available | ||
InstallDirRegKey HKLM "Software\OpenVR-SpaceCalibrator\Main" "" | ||
|
||
;Request application privileges for Windows Vista | ||
RequestExecutionLevel admin | ||
|
||
;-------------------------------- | ||
;Variables | ||
|
||
VAR upgradeInstallation | ||
|
||
;-------------------------------- | ||
;Interface Settings | ||
|
||
!define MUI_ABORTWARNING | ||
|
||
;-------------------------------- | ||
;Pages | ||
|
||
!insertmacro MUI_PAGE_LICENSE "..\LICENSE" | ||
!define MUI_PAGE_CUSTOMFUNCTION_PRE dirPre | ||
!insertmacro MUI_PAGE_DIRECTORY | ||
!insertmacro MUI_PAGE_INSTFILES | ||
|
||
!insertmacro MUI_UNPAGE_CONFIRM | ||
!insertmacro MUI_UNPAGE_INSTFILES | ||
|
||
;-------------------------------- | ||
;Languages | ||
|
||
!insertmacro MUI_LANGUAGE "English" | ||
|
||
;-------------------------------- | ||
;Macros | ||
|
||
;-------------------------------- | ||
;Functions | ||
|
||
Function dirPre | ||
StrCmp $upgradeInstallation "true" 0 +2 | ||
Abort | ||
FunctionEnd | ||
|
||
Function .onInit | ||
StrCpy $upgradeInstallation "false" | ||
|
||
ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenVRSpaceCalibrator" "UninstallString" | ||
StrCmp $R0 "" done | ||
|
||
|
||
; If SteamVR is already running, display a warning message and exit | ||
FindWindow $0 "Qt5QWindowIcon" "SteamVR Status" | ||
StrCmp $0 0 +3 | ||
MessageBox MB_OK|MB_ICONEXCLAMATION \ | ||
"SteamVR is still running. Cannot install this software.$\nPlease close SteamVR and try again." | ||
Abort | ||
|
||
|
||
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ | ||
"OpenVR-SpaceCalibrator is already installed. $\n$\nClick `OK` to upgrade the \ | ||
existing installation or `Cancel` to cancel this upgrade." \ | ||
IDOK upgrade | ||
Abort | ||
|
||
upgrade: | ||
StrCpy $upgradeInstallation "true" | ||
done: | ||
FunctionEnd | ||
|
||
;-------------------------------- | ||
;Installer Sections | ||
|
||
Section "Install" SecInstall | ||
|
||
StrCmp $upgradeInstallation "true" 0 noupgrade | ||
DetailPrint "Uninstall previous version..." | ||
ExecWait '"$INSTDIR\Uninstall.exe" /S _?=$INSTDIR' | ||
Delete $INSTDIR\Uninstall.exe | ||
Goto afterupgrade | ||
|
||
noupgrade: | ||
|
||
afterupgrade: | ||
|
||
SetOutPath "$INSTDIR" | ||
|
||
;ADD YOUR OWN FILES HERE... | ||
File "..\LICENSE" | ||
File "..\x64\Release\OpenVR-SpaceCalibrator.exe" | ||
File "..\x64\Release\openvr_api.dll" | ||
|
||
; Install redistributable | ||
ExecWait '"$INSTDIR\vcredist_x64.exe" /install /quiet' | ||
|
||
Var /GLOBAL vrRuntimePath | ||
nsExec::ExecToStack '"$INSTDIR\OpenVR-SpaceCalibrator.exe" -openvrpath' | ||
Pop $0 | ||
Pop $vrRuntimePath | ||
DetailPrint "VR runtime path: $vrRuntimePath" | ||
|
||
SetOutPath "$vrRuntimePath\drivers\000spacecalibrator" | ||
File "${DRIVER_RESDIR}\driver.vrdrivermanifest" | ||
SetOutPath "$vrRuntimePath\drivers\000spacecalibrator\resources" | ||
File "${DRIVER_RESDIR}\resources\driver.vrresources" | ||
SetOutPath "$vrRuntimePath\drivers\000spacecalibrator\resources\settings" | ||
File "${DRIVER_RESDIR}\resources\settings\default.vrsettings" | ||
SetOutPath "$vrRuntimePath\drivers\000spacecalibrator\bin\win64" | ||
File "..\x64\Release\driver_000spacecalibrator.dll" | ||
|
||
;Store installation folder | ||
WriteRegStr HKLM "Software\OpenVR-SpaceCalibrator\Main" "" $INSTDIR | ||
WriteRegStr HKLM "Software\OpenVR-SpaceCalibrator\Driver" "" $vrRuntimePath | ||
|
||
;Create uninstaller | ||
WriteUninstaller "$INSTDIR\Uninstall.exe" | ||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenVRSpaceCalibrator" "DisplayName" "OpenVR-SpaceCalibrator" | ||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenVRSpaceCalibrator" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\"" | ||
|
||
CreateShortCut "$SMPROGRAMS\OpenVR-SpaceCalibrator.lnk" "$INSTDIR\OpenVR-SpaceCalibrator.exe" | ||
|
||
SectionEnd | ||
|
||
;-------------------------------- | ||
;Uninstaller Section | ||
|
||
Section "Uninstall" | ||
; If SteamVR is already running, display a warning message and exit | ||
FindWindow $0 "Qt5QWindowIcon" "SteamVR Status" | ||
StrCmp $0 0 +3 | ||
MessageBox MB_OK|MB_ICONEXCLAMATION \ | ||
"SteamVR is still running. Cannot uninstall this software.$\nPlease close SteamVR and try again." | ||
Abort | ||
|
||
; Delete installed files | ||
Var /GLOBAL vrRuntimePath2 | ||
ReadRegStr $vrRuntimePath2 HKLM "Software\OpenVR-SpaceCalibrator\Driver" "" | ||
DetailPrint "VR runtime path: $vrRuntimePath2" | ||
Delete "$vrRuntimePath2\drivers\000spacecalibrator\driver.vrdrivermanifest" | ||
Delete "$vrRuntimePath2\drivers\000spacecalibrator\resources\driver.vrresources" | ||
Delete "$vrRuntimePath2\drivers\000spacecalibrator\resources\settings\default.vrsettings" | ||
Delete "$vrRuntimePath2\drivers\000spacecalibrator\bin\win64\driver_000spacecalibrator.dll" | ||
Delete "$vrRuntimePath2\drivers\000spacecalibrator\bin\win64\space_calibrator_driver.log" | ||
RMdir "$vrRuntimePath2\drivers\000spacecalibrator\resources\settings" | ||
RMdir "$vrRuntimePath2\drivers\000spacecalibrator\resources\" | ||
RMdir "$vrRuntimePath2\drivers\000spacecalibrator\bin\win64\" | ||
RMdir "$vrRuntimePath2\drivers\000spacecalibrator\bin\" | ||
RMdir "$vrRuntimePath2\drivers\000spacecalibrator\" | ||
|
||
Delete "$INSTDIR\LICENSE" | ||
Delete "$INSTDIR\OpenVR-SpaceCalibrator.exe" | ||
Delete "$INSTDIR\openvr_api.dll" | ||
|
||
DeleteRegKey HKLM "Software\OpenVR-SpaceCalibrator\Main" | ||
DeleteRegKey HKLM "Software\OpenVR-SpaceCalibrator\Driver" | ||
DeleteRegKey HKLM "Software\OpenVR-SpaceCalibrator" | ||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenVRSpaceCalibrator" | ||
|
||
Delete "$SMPROGRAMS\OpenVR-SpaceCalibrator.lnk" | ||
SectionEnd | ||
|