Here are sample Powershell scripts that will install or uninstall the software silently after checking if it is already installed. These Powershell scripts could be used as part of a Group Policy Object to automatically install/uninstall the software on domain joined PCs.
Replace "C:\path\to\WyebotSensorPC.exe" with the actual location of your DEX Agent installer.
#Path to installer - replace with your actual file location
$installerPath = "C:\path\to\WyebotSensorPC.exe"
# Unblock the file to prevent the security warning
Unblock-File -Path $installerPath
# Path to check if the program is already installed
$installedExecutable = "C:\Program Files\WyebotInc\WyebotSensorPC\WyebotSensorPC.exe"
# Check if the program is already installed
if (Test-Path $installedExecutable) {
Write-Host "DEX Agent is already installed."
# Run the installer with the /quiet argument
} else {
Write-Host "Installing DEX Agent..."
Start-Process -FilePath $installerPath -ArgumentList "/quiet" -Wait
# Check if the installation was successful
if (Test-Path $installedExecutable) {
Write-Host "Installation completed successfully."
} else {
Write-Host "Installation might have failed. Please check the installation manually."
}
}
Replace "C:\path\to\WyebotSensorPC.exe" with the actual location of your DEX Agent installer.
#Path to installer - replace with your actual file location
$installerPath = "C:\path\to\WyebotSensorPC.exe"
# Unblock the file to prevent the security warning
Unblock-File -Path $installerPath
# Path to check if the program is already installed
$installedExecutable = "C:\Program Files\WyebotInc\WyebotSensorPC\WyebotSensorPC.exe"
# Check if the program is installed
if (Test-Path $installedExecutable) {
# Run the installer with the /uninstall /quiet argument
Write-Host "DEX Agent install found, uninstalling..."
Start-Process -FilePath $installerPath -ArgumentList "/uninstall /quiet" -Wait
# Check if the installation was successful
if (Test-Path $installedExecutable) {
Write-Host "Uninstallation might have failed. Please check manually."
} else {
Write-Host "Succesffuly uninstalled the DEX Agent."
}
} else {
Write-Host "DEX Agent install not found."
}