change app tracking from int to bool
This commit is contained in:
+3
-3
@@ -25,7 +25,7 @@ Foreach ( $reg in $UNINSTALL_KEYS ) {
|
||||
$MODIFYPATH = $REG_PROPERTY.ModifyPath
|
||||
|
||||
# Track whether an app was uninstalled or not
|
||||
$PRODUCTUNINSTALLED = 0
|
||||
$PRODUCTUNINSTALLED = $false
|
||||
|
||||
# Make sure the DisplayName matches what we're looking for
|
||||
If ( $DISPLAY_NAME -ilike $APP_NAME ) {
|
||||
@@ -41,7 +41,7 @@ Foreach ( $reg in $UNINSTALL_KEYS ) {
|
||||
If ( $PRODUCT_CODE ) {
|
||||
LogMsg "Uninstalling ${DISPLAY_NAME} ${PRODUCT_CODE}"
|
||||
$arguments = '/X{' + $PRODUCT_CODE + '} /qn /norestart'
|
||||
Try { Start-Process -FilePath "msiexec.exe" -ArgumentList $arguments -Wait ; $PRODUCTUNINSTALLED++ }
|
||||
Try { Start-Process -FilePath "msiexec.exe" -ArgumentList $arguments -Wait ; $PRODUCTUNINSTALLED = $true }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
}
|
||||
@@ -49,5 +49,5 @@ Foreach ( $reg in $UNINSTALL_KEYS ) {
|
||||
LogMsg "Cannot uninstall ""${DISPLAY_NAME}""`n UninstallString: ${UNINSTALLSTRING}"
|
||||
}
|
||||
}
|
||||
If ( $PRODUCTUNINSTALLED -gt 0 ) { LogMsg "No product matching ${APP_NAME} was found"}
|
||||
If ( $PRODUCTUNINSTALLED -eq $false ) { LogMsg "No product matching ${APP_NAME} was found"}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user