Been searching around and only found a couple examples of something similar.
This is a simple app update that if the currently installed version (typically 3.0.27) is older than the newer version (3.2.8.1), it installs, otherwise the script exits with the “You’re all up to date” message.
This was the latest try, which came from another post on here, I just tweaked it for the app I’m working with.
The issue is that I can’t get it to just exit with the ‘all good’ msg, and stop the install/script. Not sure how to get it to both show the msg AND exit. Doing it inside the psadt because in order to update the app it and Outlook have to be closed, and i’d rather do it this way than wait/hope the user reboots.
After reading it again, i realized I don’t need to pop up a message stating they are up to date. if I can get it to just exit after it checks the version that’d be great.
So something like this, if worked would be perfect.
It most definitely is. I did do testing on if it read the correct registry entry and it seemed to work but I can always update the code for sure. This was a ‘hack’ job with deadlines and such so if it walked like a duck I figured it was a duck. And it quacked too! lol
## Check file version and proceed, Close Outlook and Xink, and persist the prompt
$XinkVersion = (get-item 'C:\Program Files (x86)\Xink\Xink Client AD\emsclient.exe').VersionInfo.FileVersion
if($XinkVersion -gt 3.2.8){
Exit 0
}
else {
## Show Welcome Message, close Xink if required, and persist the prompt
Show-InstallationWelcome -CloseApps 'outlook,emsclient' -PersistPrompt
}