Skip to content

Commit 43c5ac0

Browse files
committed
1. add vdd install and uninstall shell bat.
2. optimize script make workspace is current directory.
1 parent ef8e434 commit 43c5ac0

2 files changed

Lines changed: 29 additions & 3 deletions

File tree

Community Scripts/vdd-install.bat

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,41 @@
11
@echo off
22

3-
REM 从注册表获取
3+
REM Retrieve from the registry
44
for /f "delims=" %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "DisplayVersion"') do set "DisplayVersion=%%i"
55
echo window display version: %DisplayVersion%
66

7-
REM 取数据部分的内容
7+
REM Take the content of the data section
88
for %%a in (%DisplayVersion%) do set "version=%%a"
99
echo version: %version%
10-
REM 数据来源:https://github.com/Drawbackz/DevCon-Installer/blob/master/devcon_sources.json
10+
REM data from ====> https://github.com/Drawbackz/DevCon-Installer/blob/master/devcon_sources.json
1111
IF "%version%"=="23H2" set "WindowHash=C8FCE4377D8F0D184E5434F9EF1FE1EF9D0E34196A08CD7E5655555FABA21379"
1212
IF "%version%"=="22H2" set "WindowHash=4F0C165C58114790DB7807872DEBD99379321024DB6077F0ED79426CF9C05CA0"
1313
IF "%version%"=="21H2" set "WindowHash=FBD394E4407C6C334B933FF3A0D21A8E28F0EEDE0CFE5FB277287C3F994B5B00"
1414

1515
echo window hash:%WindowHash%
1616

17+
REM Write our configuration directory to the registry
18+
rem install
19+
set "DRIVER_DIR=%~dp0\VirtualDisplayDriver"
20+
echo driver directory:%DRIVER_DIR%
21+
rem Get root directory,current in the scripts directory.
22+
for %%I in ("%~dp0\..\..") do set "ROOT_DIR=%%~fI"
23+
set "CONFIG_DIR=%ROOT_DIR%\config"
24+
set "VDD_CONFIG=%CONFIG_DIR%\vdd_settings.xml"
25+
echo driver config path: %VDD_CONFIG%
26+
27+
REM It is always a good choice to copy configurations from the original directory to the configuration directory, whether for recovery or backup purposes
28+
copy "%DRIVER_DIR%\vdd_settings.xml" "%VDD_CONFIG%"
29+
30+
REM The default read is the directory configured in the registry. We need to configure the directory in the registry
31+
reg add "HKLM\SOFTWARE\MikeTheTech\VirtualDisplayDriver" /v VDDPATH /t REG_SZ /d "%CONFIG_DIR%" /f
32+
33+
REM Install driver
1734
powershell.exe -ExecutionPolicy Bypass -File "silent-install.ps1" $WindowHash
1835

36+
REM After the initial installation, it should also be set to expand the display mode of these monitors
37+
powershell -NoProfile -ExecutionPolicy Bypass -Command "& "C:\Windows\System32\DisplaySwitch.exe" /extend"
38+
39+
REM After installation, disable the display driver first
40+
powershell.exe -ExecutionPolicy Bypass -File "virtual-driver-manager.ps1" disable --silent true
1941
pause

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#### Virtual Display for sunshine-super
22

33
#### changelog
4+
##### 1.0.25.102701
5+
1. move script to child directory,like ./scripts/vdd/ .
6+
2. add set display mode script for extend.
7+
3. add set disable vdd after first setup.
48

59
##### 1.0.25.102401
610
1. add vdd install and uninstall shell bat.

0 commit comments

Comments
 (0)