Check if another application is installed

Hello all,
I am packaging oracle full client and it works good.
We do have another version of oracle in environment. I need to add to check installed applications on the machien and if it has previous version i need to exit.
How can i do that
Thanks in advance.

regards

have you looked at the Get-InstalledApplication function in PSADT ?

yes, trying to know how i can loop it

Something like this?

[Array]$AllApps = Get-InstalledApplication -Name 'Oracle'
ForEach ($App in $AllApps) { 
   If ($App.DisplayVersion -le 10.0) {
		Write-log "Old Version found. Exiting"
		Exit-Script
   }
}

Thanks alot, What if i need to check any version is installed?

May be…

[Array]$AllApps = Get-InstalledApplication -Name 'Oracle Client*' -Wildcards
If ($AllApps) {
	Write-log "Old Version found. Exiting"
	Exit-Script
}

To check what is possible, search the function name “Get-InstalledApplication” in “AppDeployToolkitMain.ps1”, do not edit the file!
Some questions were answered by the help file.