mirror of
https://github.com/VirtualDrivers/Virtual-Display-Driver.git
synced 2026-10-21 14:12:27 -05:00
Since dep_fix.ps1 seem less then reliable, I've created a bat file that installs the needed powershell modules. It needs admin privs. to install to all users on the machine. I'm planning on running this .bat during the installer in case the user choose to install the scripts. The get_disp_num.ps1 is for those users depending on \\\\.\\DISPLAY number to get the right display for their scripting needs in their "automation"
20 lines
966 B
Batchfile
20 lines
966 B
Batchfile
@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 |