if ($process.ExitCode -eq 0) Write-Host "Installation completed successfully." -ForegroundColor Green # Optional: log the installation "$(Get-Date) - Installation successful" else Write-Host "Installation failed with exit code: $($process.ExitCode)" -ForegroundColor Red "$(Get-Date) - Installation failed with exit code: $($process.ExitCode)" catch Write-Host "Installation error: $_" -ForegroundColor Red exit 1

Write-Host "Installing Access Database Engine silently (this may take a minute)..." -ForegroundColor Yellow

Write-Host "Access Database Engine not found. Starting download..." -ForegroundColor Yellow try $webClient = New-Object System.Net.WebClient $webClient.DownloadFile($downloadUrl, $tempPath) Write-Host "Download completed: $tempPath" -ForegroundColor Green

return $false Write-Host "Checking if Access Database Engine is already installed..." -ForegroundColor Cyan if (Test-ACEDriverInstalled) Write-Host "Access Database Engine appears to be already installed. Skipping installation." -ForegroundColor Green exit 0