This repository has been archived by the owner on May 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
UpdatePSMoveService.bat
59 lines (50 loc) · 2.63 KB
/
UpdatePSMoveService.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@echo off
setlocal
::Select the path to the root PSMoveService dolder
set "psCommand="(new-object -COM 'Shell.Application')^
.BrowseForFolder(0,'Please select the root folder for PSMoveService (ex: c:\git-cboulay\PSMoveService).',0,0).self.path""
for /f "usebackq delims=" %%I in (`powershell %psCommand%`) do set "PSM_ROOT_PATH=%%I"
if NOT DEFINED PSM_ROOT_PATH (goto failure)
:: Find the distribution folder
For /D %%D in ("%PSM_ROOT_PATH%\dist") Do (
set "DISTRIBUTION_FOLDER=%%~fD"
)
if NOT DEFINED DISTRIBUTION_FOLDER (
echo "Failed to find the distribution folder for PSMoveService!"
echo "Did you run BuildOfficialDistribution.bat?"
goto failure
)
:: Set path variables
set "PSM_DEBUG_WIN32=%DISTRIBUTION_FOLDER%\Win32\Debug"
set "PSM_RELEASE_WIN32=%DISTRIBUTION_FOLDER%\Win32\Release"
set "PSM_DEBUG_X64=%DISTRIBUTION_FOLDER%\Win64\Debug"
set "PSM_RELEASE_X64=%DISTRIBUTION_FOLDER%\Win64\Release"
set "PSM_HEADERS=%PSM_RELEASE_X64%\include"
set "BRIDGE_DEBUG_WIN32=thirdparty\lib\x86\debug"
set "BRIDGE_RELEASE_WIN32=thirdparty\lib\x86\release"
set "BRIDGE_DEBUG_WIN64=thirdparty\lib\x64\debug"
set "BRIDGE_RELEASE_WIN64=thirdparty\lib\x64\release"
set "BRIDGE_HEADERS=thirdparty\headers\PSMoveService"
:: Copy over the header files
xcopy /y /r "%PSM_HEADERS%\ClientConstants.h" "%BRIDGE_HEADERS%" || goto failure
xcopy /y /r "%PSM_HEADERS%\ClientGeometry_CAPI.h" "%BRIDGE_HEADERS%" || goto failure
xcopy /y /r "%PSM_HEADERS%\PSMoveClient_CAPI.h" "%BRIDGE_HEADERS%" || goto failure
xcopy /y /r "%PSM_HEADERS%\PSMoveClient_export.h" "%BRIDGE_HEADERS%" || goto failure
xcopy /y /r "%PSM_HEADERS%\SharedConstants.h" "%BRIDGE_HEADERS%" || goto failure
:: Copy over the client DLLs
xcopy /y /r "%PSM_DEBUG_WIN32%\bin\PSMoveClient_CAPI.dll" "%BRIDGE_DEBUG_WIN32%" || goto failure
xcopy /y /r "%PSM_RELEASE_WIN32%\bin\PSMoveClient_CAPI.dll" "%BRIDGE_RELEASE_WIN32%" || goto failure
xcopy /y /r "%PSM_DEBUG_X64%\bin\PSMoveClient_CAPI.dll" "%BRIDGE_DEBUG_WIN64%" || goto failure
xcopy /y /r "%PSM_RELEASE_X64%\bin\PSMoveClient_CAPI.dll" "%BRIDGE_RELEASE_WIN64%" || goto failure
:: Copy over the client libs
xcopy /y /r "%PSM_DEBUG_WIN32%\lib\PSMoveClient_CAPI.lib" "%BRIDGE_DEBUG_WIN32%" || goto failure
xcopy /y /r "%PSM_RELEASE_WIN32%\lib\PSMoveClient_CAPI.lib" "%BRIDGE_RELEASE_WIN32%" || goto failure
xcopy /y /r "%PSM_DEBUG_X64%\lib\PSMoveClient_CAPI.lib" "%BRIDGE_DEBUG_WIN64%" || goto failure
xcopy /y /r "%PSM_RELEASE_X64%\lib\PSMoveClient_CAPI.lib" "%BRIDGE_RELEASE_WIN64%" || goto failure
echo "Successfully updated PSMoveService from: %DISTRIBUTION_FOLDER%"
pause
EXIT /B 0
:failure
echo "Failed to copy files from PSMoveService distribution"
pause
EXIT /B 1