Chocolatey will install CPU and GPU drivers separately

main
LeDragoX 4 years ago committed by Plínio Larrubia
parent 297027e036
commit 8cc559e248
No known key found for this signature in database
GPG Key ID: 057B0A87CB137C69

@ -8,43 +8,51 @@ function CheckOSArchitecture {
Write-Host "64-bits OS detected!"
$Architecture = "64-bits"
} else {
Write-Host "Couldn't identify the System Architecture. :/"
$Architecture = "ARCH_NOT_FOUND (ARM?)"
break
Write-Host "ARCH_NOT_FOUND (ARM?) ... Couldn't identify the System Architecture. :/"
}
# Note that $Architecture is not Global
Write-Host "Architecture = $Architecture"
return $Architecture
}
# Function to detect the current CPU
function DetectCPU() {
# https://community.spiceworks.com/how_to/170332-how-to-get-cpu-information-in-windows-powershell
$Global:CPU = Get-WmiObject -Class Win32_Processor -ComputerName. | Select-Object -Property [a-z]*
if ($CPU.Name.contains("AMD") -or $CPU.Name.contains("Radeon")) {
Write-Host "AMD CPU found!"
} elseif ($CPU.Name.contains("Intel")) {
Write-Host "Intel CPU found!"
} else {
Write-Host "CPU_NOT_FOUND (NEW/CONFIDENTIAL?)"
}
Write-Host "CPU =" $CPU.Name
return $CPU.Name
}
# Function to detect the current GPU
function DetectVideoCard() {
$Global:GPU
function DetectGPU() {
# https://community.spiceworks.com/topic/1543645-powershell-get-wmiobject-win32_videocontroller-multiple-graphics-cards
$ArrComputers = "."
foreach ($Computer in $ArrComputers) {
$ComputerVideo = Get-WmiObject Win32_VideoController -ComputerName $Computer
Write-Host "Video Info: " $ComputerVideo.description
$Global:GPU = $ComputerVideo.description
$Global:GPU = Get-WmiObject -Class Win32_VideoController -ComputerName $Computer
Write-Host "Video Info:" $Global:GPU.description
}
if ($GPU.contains("AMD") -or $GPU.contains("Radeon")) {
if ($GPU.description.contains("AMD") -or $GPU.description.contains("Radeon")) {
Write-Host "AMD GPU found!"
$GPU = "AMD"
} elseif ($GPU.contains("Intel")) {
} elseif ($GPU.description.contains("Intel")) {
Write-Host "Intel GPU found!"
$GPU = "Intel"
} elseif ($GPU.contains("NVIDIA")) {
} elseif ($GPU.description.contains("NVIDIA")) {
Write-Host "NVIDIA GPU found!"
$GPU = "NVIDIA"
} else {
Write-Host "GPU_NOT_FOUND (NEW/CONFIDENTIAL?)"
$GPU = "GPU_NOT_FOUND (NEW/CONFIDENTIAL?)"
}
# Note that $GPU is not Global
Write-Host "GPU = $GPU"
return $GPU
Write-Host "GPU =" $GPU.description
return $GPU.description
}

@ -61,29 +61,38 @@ function InstallChocolatey {
function InstallPackages {
# Install GPU drivers first
BeautyTitleTemplate -Text "Installing Graphics driver"
if ($GPU.contains("AMD")) {
# Install CPU drivers first
if ($CPU.contains("AMD")) {
BeautySectionTemplate -Text "Installing AMD drivers!"
BeautySectionTemplate -Text "Installing AMD chipset drivers!"
Write-Host "Unfortunately, Chocolatey doesn't have a package for AMD"
} elseif ($GPU.contains("Intel")) {
BeautySectionTemplate -Text "Installing Intel drivers!"
} elseif ($CPU.contains("Intel")) {
BeautySectionTemplate -Text "Installing Intel chipset drivers!"
choco install "chocolatey-misc-helpers.extension" -y # intel-dsa Dependency
choco install "dotnet4.7" -y # intel-dsa Dependency
choco install "intel-dsa" -y # Intel® Driver & Support Assistant (Intel® DSA)
#choco install "intel-graphics-driver" -y # Intel Graphics Driver (latest)
}
# Install GPU drivers then
if ($GPU.contains("AMD") -or $GPU.contains("Radeon")) {
BeautyTitleTemplate -Text "AMD GPU, yay! (Doing nothing)"
}
if ($GPU.contains("Intel")) {
BeautySectionTemplate -Text "Installing Intel Graphics driver!"
choco install "intel-graphics-driver" -y # Intel Graphics Driver (latest)
}
} elseif ($GPU.contains("NVIDIA")) {
if ($GPU.contains("NVIDIA")) {
BeautySectionTemplate -Text "Installing NVIDIA drivers!"
choco install "geforce-experience" -y # GeForce Experience (latest)
BeautySectionTemplate -Text "Installing NVIDIA Graphics driver!"
choco install "geforce-experience" -y # GeForce Experience (latest)
choco feature enable -n=useRememberedArgumentsForUpgrades
cinst geforce-game-ready-driver --package-parameters="'/dch'"
#choco install "geforce-game-ready-driver" -y # GeForce Game Ready Driver (latest)
choco install "geforce-game-ready-driver" -y # GeForce Game Ready Driver (latest)
}
@ -132,7 +141,9 @@ function InstallPackages {
$Ask = "Do you plan to play Games on this Machine?
All important Gaming clients and Required Game Softwares to Run Games will be installed.
+ Discord included."
+ Discord
+ Parsec
+ Steam"
function InstallGamingPackages { # You Choose
switch (ShowQuestion -Title "Read carefully" -Message $Ask) {
@ -180,8 +191,9 @@ QuickPrivilegesElevation # Check admin rights
PrepareRun # Import modules from lib folder
UnrestrictPermissions # Unlock script usage
SetupConsoleStyle # Make the Console looks how i want
$Architecture = CheckOSArchitecture # Checks if the System is 32-bits or 64-bits or Something Else
$GPU = DetectVideoCard # Detects the current GPU
$Architecture = CheckOSArchitecture # Checks if the System is 32-bits or 64-bits or Something Else
$CPU = DetectCPU # Detects the current CPU
$GPU = DetectGPU # Detects the current GPU
InstallChocolatey # Install Chocolatey on Powershell
InstallPackages # Install the Showed Softwares
InstallGamingPackages # Install the most important Gaming Clients and Required Softwares to Run Games

Loading…
Cancel
Save