mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-14 23:34:08 +00:00
win-dshow: Add VirtualCam installer scripts
This adds two batch scripts to install and uninstall the virtual cam devices for installations where the installer could not be used. Most commonly, this is for portable installations or those who prefer the .zip file.
This commit is contained in:
parent
dc3839ab74
commit
a94ede6d00
|
@ -143,5 +143,8 @@ source_group("libdshowcapture\\Header Files" FILES ${libdshowcapture_HEADERS})
|
|||
install_obs_plugin_with_data(win-dshow data)
|
||||
|
||||
if(VIRTUALCAM_ENABLED)
|
||||
configure_file(virtualcam-install.bat.in "${CMAKE_CURRENT_BINARY_DIR}/data/virtualcam-install.bat")
|
||||
configure_file(virtualcam-uninstall.bat.in "${CMAKE_CURRENT_BINARY_DIR}/data/virtualcam-uninstall.bat")
|
||||
install_obs_data_from_abs_path(win-dshow "${CMAKE_CURRENT_BINARY_DIR}/data" "obs-plugins/win-dshow")
|
||||
add_subdirectory(virtualcam-module)
|
||||
endif()
|
||||
|
|
78
plugins/win-dshow/virtualcam-install.bat.in
Normal file
78
plugins/win-dshow/virtualcam-install.bat.in
Normal file
|
@ -0,0 +1,78 @@
|
|||
@echo off
|
||||
goto checkAdmin
|
||||
|
||||
:checkAdmin
|
||||
net session >nul 2>&1
|
||||
if %errorLevel% == 0 (
|
||||
echo.
|
||||
) else (
|
||||
echo Administrative rights are required, please re-run this script as Administrator.
|
||||
goto end
|
||||
)
|
||||
|
||||
:checkDLL
|
||||
echo Checking for 32-bit Virtual Cam registration...
|
||||
reg query "HKLM\SOFTWARE\Classes\WOW6432Node\CLSID\{@VIRTUALCAM_GUID@}" >nul 2>&1
|
||||
if %errorLevel% == 0 (
|
||||
echo 32-bit Virtual Cam found, skipping install...
|
||||
echo.
|
||||
) else (
|
||||
echo 32-bit Virtual Cam not found, installing...
|
||||
goto install32DLL
|
||||
)
|
||||
|
||||
:CheckDLLContinue
|
||||
echo Checking for 64-bit Virtual Cam registration...
|
||||
reg query "HKLM\SOFTWARE\Classes\CLSID\{@VIRTUALCAM_GUID@}" >nul 2>&1
|
||||
if %errorLevel% == 0 (
|
||||
echo 64-bit Virtual Cam found, skipping install...
|
||||
echo.
|
||||
) else (
|
||||
echo 64-bit Virtual Cam not found, installing...
|
||||
goto install64DLL
|
||||
)
|
||||
goto endSuccess
|
||||
|
||||
:install32DLL
|
||||
echo Installing 32-bit Virtual Cam...
|
||||
if exist "%~dp0\data\obs-plugins\win-dshow\obs-virtualcam-module32.dll" (
|
||||
regsvr32.exe /i /s "%~dp0\data\obs-plugins\win-dshow\obs-virtualcam-module32.dll"
|
||||
) else (
|
||||
regsvr32.exe /i /s obs-virtualcam-module32.dll
|
||||
)
|
||||
reg query "HKLM\SOFTWARE\Classes\WOW6432Node\CLSID\{@VIRTUALCAM_GUID@}" >nul 2>&1
|
||||
if %errorLevel% == 0 (
|
||||
echo 32-bit Virtual Cam successfully installed
|
||||
echo.
|
||||
) else (
|
||||
echo 32-bit Virtual Cam installation failed
|
||||
echo.
|
||||
goto end
|
||||
)
|
||||
goto checkDLLContinue
|
||||
|
||||
:install64DLL
|
||||
echo Installing 64-bit Virtual Cam...
|
||||
if exist "%~dp0\data\obs-plugins\win-dshow\obs-virtualcam-module64.dll" (
|
||||
regsvr32.exe /i /s "%~dp0\data\obs-plugins\win-dshow\obs-virtualcam-module64.dll"
|
||||
) else (
|
||||
regsvr32.exe /i /s obs-virtualcam-module64.dll
|
||||
)
|
||||
reg query "HKLM\SOFTWARE\Classes\CLSID\{@VIRTUALCAM_GUID@}" >nul 2>&1
|
||||
if %errorLevel% == 0 (
|
||||
echo 64-bit Virtual Cam successfully installed
|
||||
echo.
|
||||
goto endSuccess
|
||||
) else (
|
||||
echo 64-bit Virtual Cam installation failed
|
||||
echo.
|
||||
goto end
|
||||
)
|
||||
|
||||
:endSuccess
|
||||
echo Virtual Cam installed!
|
||||
echo.
|
||||
|
||||
:end
|
||||
pause
|
||||
exit
|
31
plugins/win-dshow/virtualcam-uninstall.bat.in
Normal file
31
plugins/win-dshow/virtualcam-uninstall.bat.in
Normal file
|
@ -0,0 +1,31 @@
|
|||
@echo off
|
||||
goto checkAdmin
|
||||
|
||||
:checkAdmin
|
||||
net session >nul 2>&1
|
||||
if %errorLevel% == 0 (
|
||||
echo.
|
||||
) else (
|
||||
echo Administrative rights are required, please re-run this script as Administrator.
|
||||
goto end
|
||||
)
|
||||
|
||||
:uninstallDLLs
|
||||
if exist "%~dp0\data\obs-plugins\win-dshow\obs-virtualcam-module32.dll" (
|
||||
regsvr32.exe /u /s "%~dp0\data\obs-plugins\win-dshow\obs-virtualcam-module32.dll"
|
||||
) else (
|
||||
regsvr32.exe /u /s obs-virtualcam-module32.dll
|
||||
)
|
||||
if exist "%~dp0\data\obs-plugins\win-dshow\obs-virtualcam-module64.dll" (
|
||||
regsvr32.exe /u /s "%~dp0\data\obs-plugins\win-dshow\obs-virtualcam-module64.dll"
|
||||
) else (
|
||||
regsvr32.exe /u /s obs-virtualcam-module64.dll
|
||||
)
|
||||
|
||||
:endSuccess
|
||||
echo Virtual Cam uninstalled!
|
||||
echo.
|
||||
|
||||
:end
|
||||
pause
|
||||
exit
|
Loading…
Reference in a new issue