Hi All,
Process:
I need to uninstall the old driver and install the new one.
If I install the new, it pops up saying I need to uninstall the old first
If I try to uninstall, it pops up saying that it’ll require a reboot and do I want to continue.
I’ve tried numerous switches like /S, /silent, -force, etc…
I’m looking to see if anyone has done this or knows how to do this. All my attempts fail do to a popup during the uninstall. If I run the below script it just hangs and tries to continue to run, because I assume it’s waiting for a response from the popup.
Any pointers appreciated. There a number of machines needing the update, otherwise I’d just do it manually.
#Look for and obtain uninstall string for Synaptic
$Synaptic = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall |
Get-ItemProperty |
Where-Object {$_.DisplayName -like “Synaptics Pointing Device*” } |
Select-Object -Property DisplayName, DisplayVersion, UninstallString
#Perform an uninstall first.
ForEach ($Syn in $Synaptic) {
If ($Syn.UninstallString) {
$uninst = $Syn.UninstallString
$uninst = $uninst.Replace('{',' ').Replace('}',' ')
Try
{
$Null = Invoke-Expression $uninst -ArgumentList '/S' -ErrorAction Stop
}
Catch
{
Write-Error "Uninstall failed because... The error is: $($_.Exception.Message)"
Exit 1
}
}
}
#Perform the install of the new version
Try {
$Null = Start-Process sp81892.exe -ArgumentList ‘/S’ -ErrorAction Stop
}
Catch {
Write-Error “Install failed because… The error is: $($_.Exception.Message)”
Exit 1
}
Exit 0