Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ef8e434
1. add vdd install and uninstall shell bat.
DeleteElf Oct 24, 2025
43c5ac0
1. add vdd install and uninstall shell bat.
DeleteElf Oct 27, 2025
97749b4
1. repair file coding
DeleteElf Feb 12, 2026
3a7ec5e
Merge remote-tracking branch 'origin/master' into dev-master
DeleteElf Feb 12, 2026
92a0d65
1. update install scripts.
DeleteElf Feb 12, 2026
baa5a58
1. update install scripts.
DeleteElf Feb 12, 2026
2e1af84
Merge remote-tracking branch 'origin/master'
DeleteElf Feb 12, 2026
e3a74ce
Merge remote-tracking branch 'origin/dev-master'
DeleteElf Feb 12, 2026
80ebe28
1. revert README.md
DeleteElf Feb 12, 2026
eff5a72
1. revert
DeleteElf Feb 13, 2026
f5087d6
Merge branch 'VirtualDrivers:master' into master
DeleteElf May 28, 2026
1b68aa2
1. 虚拟驱动管理去掉了安装和卸载逻辑
DeleteElf Jun 2, 2026
8ad24b3
1. 全面去掉了devcon的支持。
DeleteElf Jun 2, 2026
20bb945
1. 内置了对应版本的netcon
DeleteElf Jun 2, 2026
eba5a8a
1. 修复错误
DeleteElf Jun 2, 2026
f1efc3a
1. 去掉多余的空行
DeleteElf Jun 2, 2026
a64ac93
Merge remote-tracking branch 'origin/dev-master'
DeleteElf Jun 3, 2026
1344be4
1. update changelog
DeleteElf Jun 3, 2026
0450688
Merge remote-tracking branch 'origin/dev-master'
DeleteElf Jun 3, 2026
7fddd66
1. 修正虚拟显示器每个产品型号都一样的问题
DeleteElf Jun 3, 2026
7bc1ff6
1. 修正虚拟显示器每个产品型号都一样的问题
DeleteElf Jun 3, 2026
5aed11a
1. 去掉没用的解决方案文件
DeleteElf Jun 23, 2026
4580ee9
1. 优化虚拟显示器
DeleteElf Jun 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Community Scripts/SetAutoLogin.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@echo off
chcp 65001

REM 设置允许自动登录
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device" /v DevicePasswordLessBuildVersion /t REG_DWORD /d "0" /f

echo 在打开的窗口中 取消勾选‌ “要使用本机,用户必须输入用户名和密码” 选项 ,并点击 "应用"。

echo 系统会弹出“自动登录”窗口,输入你当前账户的‌完整密码‌(如果是微软账户,请输入邮箱绑定的密码,而非PIN码),然后点击 ‌“确定”‌。

echo 正在准备进入设置界面...

pause

netplwiz

pause
9 changes: 6 additions & 3 deletions Community Scripts/changeres-VDD.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Set-DisplayResolution -DisplayId $displayId -Width $xres -Height $yres
5 changes: 5 additions & 0 deletions Community Scripts/set-dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down
101 changes: 63 additions & 38 deletions Community Scripts/silent-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,80 @@
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)]
[string]$DriverURL = "https://github.com/VirtualDrivers/Virtual-Display-Driver/releases/download/25.7.23/VirtualDisplayDriver-x86.Driver.Only.zip"
);

# 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 "VirtualDisplayDriver";
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 "MttVdd.cer";
$cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert) | Set-Content -Path $certFilePath -Encoding Byte;
Import-Certificate -FilePath $certFilePath -CertStoreLocation "Cert:\LocalMachine\Root";
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;
16 changes: 16 additions & 0 deletions Community Scripts/silent-uninstall.ps1
Original file line number Diff line number Diff line change
@@ -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\MttVDD.inf;
Write-Host "Driver installation removed." -ForegroundColor Green;
Pop-Location;

32 changes: 32 additions & 0 deletions Community Scripts/vdd-install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@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"

echo "虚拟显示器安装完成"
Original file line number Diff line number Diff line change
@@ -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
@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.'" ^
"}" ^
"}"
4 changes: 4 additions & 0 deletions Community Scripts/vdd-uninstall.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off
chcp 65001

powershell.exe -ExecutionPolicy Bypass -File "%~dp0\silent-uninstall.ps1"
Loading