DirectX (June 2010): Difference between revisions

From LANCommander
(Created page with "Category:Redistributables {{Redistributable.Scripts.DetectInstall |Name = Install Detection |Description = This script simply looks for the existence of a registry entry indicating that DirectX has probably been installed previously. |RequiresAdmin = False |Contents = <syntaxhighlight lang="powershell" line> $Exists = Test-Path "HKLM:\\SOFTWARE\Microsoft\DirectX" if ($Exists -eq $True) { exit 1; } else { exit 0; } </syntaxhighlight> }} {{Redistributable.Scri...")
 
No edit summary
 
Line 8: Line 8:


if ($Exists -eq $True) {
if ($Exists -eq $True) {
     exit 1;
     $Host.SetShouldExit(1)
} else {
} else {
     exit 0;
     $Host.SetShouldExit(0)
}
}
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 00:13, 30 November 2023

Install Detection

This script simply looks for the existence of a registry entry indicating that DirectX has probably been installed previously.

$Exists = Test-Path "HKLM:\\SOFTWARE\Microsoft\DirectX"

if ($Exists -eq $True) {
    $Host.SetShouldExit(1)
} else {
    $Host.SetShouldExit(0)
}

Install Script

This script installs the DirectX (June 2010) redistributable silently.

Write-Host "Installing DirectX (June 2010) Redistributable..."
Start-Process -FilePath "DXSETUP.exe" -ArgumentList "/silent" -Wait -Passthru
Write-Host "Done!"