requirement from vendor:
older version of driver should be removed and then currnet version of driver should be installed and post installation automatically device should go restart without any user intervention.
we tried these scenarios and handled psadt 4.1.8 script for requirement.
Testing Observations:
- The pre-installation script is working as expected.
- All the required pop-ups were displayed as expected. Please find the testing document attached for reference.
- The audio driver installation is working as expected.
- The device rebooted after installation as expected.
- The log status shows success and we were able to verify the updated driver version along with all the required application entry points.
Issue Found: Post reboot ,Software Center initially shows the status “Past due – will be retried.” However, when we click Retry, the installation status changes to Success.
in sccm we already added return codes of 0,3010,2 for success
and below is the script we are using:
[CmdletBinding()]
param
(
# Default is 'Install'.
[Parameter(Mandatory = $false)]
[ValidateSet('Install', 'Uninstall', 'Repair')]
[System.String]$DeploymentType,
# Default is 'Auto'. Don't hard-code this unless required.
[Parameter(Mandatory = $false)]
[ValidateSet('Auto', 'Interactive', 'NonInteractive', 'Silent')]
[System.String]$DeployMode,
[Parameter(Mandatory = $false)]
[System.Management.Automation.SwitchParameter]$SuppressRebootPassThru,
[Parameter(Mandatory = $false)]
[System.Management.Automation.SwitchParameter]$TerminalServerMode,
[Parameter(Mandatory = $false)]
[System.Management.Automation.SwitchParameter]$DisableLogging
)
##================================================
MARK: Variables
##================================================
Zero-Config MSI support is provided when "AppName" is null or empty.
By setting the "AppName" property, Zero-Config MSI will be disabled.
$adtSession = @{
# App variables.
AppVendor = ''
AppName = 'AudioDriver'
AppVersion = ''
AppArch = ''
AppLang = 'MUI'
AppRevision = '01'
AppSuccessExitCodes = @(0)
AppRebootExitCodes = @(1641, 3010)
AppProcessesToClose = @() # Example: @('excel', @{ Name = 'winword'; Description = 'Microsoft Word' })
AppScriptVersion = '1.0.0'
AppScriptDate = '2026-08-10'
AppScriptAuthor = ''
RequireAdmin = $true
# Install Titles (Only set here to override defaults set by the toolkit).
InstallName = ''
InstallTitle = ''
# Script variables.
DeployAppScriptFriendlyName = $MyInvocation.MyCommand.Name
DeployAppScriptParameters = $PSBoundParameters
DeployAppScriptVersion = '4.1.8'
}
function Install-ADTDeployment
{
[CmdletBinding()]
param
(
)
##================================================
## MARK: Pre-Install
##================================================
$adtSession.InstallPhase = "Pre-$($adtSession.DeploymentType)"
$UserLanguage = (Get-UICulture).Name
if ($UserLanguage -like 'ja-*')
{
$WelcomeTitle = $adtSession.AppName
$WelcomeMessage = 'ドライバーを更新する必要があります。インストールを続行する前に、作業内容を保存し、開いているすべてのアプリケーションを終了してください。インストール完了後、追加の警告なしにデバイスが直ちに再起動します。'
$ProgressSubtitle = 'インストール中'
$ProgressMessage = 'インストールを実行しています。作業内容を保存し、開いているすべてのアプリケーションを終了してください。インストール完了後、デバイスは自動的に再起動します。'
$ProgressDetail = 'インストール中はデバイスの電源を切らないでください。'
$CompletionSubtitle = 'インストール完了'
$CompletionMessage = 'インストールが正常に完了しました。デバイスを今すぐ再起動します。'
}
else
{
$WelcomeTitle = $adtSession.AppName
$WelcomeMessage = 'Drivers need to be updated. Please save your work and close all open applications before continuing. After the installation is completed, the device will restart immediately without any further warning.'
$ProgressSubtitle = 'Installation in progress'
$ProgressMessage = 'Installation is in progress. Please save your work and close all open applications. The device will restart automatically after the installation is completed.'
$ProgressDetail = 'Do not turn off the device during installation.'
$CompletionSubtitle = 'Installation completed'
$CompletionMessage = 'Installation completed successfully. Your device will restart now.'
}
Show-ADTInstallationWelcome `
-Title $WelcomeTitle `
-Subtitle $WelcomeMessage `
-AllowDefer `
-DeferTimes 3 `
-DeferRunInterval (New-TimeSpan -Hours 4) `
-PersistPrompt
Show-ADTInstallationProgress `
-Title $WelcomeTitle `
-Subtitle $ProgressSubtitle `
-StatusMessage $ProgressMessage `
-StatusMessageDetail $ProgressDetail
Older version removal####
Remove provisioned Waves MaxxAudio package
Get-AppxProvisionedPackage -Online |
Where-Object { $.DisplayName -like "WavesAudio.MaxxAudio*" } |
ForEach-Object {
try {
$PackageName = $.PackageName
Write-ADTLogEntry -Message "Removing provisioned Waves MaxxAudio package: $PackageName"
Remove-AppxProvisionedPackage -Online -PackageName $PackageName -AllUsers -ErrorAction Stop
Write-ADTLogEntry -Message "Successfully removed provisioned Waves MaxxAudio package: $PackageName"
}
catch {
Write-ADTLogEntry -Message "Failed to remove provisioned Waves MaxxAudio package: $PackageName. Error: $($_.Exception.Message)"
}
}
Remove Waves MaxxAudio package registered for users
Get-AppxPackage -AllUsers -Name "WavesAudio.MaxxAudio*" |
ForEach-Object {
try {
$PackageFullName = $_.PackageFullName
Write-ADTLogEntry -Message "Removing registered Waves MaxxAudio package: $PackageFullName"
Remove-AppxPackage -Package $PackageFullName -AllUsers -ErrorAction Stop
Write-ADTLogEntry -Message "Successfully removed registered Waves MaxxAudio package: $PackageFullName"
}
catch {
Write-ADTLogEntry -Message "Failed to remove registered Waves MaxxAudio package: $PackageFullName. Error: $($_.Exception.Message)"
}
}
#================================================
MARK: Install
#================================================
$adtSession.InstallPhase = $adtSession.DeploymentType
$SupportedModels = @("Latitude 5420")
$DeviceModel = (Get-CimInstance -ClassName Win32_ComputerSystem).Model.Trim()
if ($DeviceModel -in $SupportedModels) {
$InstallerName = "Realtek-High-Definition-Audio-Driver_KG58T_WIN64_6.0.9954.2_A86"
$InstallerPath = "$($adtSession.DirFiles)\5420\$InstallerName.EXE"
$LogDirectory = "$env:ProgramData\AIG\InstallLogs"
$LogFile = Join-Path $LogDirectory "$InstallerName.log"
$RegPath = "HKLM:\SOFTWARE\AIG\Drivers\RealtekAudio"
Write-ADTLogEntry `
-Message "Starting Realtek Audio Driver installation for [$DeviceModel]."
# Ensure vendor log directory exists
if (-not (Test-Path -Path $LogDirectory)) {
New-Item -Path $LogDirectory -ItemType Directory -Force -ErrorAction Stop |
Out-Null
}
# Verify installer exists
if (-not (Test-Path -Path $InstallerPath)) {
throw "Realtek driver installer not found: [$InstallerPath]"
}
# Install driver
Start-ADTProcess `
-FilePath $InstallerPath `
-ArgumentList "/s /l=`"$LogFile`"" `
-SuccessExitCodes @(0, 2, 3010)
Write-ADTLogEntry `
-Message "Realtek Audio Driver installer completed successfully. Vendor log: [$LogFile]"
# Create SCCM detection registry entry
try {
if (-not (Test-Path -Path $RegPath)) {
New-Item `
-Path $RegPath `
-Force `
-ErrorAction Stop |
Out-Null
}
New-ItemProperty `
-Path $RegPath `
-Name "Installer" `
-Value $InstallerName `
-PropertyType String `
-Force `
-ErrorAction Stop |
Out-Null
Write-ADTLogEntry `
-Message "SCCM detection registry entry created successfully. Installer: [$InstallerName]." `
-Severity 1
}
catch {
Write-ADTLogEntry `
-Message "Failed to create SCCM detection registry entry. Error: $($_.Exception.Message)" `
-Severity 3
throw
}
#================================================
# MARK: Post-Install
#================================================
$adtSession.InstallPhase = "Post-$($adtSession.DeploymentType)"
Write-ADTLogEntry `
-Message "Realtek Audio Driver installation completed successfully on [$DeviceModel]. Device is restarting now." `
-Severity 1
# Restart immediately
Restart-Computer -Force
}
else {
Write-ADTLogEntry -Message "Device model [$DeviceModel] is not supported. Realtek Audio Driver installation skipped; no restart will be initiated."
-Severity 2
Close-ADTInstallationProgress
}
}
function Uninstall-ADTDeployment
{
[CmdletBinding()]
param
(
)
detection used:
$RequiredDriverVersion = [version]"6.0.9954.2"
$RequiredInstaller = "Realtek-High-Definition-Audio-Driver_KG58T_WIN64_6.0.9954.2_A86"
$RegistryPath = "HKLM:\SOFTWARE\AIG\Drivers\RealtekAudio"
Check Realtek MEDIA driver version
$Driver = Get-CimInstance -ClassName Win32_PnPSignedDriver -ErrorAction SilentlyContinue |
Where-Object {
$.DriverProviderName -match "Realtek" -and
$.DeviceClass -eq "MEDIA" -and
([version]$_.DriverVersion -ge $RequiredDriverVersion)
}
Check model-specific installer registry value
$Installer = (
Get-ItemProperty -Path $RegistryPath
-Name "Installer" `
-ErrorAction SilentlyContinue
).Installer
Both conditions must match
if ($Driver -and $Installer -eq $RequiredInstaller) {
Write-Output "Installed"
exit 0
}
#exit 1
post installation software center shows like below:
