Skip to content

Commit ef8e434

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

6 files changed

Lines changed: 89 additions & 139 deletions

File tree

Community Scripts/silent-install.ps1

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,53 @@ param(
1414
);
1515

1616
# Create temp directory
17-
$tempDir = Join-Path $env:TEMP "VDDInstall";
17+
$tempDir = $PWD;
1818
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null;
19-
20-
# Download and run DevCon Installer
21-
Write-Host "Installing DevCon..." -ForegroundColor Cyan;
22-
$devconPath = Join-Path $tempDir "Devcon.Installer.exe";
23-
Invoke-WebRequest -Uri "https://github.com/Drawbackz/DevCon-Installer/releases/download/1.4-rc/Devcon.Installer.exe" -OutFile $devconPath;
24-
Start-Process -FilePath $devconPath -ArgumentList "install -hash $DevconHash -update -dir `"$tempDir`"" -Wait -NoNewWindow;
25-
2619
# Define path to devcon executable
2720
$devconExe = Join-Path $tempDir "devcon.exe";
21+
# Download and run DevCon Installer
22+
if (-not (Test-Path $devconExe))
23+
{
24+
$devconPath = Join-Path $tempDir "Devcon.Installer.exe";
25+
if (-not (Test-Path $devconPath))
26+
{
27+
Write-Host "Downloading DevCon..." -ForegroundColor Cyan;
28+
Invoke-WebRequest -Uri "https://github.com/Drawbackz/DevCon-Installer/releases/download/1.4-rc/Devcon.Installer.exe" -OutFile $devconPath;
29+
}
30+
Write-Host "Installing DevCon..." -ForegroundColor Cyan;
31+
Start-Process -FilePath $devconPath -ArgumentList "install -hash $DevconHash -update -dir `"$tempDir`"" -Wait -NoNewWindow;
32+
Write-Host "Installing DevCon Completed..." -ForegroundColor Cyan;
33+
}
2834

2935
# Check if VDD is installed. Or else, install it
3036
$check = & $devconExe find "Root\MttVDD";
3137
if ($check -match "1 matching device\(s\) found") {
3238
Write-Host "Virtual Display Driver already present. No installation." -ForegroundColor Green;
3339
} else {
34-
# Download and unzip VDD
35-
Write-Host "Downloading VDD..." -ForegroundColor Cyan;
36-
$driverZipPath = Join-Path $tempDir 'driver.zip';
37-
Invoke-WebRequest -Uri $DriverURL -OutFile $driverZipPath;
38-
Expand-Archive -Path $driverZipPath -DestinationPath $tempDir -Force;
39-
4040
# Extract the signPath certificates
4141
$catFile = Join-Path $tempDir 'VirtualDisplayDriver\mttvdd.cat';
42+
if (-not (Test-Path $catFile)){
43+
# Download and unzip VDD
44+
$driverZipPath = Join-Path $tempDir 'driver.zip';
45+
if (-not (Test-Path $driverZipPath))
46+
{
47+
Write-Host "Downloading VDD..." -ForegroundColor Cyan;
48+
Invoke-WebRequest -Uri $DriverURL -OutFile $driverZipPath;
49+
}
50+
Expand-Archive -Path $driverZipPath -DestinationPath $tempDir -Force;
51+
}
52+
4253
$signature = Get-AuthenticodeSignature -FilePath $catFile;
4354
$catBytes = [System.IO.File]::ReadAllBytes($catFile);
4455
$certificates = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2Collection;
4556
$certificates.Import($catBytes);
4657

4758
# Create the temp directory for certificates
4859
$certsFolder = Join-Path $tempDir "ExportedCerts";
49-
New-Item -ItemType Directory -Path $certsFolder;
50-
60+
if (-not (Test-Path $certsFolder))
61+
{
62+
New-Item -ItemType Directory -Path $certsFolder;
63+
}
5164
# Write and store the driver certificates on local machine
5265
Write-Host "Installing driver certificates on local machine." -ForegroundColor Cyan;
5366
foreach ($cert in $certificates) {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Run this script in a powershell with administrator rights (run as administrator)
2+
[CmdletBinding()]
3+
param(
4+
5+
);
6+
7+
# Create temp directory
8+
$tempDir = $PWD;
9+
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null;
10+
# Define path to devcon executable
11+
$devconExe = Join-Path $tempDir "devcon.exe";
12+
& $devconExe remove "Root\MttVDD";
13+
Write-Host "Driver installation removed." -ForegroundColor Green;
14+
15+

Community Scripts/vdd-install.bat

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@echo off
2+
3+
REM 从注册表获取
4+
for /f "delims=" %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "DisplayVersion"') do set "DisplayVersion=%%i"
5+
echo window display version: %DisplayVersion%
6+
7+
REM 取数据部分的内容
8+
for %%a in (%DisplayVersion%) do set "version=%%a"
9+
echo version: %version%
10+
REM 数据来源:https://github.com/Drawbackz/DevCon-Installer/blob/master/devcon_sources.json
11+
IF "%version%"=="23H2" set "WindowHash=C8FCE4377D8F0D184E5434F9EF1FE1EF9D0E34196A08CD7E5655555FABA21379"
12+
IF "%version%"=="22H2" set "WindowHash=4F0C165C58114790DB7807872DEBD99379321024DB6077F0ED79426CF9C05CA0"
13+
IF "%version%"=="21H2" set "WindowHash=FBD394E4407C6C334B933FF3A0D21A8E28F0EEDE0CFE5FB277287C3F994B5B00"
14+
15+
echo window hash:%WindowHash%
16+
17+
powershell.exe -ExecutionPolicy Bypass -File "silent-install.ps1" $WindowHash
18+
19+
pause
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
@echo off
2-
3-
:: Use PowerShell for elevation check and execution
4-
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
5-
"$elevated = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator');" ^
6-
"if (-not $elevated) {" ^
7-
"$CommandLine = '-File \"' + $MyInvocation.MyCommand.Path + '\" ' + $MyInvocation.UnboundArguments;" ^
8-
"Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine;" ^
9-
"Exit" ^
10-
"} else {" ^
11-
"Install-Module -Name DisplayConfig -Scope AllUsers -Force -AllowClobber;" ^
12-
"Install-Module -Name MonitorConfig -Scope AllUsers -Force -AllowClobber;" ^
13-
"if ($?) {" ^
14-
"Write-Output 'Modules installed successfully.'" ^
15-
"} else {" ^
16-
"Write-Output 'An error occurred while installing the modules.'" ^
17-
"}" ^
18-
"}"
19-
20-
pause
1+
@echo off
2+
3+
:: Use PowerShell for elevation check and execution
4+
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
5+
"$elevated = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator');" ^
6+
"if (-not $elevated) {" ^
7+
"$CommandLine = '-File \"' + $MyInvocation.MyCommand.Path + '\" ' + $MyInvocation.UnboundArguments;" ^
8+
"Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine;" ^
9+
"Exit" ^
10+
"} else {" ^
11+
"Install-Module -Name DisplayConfig -Scope AllUsers -Force -AllowClobber;" ^
12+
"Install-Module -Name MonitorConfig -Scope AllUsers -Force -AllowClobber;" ^
13+
"if ($?) {" ^
14+
"Write-Output 'Modules installed successfully.'" ^
15+
"} else {" ^
16+
"Write-Output 'An error occurred while installing the modules.'" ^
17+
"}" ^
18+
"}"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
powershell.exe -ExecutionPolicy Bypass -File "silent-uninstall.ps1"
3+
pause

README.md

Lines changed: 5 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,7 @@
1-
# 🛠️ Virtual Display Driver Development Team
1+
#### Virtual Display for sunshine-super
22

3-
| 👤 Developer | 🏷️ Role | 💖 Support Us |
4-
| --------------------- | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
5-
| **[MikeTheTech](https://github.com/itsmikethetech)** | Project Manager, Lead Programmer | [Patreon](https://www.patreon.com/mikethetech) :gem: / [GitHub Sponsors](https://github.com/sponsors/itsmikethetech/) 💖 |
6-
| **[Jocke](https://github.com/zjoasan)** | Programmer, Concept Design | [GitHub Sponsors ](https://github.com/sponsors/zjoasan) 💖 |
3+
#### changelog
74

8-
:bulb: *We appreciate your support—every contribution helps us keep building amazing experiences!*
9-
10-
# <img src="https://github.com/user-attachments/assets/22ff37ba-a8ea-4b65-b7b2-e7fcb09d858b" height="32" width="32"></img> Virtual Display Driver
11-
This project creates a _virtual monitor_ in Windows that functions just like a physical display. It is particularly useful for applications such as **streaming, virtual reality, screen recording,** and **headless servers—systems** that operate without a physical display attached.
12-
13-
Unlike traditional monitors, this virtual display supports custom resolutions and refresh rates beyond hardware limitations—offering greater flexibility for advanced setups. You can also use custom EDIDs to simulate or emulate existing hardware displays.
14-
15-
## ⬇️ Download Latest Version
16-
17-
- [Driver Installer (Windows 10/11)](https://github.com/VirtualDrivers/Virtual-Display-Driver/releases) - Check the [Releases](https://github.com/VirtualDrivers/Virtual-Display-Driver/releases) page for the latest version and release notes.
18-
19-
> [!IMPORTANT]
20-
> Before using the Virtual Display Driver, ensure the following dependencies are installed:
21-
> - **Microsoft Visual C++ Redistributable**
22-
> If you encounter the error `vcruntime140.dll not found`, download and install the latest version from the [Microsoft Visual C++ Redistributable page](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170).
23-
24-
25-
## 🛠️ Installation
26-
27-
- Step 1: Download the Virtual Driver Control app.
28-
- You can download the installer directly from the [Releases](https://github.com/VirtualDrivers/Virtual-Display-Driver/releases) page.
29-
30-
- Step 2: Extract to a folder and run the app
31-
- Launch the VDC.
32-
- Click the Install button.
33-
34-
- Step 3: Verify the Installation (Optional)
35-
- Check if the Virtual Display Driver is correctly installed by running the following:
36-
- **Device Manager:** Check "Device Manager" under "Display Adapters."
37-
- **Settings:** Check display settings under system settings and see if the virtual displays show.
38-
39-
While VDC is a good and friendly way to work with VDD, you can also do a a lot manually. Like adding or removing resolutions or enable/disable
40-
functions, which is done by editing vdd_settings.xml. You should be able to locate the file at the default location:
41-
```C:\VirtualDisplayDriver\vdd_settings.xml ```
42-
43-
For more information about manual installation, uninstallation and "personalization", please check out the [Wiki](https://github.com/VirtualDrivers/Virtual-Display-Driver/wiki) here on
44-
the project GitHub repository. If you are into tinkering, check out the Powershell scripts in [Community scripts](https://github.com/VirtualDrivers/Virtual-Display-Driver/tree/master/Community%20Scripts).
45-
46-
## 🤔 Comparison with other IDDs
47-
48-
The table below shows a comparison with other popular Indirect Display Driver
49-
projects.
50-
51-
| Project | Iddcx version | Signed | SDR | HDR | H-Cursor | Tweakable | ARM64 Support | Custom EDID | Floating Point Refresh Rates |
52-
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
53-
| [Virtual-Display-Driver (HDR)] | 1.10 (latest) || ✅ (8/10bit) | ✅ (1-/12bit) ||| ✅¹ |||
54-
| [usbmmid_v2] | || ✅ (8bit) | | | | | | |
55-
| [virtual-display-rs] | 1.5 | | ✅ (8bit) | ||| | | |
56-
| [parsec-vdd]| 1.5 || ✅ (8bit) | ||| | | |
57-
| [lddSampleDriver] | 1.2 | | ✅ (8bit) | | | | | | |
58-
| [RustDesklddDriver] | 1.2 | | ✅ (8bit) | | | | | | |
59-
60-
¹ ARM64 Support in Windows 11 24H2 or later may require test signing be enabled.
61-
62-
HDR Support Now Available for Windows 11 23H2+
63-
64-
## ▶️ Videos and Tutorials
65-
66-
### Installation Video
67-
68-
[![Thumbnail24 (1)](https://github.com/user-attachments/assets/383d840c-8327-439b-a89b-84b271320371)](https://youtu.be/jN5YnHlC0fE)
69-
70-
![Powerpoint](https://github.com/user-attachments/assets/9ac05776-36e1-4ba1-ac52-3f189dbd7730)
71-
72-
## 🤝 Sponsors
73-
74-
<table>
75-
<tr>
76-
<td><img src="https://github.com/user-attachments/assets/ca93d971-67dc-41dd-b945-ab4f372ea72a" /></td>
77-
<td>Free code signing on Windows provided by <a href="https://signpath.io">SignPath.io</a>, certificate by <a href="https://signpath.org">SignPath Foundation</a></td>
78-
</tr>
79-
</table>
80-
81-
<table>
82-
<tr>
83-
<td>Advanced 32bit IEEE Float Audio brought to you by **Lune Studios**.</td>
84-
</tr>
85-
</table>
86-
87-
## Acknowledgements
88-
89-
- Shoutout to **[MikeTheTech](https://github.com/itsmikethetech)** Project Manager, Owner, and Programmer
90-
- Shoutout to **[zjoasan](https://github.com/zjoasan)** Programmer. For scripts, EDID integration, and parts of installer.
91-
- Shoutout to **[Bud](https://github.com/bud3699)** Former Lead Programmer, has since left the project.
92-
- Shoutout to **[Roshkins](https://github.com/roshkins/IddSampleDriver)** for the original repo.
93-
- Shoutout to **[Baloukj](https://github.com/baloukj/IddSampleDriver)** for the 8-bit / 10-bit support. (Also, first to push the new Microsoft Driver public!)
94-
- Shoutout to **[Anakngtokwa](https://github.com/Anakngtokwa)** for assisting with finding driver sources.
95-
- **[Microsoft](https://github.com/microsoft/Windows-driver-samples/tree/master/video/IndirectDisplay)** Indirect Display Driver/Sample (Driver code)
96-
- Thanks to **[AKATrevorJay](https://github.com/akatrevorjay/edid-generator)** for the hi-res EDID.
97-
- Shoutout to **[LexTrack](https://github.com/lextrack/)** for the MiniScreenRecorder script.
98-
99-
## Star History
100-
101-
[![Star History Chart](https://api.star-history.com/svg?repos=VirtualDrivers/Virtual-Display-Driver&type=Date)](https://www.star-history.com/#VirtualDrivers/Virtual-Display-Driver&Date)
102-
103-
## Disclaimer:
104-
105-
This software is provided "AS IS" with NO IMPLICIT OR EXPLICIT warranty. It's worth noting that while this software functioned without issues on our systems, there is no guarantee that it will not impact your computer. It operates in User Mode(Session0), which reduces the likelihood of causing system instability, such as the Blue Screen of Death. However, exercise caution when using this software.
5+
##### 1.0.25.102401
6+
1. add vdd install and uninstall shell bat.
7+
2. optimize script make workspace is current directory.

0 commit comments

Comments
 (0)