diff --git a/Community Scripts/changeres-VDD.ps1 b/Community Scripts/changeres-VDD.ps1
index 2fd7e38a..1a90cdab 100644
--- a/Community Scripts/changeres-VDD.ps1
+++ b/Community Scripts/changeres-VDD.ps1
@@ -4,7 +4,10 @@ param(
[int]$xres,
[Parameter(Mandatory, Position=1)]
[Alias("Y","VerticalResolution")]
- [int]$yres
+ [int]$yres,
+ [Parameter(Mandatory, Position=2)]
+ [Alias("id","displayIndex")]
+ [int]$displayId
)
# Self-elevate the script if required
@@ -21,7 +24,7 @@ if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdent
. "$PSScriptRoot\set-dependencies.ps1"
# Getting the correct display
-$disp = Get-DisplayInfo | Where-Object { $_.DisplayName -eq "VDD by MTT" }
+#$disp = Get-DisplayInfo | Where-Object { $_.DisplayName -eq "VDD by MTT" }
# Setting the resolution on the display
-Set-DisplayResolution -DisplayId $disp.DisplayId -Width $xres -Height $yres
\ No newline at end of file
+Set-DisplayResolution -DisplayId $displayId -Width $xres -Height $yres
\ No newline at end of file
diff --git a/Community Scripts/set-dependencies.ps1 b/Community Scripts/set-dependencies.ps1
index 40a3df42..c56a9fbf 100644
--- a/Community Scripts/set-dependencies.ps1
+++ b/Community Scripts/set-dependencies.ps1
@@ -24,6 +24,11 @@ if (-not (Get-PSRepository -Name $repo.Name -ErrorAction SilentlyContinue)) {
Set-PSRepository -Name $repo.Name -InstallationPolicy Trusted `
-InformationAction Ignore -WarningAction SilentlyContinue
+#import DisplayConfig
+Import-Module DisplayConfig
+#import MonitorConfig
+Import-Module MonitorConfig
+
# Loop through the modules and ensure they are imported & installed
foreach ($m in $modules) {
diff --git a/Community Scripts/silent-install.ps1 b/Community Scripts/silent-install.ps1
index e32eef2f..db53ff5a 100644
--- a/Community Scripts/silent-install.ps1
+++ b/Community Scripts/silent-install.ps1
@@ -3,7 +3,7 @@
param(
# Latest stable version of NefCon installer
[Parameter(Mandatory=$false)]
- [string]$NefConURL = "https://github.com/nefarius/nefcon/releases/download/v1.14.0/nefcon_v1.14.0.zip",
+ [string]$NefConURL = "https://github.com/nefarius/nefcon/releases/download/v1.17.40/nefcon_v1.17.40.zip",
# Latest stable version of VDD driver only
[Parameter(Mandatory=$false)]
@@ -11,47 +11,71 @@ param(
);
# Create temp directory
-$tempDir = Join-Path $env:TEMP "VDDInstall";
+$tempDir = $PSScriptRoot;
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null;
-# Download and unzip NefCon
-Write-Host "Downloading and extracting NefCon..." -ForegroundColor Cyan;
-$NefConZipPath = Join-Path $tempDir "nefcon.zip";
-Invoke-WebRequest -Uri $NefConURL -OutFile $NefConZipPath -UseBasicParsing -ErrorAction Stop;
-Expand-Archive -Path $NefConZipPath -DestinationPath $tempDir -Force -ErrorAction Stop;
-$NefConExe = Join-Path $tempDir "x64\nefconw.exe";
-
-# Download and unzip VDD
-Write-Host "Downloading and extracting VDD..." -ForegroundColor Cyan;
-$driverZipPath = Join-Path $tempDir 'driver.zip';
-Invoke-WebRequest -Uri $DriverURL -OutFile $driverZipPath;
-Expand-Archive -Path $driverZipPath -DestinationPath $tempDir -Force;
+# Define path to nefcon executable
+$NefConExe = Join-Path $tempDir "x64\nefconc.exe";
+# Download and run DevCon Installer
+if (-not (Test-Path $NefConExe))
+{
+ $NefConZipPath = Join-Path $tempDir "nefcon.zip";
+ if (-not (Test-Path $NefConZipPath))
+ {
+ Write-Host "Downloading NefCon..." -ForegroundColor Cyan;
+ Invoke-WebRequest -Uri $NefConURL -OutFile $NefConZipPath -UseBasicParsing -ErrorAction Stop;
+ }
+ Write-Host "extracting NefCon..." -ForegroundColor Cyan;
+ Expand-Archive -Path $NefConZipPath -DestinationPath $tempDir -Force -ErrorAction Stop;
+ Write-Host "extracting NefCon Completed..." -ForegroundColor Cyan;
+}
-# Extract the SignPath certificates
-Write-Host "Extracting SignPath certificates..." -ForegroundColor Cyan;
-$catFile = Join-Path $tempDir 'VirtualDisplayDriver\mttvdd.cat';
-$catBytes = [System.IO.File]::ReadAllBytes($catFile);
-$certificates = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2Collection;
-$certificates.Import($catBytes);
+# Check if VDD is installed. Or else, install it
+$check = & $NefConExe --find-hwid ---hardware-id "Root\MttVDD";
+if ($check -match "Virtual Display Driver") {
+ Write-Host "Virtual Display Driver already present. No installation." -ForegroundColor Green;
+} else {
+ # Extract the signPath certificates
+ $catFile = Join-Path $tempDir 'VirtualDisplayDriver\mttvdd.cat';
+ if (-not (Test-Path $catFile)){
+ # Download and unzip VDD
+ $driverZipPath = Join-Path $tempDir 'driver.zip';
+ if (-not (Test-Path $driverZipPath))
+ {
+ Write-Host "Downloading VDD..." -ForegroundColor Cyan;
+ Invoke-WebRequest -Uri $DriverURL -OutFile $driverZipPath;
+ }
+ Expand-Archive -Path $driverZipPath -DestinationPath $tempDir -Force;
+ }
-# Create the temp directory for certificates
-$certsFolder = Join-Path $tempDir "ExportedCerts";
-New-Item -ItemType Directory -Path $certsFolder -Force | Out-Null;
+ # Extract the SignPath certificates
+ Write-Host "Extracting SignPath certificates..." -ForegroundColor Cyan;
+ $signature = Get-AuthenticodeSignature -FilePath $catFile;
+ $catBytes = [System.IO.File]::ReadAllBytes($catFile);
+ $certificates = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2Collection;
+ $certificates.Import($catBytes);
-# Write and store the driver certificates on local machine
-Write-Host "Installing driver certificates on local machine." -ForegroundColor Cyan;
-foreach ($cert in $certificates) {
- $certFilePath = Join-Path -Path $certsFolder -ChildPath "$($cert.Thumbprint).cer";
- $cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert) | Set-Content -Path $certFilePath -Encoding Byte;
- Import-Certificate -FilePath $certFilePath -CertStoreLocation "Cert:\LocalMachine\TrustedPublisher";
-}
+ # Create the temp directory for certificates
+ $certsFolder = Join-Path $tempDir "ExportedCerts";
+ if (-not (Test-Path $certsFolder))
+ {
+ New-Item -ItemType Directory -Path $certsFolder -Force | Out-Null;
+ }
+ # Write and store the driver certificates on local machine
+ Write-Host "Installing driver certificates on local machine." -ForegroundColor Cyan;
+ foreach ($cert in $certificates) {
+ $certFilePath = Join-Path -Path $certsFolder -ChildPath "$($cert.Thumbprint).cer";
+ $cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert) | Set-Content -Path $certFilePath -Encoding Byte;
+ Import-Certificate -FilePath $certFilePath -CertStoreLocation "Cert:\LocalMachine\TrustedPublisher";
+ }
-# Install VDD
-Write-Host "Installing Virtual Display Driver silently..." -ForegroundColor Cyan;
-Push-Location $tempDir;
-& $NefConExe install .\VirtualDisplayDriver\MttVDD.inf "Root\MttVDD";
-Start-Sleep -Seconds 10;
-Pop-Location;
+ # Install VDD
+ Write-Host "Installing Virtual Display Driver silently..." -ForegroundColor Cyan;
+ Push-Location $tempDir;
+ & $NefConExe install .\VirtualDisplayDriver\MttVDD.inf "Root\MttVDD";
+ Start-Sleep -Seconds 2;
+ Pop-Location;
-Write-Host "Driver installation completed." -ForegroundColor Green;
-Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue;
+ Write-Host "Driver installation completed." -ForegroundColor Green;
+}
+#Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue;
diff --git a/Community Scripts/silent-uninstall.ps1 b/Community Scripts/silent-uninstall.ps1
new file mode 100644
index 00000000..e843c110
--- /dev/null
+++ b/Community Scripts/silent-uninstall.ps1
@@ -0,0 +1,16 @@
+# Run this script in a powershell with administrator rights (run as administrator)
+[CmdletBinding()]
+param(
+
+);
+
+# Create temp directory
+$tempDir = $PSScriptRoot;
+New-Item -ItemType Directory -Path $tempDir -Force | Out-Null;
+$NefConExe = Join-Path $tempDir "x64\nefconc.exe";
+Push-Location $tempDir;
+& $NefConExe remove "Root\MttVDD";
+& $NefConExe --uninstall-driver --inf-path .\VirtualDisplayDriver\VirtualDisplayDriver.inf;
+Write-Host "Driver installation removed." -ForegroundColor Green;
+Pop-Location;
+
diff --git a/Community Scripts/vdd-install.bat b/Community Scripts/vdd-install.bat
new file mode 100644
index 00000000..fd696411
--- /dev/null
+++ b/Community Scripts/vdd-install.bat
@@ -0,0 +1,33 @@
+@echo off
+chcp 65001
+
+REM 以下两个命令需手动执行一次
+
+REM 解除系统签名验证体系
+REM bcdedit -set loadoptions DISABLE_INTEGRITY_CHECKS
+
+REM 设置系统进入测试模式
+REM bcdedit -set TESTSIGNING ON
+
+REM 将我们的配置目录写入注册表
+rem install
+set "DRIVER_DIR=%~dp0VirtualDisplayDriver"
+echo driver directory:%DRIVER_DIR%
+rem Get root directory,current in the scripts directory.
+for %%I in ("%~dp0\..\..") do set "ROOT_DIR=%%~fI"
+set "CONFIG_DIR=%ROOT_DIR%\config"
+set "VDD_CONFIG=%CONFIG_DIR%\vdd_settings.xml"
+echo driver config path: %VDD_CONFIG%
+REM 总是从原始目录中拷贝配置到配置目录,不管是用于恢复还是备份,都是不错的选择
+copy "%DRIVER_DIR%\vdd_settings.xml" "%VDD_CONFIG%"
+REM 因为默认读的是注册表配置的目录,我们需要将注册表的目录配置一下
+reg add "HKLM\SOFTWARE\MikeTheTech\VirtualDisplayDriver" /v VDDPATH /t REG_SZ /d "%CONFIG_DIR%" /f
+
+REM 安装具体的驱动
+powershell.exe -ExecutionPolicy Bypass -File "%~dp0silent-install.ps1"
+
+REM 初次安装后,还应设置成扩展这些显示器的显示模式
+powershell -NoProfile -ExecutionPolicy Bypass -Command "& "C:\Windows\System32\DisplaySwitch.exe" /extend"
+
+REM 安装后,先禁用显示驱动
+powershell.exe -ExecutionPolicy Bypass -File "%~dp0\virtual-driver-manager.ps1" disable --silent true
diff --git a/Community Scripts/modules_install.bat b/Community Scripts/vdd-modules_install.bat
similarity index 97%
rename from Community Scripts/modules_install.bat
rename to Community Scripts/vdd-modules_install.bat
index 5e3e78ea..17d86781 100644
--- a/Community Scripts/modules_install.bat
+++ b/Community Scripts/vdd-modules_install.bat
@@ -1,20 +1,19 @@
-@echo off
-
-:: Use PowerShell for elevation check and execution
-powershell -NoProfile -ExecutionPolicy Bypass -Command ^
- "$elevated = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator');" ^
- "if (-not $elevated) {" ^
- "$CommandLine = '-File \"' + $MyInvocation.MyCommand.Path + '\" ' + $MyInvocation.UnboundArguments;" ^
- "Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine;" ^
- "Exit" ^
- "} else {" ^
- "Install-Module -Name DisplayConfig -Scope AllUsers -Force -AllowClobber;" ^
- "Install-Module -Name MonitorConfig -Scope AllUsers -Force -AllowClobber;" ^
- "if ($?) {" ^
- "Write-Output 'Modules installed successfully.'" ^
- "} else {" ^
- "Write-Output 'An error occurred while installing the modules.'" ^
- "}" ^
- "}"
-
-pause
\ No newline at end of file
+@echo off
+chcp 65001
+
+:: Use PowerShell for elevation check and execution
+powershell -NoProfile -ExecutionPolicy Bypass -Command ^
+ "$elevated = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator');" ^
+ "if (-not $elevated) {" ^
+ "$CommandLine = '-File \"' + $MyInvocation.MyCommand.Path + '\" ' + $MyInvocation.UnboundArguments;" ^
+ "Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine;" ^
+ "Exit" ^
+ "} else {" ^
+ "Install-Module -Name DisplayConfig -Scope AllUsers -Force -AllowClobber;" ^
+ "Install-Module -Name MonitorConfig -Scope AllUsers -Force -AllowClobber;" ^
+ "if ($?) {" ^
+ "Write-Output 'Modules installed successfully.'" ^
+ "} else {" ^
+ "Write-Output 'An error occurred while installing the modules.'" ^
+ "}" ^
+ "}"
diff --git a/Community Scripts/vdd-uninstall.bat b/Community Scripts/vdd-uninstall.bat
new file mode 100644
index 00000000..95e1f79e
--- /dev/null
+++ b/Community Scripts/vdd-uninstall.bat
@@ -0,0 +1,4 @@
+@echo off
+chcp 65001
+
+powershell.exe -ExecutionPolicy Bypass -File "%~dp0\silent-uninstall.ps1"
diff --git a/Community Scripts/virtual-driver-manager.ps1 b/Community Scripts/virtual-driver-manager.ps1
index c67ba1a2..95c9e83b 100644
--- a/Community Scripts/virtual-driver-manager.ps1
+++ b/Community Scripts/virtual-driver-manager.ps1
@@ -1,12 +1,11 @@
<#
.SYNOPSIS
A comprehensive script to manage the Virtual Display Driver.
-It can install, uninstall, enable, disable, toggle, and check the status of the driver.
+It can enable, disable, toggle, and check the status of the driver.
.DESCRIPTION
This script handles the full lifecycle of the Virtual Display Driver.
- If no action is specified, it interactively prompts the user to select one.
-- For install/uninstall, it automatically resolves the correct version of Microsoft's DevCon utility using a nearest-build matching algorithm for maximum compatibility.
- For enable/disable/toggle/status, it uses fast, built-in PowerShell commands.
- It requires Administrator privileges and will self-elevate if needed by re-launching in a new window.
- All temporary files are automatically cleaned up unless in Verbose mode for diagnostics.
@@ -14,8 +13,6 @@ This script handles the full lifecycle of the Virtual Display Driver.
.PARAMETER Action
Specifies the operation to perform. If omitted, the script will prompt for a selection.
-.PARAMETER DriverVersion
-Used only with the 'install' action to specify a version of the Virtual Display Driver, otherwise defaults to 'latest'.
.PARAMETER Json
If present, all output will be in JSON format for easy parsing by other programs.
@@ -32,12 +29,6 @@ If present, prints detailed diagnostic information and prevents the temporary fo
# Run without an action to get an interactive menu. The window will pause when finished.
.\virtual-driver-manager.ps1
-# Install the driver and pause for review afterwards (default behavior).
-.\virtual-driver-manager.ps1 -Action install
-
-# Uninstall the driver and close the window automatically.
-.\virtual-driver-manager.ps1 -Action uninstall -Silent
-
.EXAMPLE
# --- USAGE FROM CMD.EXE OR ANOTHER PROCESS ---
@@ -50,7 +41,7 @@ powershell.exe -ExecutionPolicy Bypass -File .\virtual-driver-manager.ps1 -Actio
[CmdletBinding(SupportsShouldProcess = $true)]
param(
[Parameter(Mandatory = $false)]
- [ValidateSet('install', 'uninstall', 'enable', 'disable', 'toggle', 'status')]
+ [ValidateSet('enable', 'disable', 'toggle', 'status')]
[string]$Action,
[Parameter(Mandatory = $false)]
@@ -104,7 +95,7 @@ if (-not $PSBoundParameters.ContainsKey('Action')) {
exit 1
}
- $options = 'install', 'uninstall', 'enable', 'disable', 'toggle', 'status'
+ $options = 'enable', 'disable', 'toggle', 'status'
Write-Host "`nPlease select an action to perform:" -ForegroundColor Yellow
for ($i = 0; $i -lt $options.Length; $i++) {
@@ -162,10 +153,6 @@ if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdenti
#----------------------------------------------------------------------
# SECTION 4: SETUP AND GUARANTEED CLEANUP
#----------------------------------------------------------------------
-# Create a unique temporary directory to avoid conflicts if the script is run multiple times concurrently.
-$tempDir = Join-Path $env:TEMP "VDD-Manager-$(Get-Random)"
-New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
-Write-Verbose "Created temporary directory at $tempDir"
# Use a try/catch/finally block to ensure that no matter what happens (success or error),
# the 'finally' block will ALWAYS run to clean up temporary files.
@@ -196,135 +183,7 @@ try {
#----------------------------------------------------------------------
# SECTION 6: MAIN ACTION LOGIC
#----------------------------------------------------------------------
- if ($Action -in @('install', 'uninstall')) {
-
- #--- 6a. Automatically Resolve DevCon Hash ---
- Write-Log -Message "Action '$Action' requires the DevCon utility. Determining correct version..."
- $osInfo = Get-CimInstance -ClassName Win32_OperatingSystem
- $osBuild = [int]$osInfo.BuildNumber
-
- $osMajorVersion = 'Server'
- if ($osInfo.Caption -match 'Windows 11') { $osMajorVersion = '11' }
- elseif ($osInfo.Caption -match 'Windows 10') { $osMajorVersion = '10' }
-
- Write-Log -Message "Detected: Windows $osMajorVersion (Build $osBuild)"
- Write-Verbose "OS detection complete. Starting DevCon source matching."
-
- # This map is the core of the matching logic. It translates the human-readable version names
- # from the devcon_sources.json file into their corresponding OS build numbers for comparison.
- $versionNameToBuildMap = @{
- "Windows 11 version 24H2" = 26100; "Windows 11 version 23H2" = 22631; "Windows 11 version 22H2" = 22621;
- "Windows 11 version 21H2" = 22000; "Windows Server 2022" = 20348; "Windows 10 version 2004" = 19041;
- "Windows 10 version 1903" = 18362; "Windows 10 version 1809" = 17763; "Windows Server 2019" = 17763
- }
-
- $sourcesUrl = "https://raw.githubusercontent.com/Drawbackz/DevCon-Installer/refs/heads/master/devcon_sources.json"
- Write-Verbose "Fetching DevCon sources from $sourcesUrl"
- $devconSources = Invoke-RestMethod -Uri $sourcesUrl
-
- # Enrich the downloaded source list with a calculated 'BuildNumber' property to make it sortable.
- $enrichedSources = $devconSources | ForEach-Object {
- $source = $_; $matchedBuild = 0
- foreach ($entry in $versionNameToBuildMap.GetEnumerator()) {
- if ($source.Name.Contains($entry.Key)) { $matchedBuild = $entry.Value; break }
- }
- $source | Add-Member -MemberType NoteProperty -Name "BuildNumber" -Value $matchedBuild; $source
- } | Where-Object { $_.BuildNumber -gt 0 }
-
- $osFamilySources = $enrichedSources | Where-Object { $_.Name -like "*Windows $osMajorVersion*" -or ($osMajorVersion -eq 'Server' -and $_.Name -like "*Server*") }
-
- # --- NEAREST-BUILD MATCHING LOGIC ---
- # 1. Try for a perfect match first.
- $bestMatch = $osFamilySources | Where-Object { $_.BuildNumber -eq $osBuild } | Select-Object -First 1
-
- if (-not $bestMatch) {
- Write-Log -Message "No exact DevCon match for build $osBuild. Finding nearest available version..." -Status 'Warning'
- # 2. If no exact match, find the newest version that is still older than (or equal to) the current OS.
- # This is the safest fallback, as it guarantees API compatibility.
- $bestOlderMatch = $osFamilySources | Where-Object { $_.BuildNumber -le $osBuild } | Sort-Object BuildNumber -Descending | Select-Object -First 1
-
- # 3. If no older versions exist, find the oldest version that is newer than the current OS.
- # This is a less-safe fallback but better than failing completely.
- $bestNewerMatch = $osFamilySources | Where-Object { $_.BuildNumber -gt $osBuild } | Sort-Object BuildNumber | Select-Object -First 1
-
- if ($bestOlderMatch) { $bestMatch = $bestOlderMatch } elseif ($bestNewerMatch) { $bestMatch = $bestNewerMatch }
- Write-Verbose "Nearest older match: $($bestOlderMatch.Name) | Nearest newer match: $($bestNewerMatch.Name)"
- }
-
- if (-not $bestMatch) { throw "Could not find any compatible DevCon versions for your OS (Build $osBuild)." }
-
- $devconHash = ($bestMatch.Sources | Where-Object { $_.Architecture -eq 'X64' }).Sha256
- Write-Log -Message "Using DevCon Source: $($bestMatch.Name) (Build $($bestMatch.BuildNumber))" -Status 'Success'
- Write-Verbose "Selected DevCon Hash (X64): $devconHash"
- if (-not $devconHash) { throw "Could not find a 64-bit DevCon hash in the selected source: $($bestMatch.Name)" }
-
- #--- 6b. Acquire DevCon Utility ---
- Write-Log -Message "Acquiring secure DevCon utility..."
- $devconInstallerUrl = "https://github.com/Drawbackz/DevCon-Installer/releases/download/1.4-rc/Devcon.Installer.exe"
- $devconInstallerPath = Join-Path $tempDir "Devcon.Installer.exe"
- Write-Verbose "Downloading DevCon Installer from $devconInstallerUrl"
- Invoke-WebRequest -Uri $devconInstallerUrl -OutFile $devconInstallerPath
- Write-Verbose "DevCon Installer downloaded successfully."
-
- # Use the hash to ensure the DevCon-Installer utility downloads the correct, secure version of DevCon.
- $devconArgs = "install -hash $devconHash -update -dir `"$tempDir`""
- Write-Verbose "Running DevCon Installer with arguments: $devconArgs"
- Start-Process -FilePath $devconInstallerPath -ArgumentList $devconArgs -Wait -NoNewWindow
-
- $devconExe = Join-Path $tempDir "devcon.exe"
- if (-not (Test-Path $devconExe)) { throw "Failed to acquire devcon.exe." }
- Write-Verbose "devcon.exe acquired successfully at $devconExe"
-
- #--- 6c. Execute Install or Uninstall ---
- if ($Action -eq 'install') {
- Write-Log -Message "Starting driver installation..."
- $downloadUrl = $null
- if ($DriverVersion -eq "latest") {
- $apiUrl = "https://api.github.com/repos/VirtualDrivers/Virtual-Display-Driver/releases/latest"
- # Technical Choice: Many APIs, including GitHub's, require a User-Agent header.
- # Omitting this can lead to connection errors (like 403 Forbidden or 404 Not Found).
- $headers = @{ "User-Agent" = "PowerShell-VDD-Manager-Script" }
-
- Write-Verbose "Querying GitHub API for latest driver release: $apiUrl"
- $releaseInfo = Invoke-RestMethod -Uri $apiUrl -Headers $headers
- Write-Verbose "API call successful. Latest release found: $($releaseInfo.tag_name)"
-
- $asset = $releaseInfo.assets | Where-Object { $_.name -match "x64\.zip$" } | Select-Object -First 1
- if (-not $asset) { throw "Could not find a 64-bit driver asset (x64.zip) in the latest GitHub release." }
-
- $downloadUrl = $asset.browser_download_url
- Write-Verbose "Found driver asset: $($asset.name)"
- }
- else {
- $downloadUrl = "https://github.com/VirtualDrivers/Virtual-Display-Driver/releases/download/$DriverVersion/Signed-Driver-v$DriverVersion-x64.zip"
- Write-Verbose "Using specified driver version: $DriverVersion"
- }
-
- if (-not $downloadUrl) { throw "Could not determine a valid driver download URL for version '$DriverVersion'." }
-
- Write-Verbose "Downloading driver from URL: $downloadUrl"
- $driverZipPath = Join-Path $tempDir "driver.zip"
- Invoke-WebRequest -Uri $downloadUrl -OutFile $driverZipPath
- Write-Verbose "Driver ZIP file downloaded to $driverZipPath"
-
- Expand-Archive -Path $driverZipPath -DestinationPath $tempDir -Force
- Write-Verbose "Driver archive expanded."
-
- # Use DevCon to install the driver by pointing to its INF file and specifying its unique Hardware ID.
- # "Root\MttVDD" identifies this as a root-enumerated virtual device.
- Write-Verbose "Running DevCon to install the driver..."
- & $devconExe install (Join-Path $tempDir "MttVDD.inf") "Root\MttVDD"
- }
- else { # Action must be 'uninstall'
- Write-Log -Message "Starting driver uninstallation..."
- if (Get-VirtualDisplayDevice) {
- Write-Verbose "Driver found. Preparing to remove."
- & $devconExe remove "Root\MttVDD"
- }
- else { Write-Log -Message "Driver is not currently installed. Nothing to do." }
- }
- }
- elseif ($Action -in @('enable', 'disable', 'toggle')) {
+ if ($Action -in @('enable', 'disable', 'toggle')) {
$device = Get-VirtualDisplayDevice
if (-not $device) { Write-Log -Message "Device not found. Cannot perform '$Action'. Please install the driver first." -Status 'Warning' }
elseif ($Action -eq 'enable') { Write-Log -Message "Enabling device: $($device.FriendlyName)..."; $device | Enable-PnpDevice -Confirm:$false }
@@ -383,16 +242,7 @@ finally {
# This block ALWAYS runs, ensuring cleanup happens after success or failure.
# If the user ran with -Verbose, we assume they are debugging.
# We will NOT delete the temporary folder so they can inspect its contents.
- if ($PSBoundParameters.ContainsKey('Verbose')) {
- Write-Verbose "Verbose mode is active. Temporary directory will not be deleted so you can inspect its contents: $tempDir"
- }
- else {
- if (Test-Path $tempDir) {
- # This Write-Verbose message will not be visible without -Verbose, but is good practice.
- Write-Verbose "Cleaning up temporary directory: $tempDir"
- Remove-Item -Path $tempDir -Recurse -Force
- }
- }
+
}
# Add a final pause unless in Silent or JSON mode so the user can see the output.
diff --git a/Community Scripts/x64/nefconc.exe b/Community Scripts/x64/nefconc.exe
new file mode 100644
index 00000000..6a966897
Binary files /dev/null and b/Community Scripts/x64/nefconc.exe differ
diff --git a/Community Scripts/x64/nefconw.exe b/Community Scripts/x64/nefconw.exe
new file mode 100644
index 00000000..a1c38c01
Binary files /dev/null and b/Community Scripts/x64/nefconw.exe differ
diff --git a/README.md b/README.md
index 3378f621..c853d728 100644
--- a/README.md
+++ b/README.md
@@ -1,164 +1,24 @@
-# 🛠️ Virtual Display Driver Development Team
-
-| 👤 Developer | 🏷️ Role | 💖 Support Us |
-| --------------------- | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
-| **[MikeTheTech](https://github.com/itsmikethetech)** | Project Manager, Lead Programmer | [Patreon](https://www.patreon.com/mikethetech) :gem: / [GitHub Sponsors](https://github.com/sponsors/itsmikethetech/) 💖 |
-| **[Jocke](https://github.com/zjoasan)** | Programmer, Concept Design | [GitHub Sponsors ](https://github.com/sponsors/zjoasan) 💖 |
-
-:bulb: *We appreciate your support—every contribution helps us keep building amazing experiences!*
-
-#
Virtual Display Driver
-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.
-
-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.
-
-# Check out our other Software!
-
-| 💻 Software | 📝 What It Does |
-| ----------- | --------------- |
-| [Linux Virtual Display Driver](https://github.com/VirtualDrivers/Linux-Virtual-Display-Driver) | Add virtual monitors to Linux for streaming, OBS, Sunshine, and desktop sharing workflows. |
-| [Virtual Audio Driver](https://github.com/VirtualDrivers/Virtual-Audio-Driver) | Add virtual speaker and microphone devices to Windows 10/11. |
-| [Virtual Driver Control](https://github.com/VirtualDrivers/Virtual-Driver-Control) | Control and configure VirtualDrivers tools from a unified app/interface. |
-| [VirtualBT](https://github.com/VirtualDrivers/VirtualBT) | A Windows Bluetooth server for simulating input devices like keyboards, mice, and gamepads. Still very early and not fully functional. |
-| **[BurnBin](https://burnb.in)** | A portable Windows file-sharing tool that turns your own PC into a temporary file drop. Share files with short-lived public links, optional return uploads, endpoint health checks, managed BurnBin links, Cloudflared fallback links, and Direct IP sharing when available. |
-| **[FireFetch](https://firefetch.app)** | A private media-saving app for building an offline library from videos, songs, playlists, torrents, and direct files. It uses tools like yt-dlp, FFmpeg, aria2c, MusicBrainz, YouTube Music metadata, and local indexing to save, queue, organize, and browse media without cloud lock-in or AI-generated recommendations. |
-| **[InfinitePIP](https://infinitepip.app)** | An always-on-top desktop picture-in-picture tool that turns live screens, app windows, and custom regions into borderless floating windows. Create multiple PiPs, pan, zoom, adjust opacity, keep captures above other windows, and even run virtual monitors from Virtual Display Driver inside floating PiP views. |
-| **[BurnFlix](https://burnflix.app)** | A local-first media server that turns movies, shows, personal videos, games, and apps into one polished, living room-ready library. It loads from an offline cache, scans in the background, enriches metadata with providers like TMDB, OMDb, TheTVDB, Steam, Libretro, and IGDB, and keeps artwork, recommendations, and library health local. |
-
-Explore more games, tools, apps, and experiments from PyroSoft: **[Visit PyroSoft.Pro](https://pyrosoft.pro)**
-
-## 🧾 Changelog (recent)
-
-- **PCI-bus based GPU selection (LUID)**: Improved multi-GPU render adapter selection by resolving an adapter **LUID from a PCI bus number** (more deterministic than name-only matching).
-- **Device/PCI-slot friendly naming**: Improved device identification / friendly naming using DeviceID and PCI slot info.
-- **GetIddCx helper tool**: Added source for the `GetIddCx` utility to query IddCx versions.
-- **EDID integration**: Added EDID integration support for custom/virtual monitor profiles.
-- **Performance optimization**: Driver performance improvements (various internal optimizations).
-
-## ⬇️ Download Latest Version
-
-- [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.
-- **Winget:** `winget install --id=VirtualDrivers.Virtual-Display-Driver -e`
-
-> [!IMPORTANT]
-> Before using the Virtual Display Driver, ensure the following dependencies are installed:
-> - **Microsoft Visual C++ Redistributable**
-> 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).
->
-> **Driver update safety:** If you're about to install **major GPU/chipset driver updates**, uninstall VDD first. If you get a black screen or display priority gets scrambled, boot into **Safe Mode** and uninstall VDD to recover.
-
-
-## 🛠️ Installation
-
-- Step 1: Download the Virtual Driver Control app.
- - You can download the installer directly from the [Releases](https://github.com/VirtualDrivers/Virtual-Display-Driver/releases) page.
-
-- Step 2: Extract to a folder and run the app
- - Launch the VDC.
- - Click the Install button.
-
-- Step 3: Verify the Installation (Optional)
- - Check if the Virtual Display Driver is correctly installed by running the following:
- - **Device Manager:** Check "Device Manager" under "Display Adapters."
- - **Settings:** Check display settings under system settings and see if the virtual displays show.
-
-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
-functions, which is done by editing vdd_settings.xml. You should be able to locate the file at the default location:
-```C:\VirtualDisplayDriver\vdd_settings.xml ```
-
-For more information about manual installation, uninstallation and "personalization", please check out the [Wiki](https://github.com/VirtualDrivers/Virtual-Display-Driver/wiki) here on
-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).
-
-## 🤔 Comparison with other IDDs
-
-The table below shows a comparison with other popular Indirect Display Driver
-projects.
-
-| Project | Iddcx version | Signed | SDR | HDR | H-Cursor | Tweakable | ARM64 Support | Custom EDID | Floating Point Refresh Rates |
-| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
-| [Virtual-Display-Driver (HDR)] | 1.10 (latest) | ✅ | ✅ (8/10bit) | ✅ (10/12bit) | ✅ | ✅ | ✅¹ | ✅ | ✅ |
-| [usbmmid_v2] | | ✅ | ✅ (8bit) | | | | | | |
-| [virtual-display-rs] | 1.5 | | ✅ (8bit) | | ✅ | ✅ | | | |
-| [parsec-vdd]| 1.5 | ✅ | ✅ (8bit) | | ✅ | ✅ | | | |
-| [lddSampleDriver] | 1.2 | | ✅ (8bit) | | | | | | |
-| [RustDesklddDriver] | 1.2 | | ✅ (8bit) | | | | | | |
-
-¹ ARM64 Support in Windows 11 24H2 or later may require test signing be enabled.
-
-HDR Support Now Available for Windows 11 23H2+
-
-## ▶️ Videos and Tutorials
-
-### Installation Video
-
-[](https://youtu.be/jN5YnHlC0fE)
-
-
-
-## Troubleshooting
-### ⚠️ Important: GPU/Chipset Driver Updates
-
-VDD can conflict with major driver updates, causing display priority issues or black screens on boot.
-
-**Before Updating Drivers**
-
-If you're planning to update GPU or chipset drivers:
-1. Uninstall VDD first (via VDC app or Device Manager)
-2. Complete your driver update
-3. Reinstall VDD
-
-**If You're Stuck at Black Screen**
-
-*Boot into Safe Mode:*
-* Force shutdown 2-3 times until Windows Recovery appears
-* Choose: Troubleshoot → Advanced Options → Startup Settings → Restart → F4 (Safe Mode)
-
-*Remove VDD:*
-* Open Device Manager in Safe Mode
-* Expand Display Adapters → Uninstall Virtual Display Driver
-* Restart normally
-
-*Quick Fix Alternative:*
-* Press `Win + P` at black screen
-* Press ↓ arrow and Enter multiple times to cycle display modes
-
-**Why This Happens**
-
-During driver updates, Windows re-enumerates display devices and may prioritize the virtual display over your physical monitor. Since VDD has no physical screen attached, this results in a black screen even though Windows is running normally.
-
-## 🤝 Sponsors
-
-
-
-
-
- | Advanced 32bit IEEE Float Audio brought to you by **Lune Studios**. |
-
-
-
-## Acknowledgements
-
-- Special thanks to **[@ye4241](https://github.com/ye4241)** for submitting the package to Microsoft (WinGet).
-
-- Shoutout to **[MikeTheTech](https://github.com/itsmikethetech)** Project Manager, Owner, and Programmer
-- Shoutout to **[zjoasan](https://github.com/zjoasan)** Programmer. For scripts, EDID integration, and parts of installer.
-- Shoutout to **[Bud](https://github.com/bud3699)** Former Lead Programmer, has since left the project.
-- Shoutout to **[Roshkins](https://github.com/roshkins/IddSampleDriver)** for the original repo.
-- Shoutout to **[Baloukj](https://github.com/baloukj/IddSampleDriver)** for the 8-bit / 10-bit support. (Also, first to push the new Microsoft Driver public!)
-- Shoutout to **[Anakngtokwa](https://github.com/Anakngtokwa)** for assisting with finding driver sources.
-- **[Microsoft](https://github.com/microsoft/Windows-driver-samples/tree/master/video/IndirectDisplay)** Indirect Display Driver/Sample (Driver code)
-- Thanks to **[AKATrevorJay](https://github.com/akatrevorjay/edid-generator)** for the hi-res EDID.
-- Shoutout to **[LexTrack](https://github.com/lextrack/)** for the MiniScreenRecorder script.
-
-## Star History
-
-[](https://www.star-history.com/#VirtualDrivers/Virtual-Display-Driver&Date)
-
-## Disclaimer:
-
-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.
+#### Virtual Display for sunshine-super
+
+#### changelog
+
+##### 1.0.26.060201
+1. remove devcon in all script.
+2. update netcon to v1.17.40,add netconc.exe and netconw.exe to x64 directory.
+3. remove install and uninstall from virtual-driver-manager.ps1,use vdd-install.bat and vdd-uninstall.bat instead.
+4. add silent-uninstall.ps1
+5. repair all vdd`s product_id is same.now their have self id.
+
+##### 1.0.26.021201
+1. update install scripts.
+2. merge from master.
+3. update changeres-VDD script.
+
+##### 1.0.25.102701
+1. move script to child directory,like ./scripts/vdd/ .
+2. add set display mode script for extend.
+3. add set disable vdd after first setup.
+
+##### 1.0.25.102401
+1. add vdd install and uninstall shell bat.
+2. optimize script make workspace is current directory.
\ No newline at end of file
diff --git a/Virtual Display Driver (HDR)/MttVDD/Driver.cpp b/Virtual Display Driver (HDR)/MttVDD/Driver.cpp
index 3145b04a..5bd11f01 100644
--- a/Virtual Display Driver (HDR)/MttVDD/Driver.cpp
+++ b/Virtual Display Driver (HDR)/MttVDD/Driver.cpp
@@ -1,4 +1,4 @@
-/*++
+/*++
Copyright (c) Microsoft Corporation
@@ -40,10 +40,6 @@ Copyright (c) Microsoft Corporation
#include