Hi All,
I am just starting to use this amazing tool and getting more in depth into powershell. I am trying to deploy an application with the script, which works perfectly.
What I am trying to accomplish is try add an IF statement to beginning of the script, to check if the particular application and version are installed. If installed, I would like the script to exit as success. If not installed, to proceed as normal.
Thank you in advance!
I am trying something along the lines of what is shown below but not getting much luck. Any help is appreciated.
If ($deploymentType -ine ‘Uninstall’) {
##===============================================
## PRE-INSTALLATION
##*===============================================
[string]$installPhase = ‘Pre-Installation’
$regpath = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FDC50EB2-30B3-43C7-984A-B631FED09570}"
$testpath = test-path $regpath
if ($testpath -eq $true){
Exit-Script -ExitCode $mainExitCode
}
else{
## Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, verify there is enough disk space to complete the install, and persist the prompt
Show-InstallationWelcome -CloseApps 'iexplorer' -AllowDefer -DeferTimes 3 -CheckDiskSpace -PersistPrompt -CustomText
## Show Progress Message (with the default message)
Show-InstallationProgress -StatusMessage "Installation in Progress. Please wait..." }