Skip to content

Commit 18987b1

Browse files
authored
Merge pull request #202 from janparttimaa/master
Adobe Acrobat Uninstallation Script and Adobe Acrobat Policy Enforcers (Machine & User Level).
2 parents b75d11b + e4244cc commit 18987b1

File tree

7 files changed

+987
-3
lines changed

7 files changed

+987
-3
lines changed

macOS/Apps/AdobeAcrobatReaderDC/readme.md renamed to macOS/Apps/Adobe Acrobat & Adobe Acrobat Reader/README.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
1-
# Adobe Acrobat Installation Script
1+
# Adobe Acrobat & Adobe Acrobat Reader
2+
3+
In this folder we provide you few following script examples of Adobe Acrobat & Adobe Acrobat Reader:
4+
5+
| Type | File | Notes |
6+
| -------- | ------- | ------- |
7+
| Installation script | ```installAcrobatDC.sh```<br> or <br> ```installAcrobatDC.zsh``` | <ul><li>Installation script is provided either sh (Bourne Shell) script or zsh (Z Shell) script.<li> Check more information [here](#installation-script).</li></ul> |
8+
| Uninstallation script | ```UninstallAdobeAcrobat.zsh``` | <ul><li> Suitable for separate uninstallation deployment via [script](https://learn.microsoft.com/en-us/intune/intune-service/apps/macos-shell-scripts) or as [pre-installation script](https://learn.microsoft.com/en-us/intune/intune-service/apps/macos-unmanaged-pkg) when installing company deployed Adobe Acrobat as PKG-package.<li>Check more information [here](#uninstallation-script).</li></ul> |
9+
10+
## Installation Script
211

312
This script is an example to show how to use [Intune Shell Scripting](https://docs.microsoft.com/en-us/mem/intune/apps/macos-shell-scripts) to install applications. In this case the script will download the Adobe Acrobat DC DMG file from the Adobe download servers and then install it onto the Mac.
413

5-
## Script Settings
14+
### Script Settings
615

716
- Run script as signed-in user : No
817
- Hide script notifications on devices : Not configured
918
- Script frequency : Not configured
1019
- Number of times to retry if script fails : 3
1120

12-
## Log File
21+
### Log File
1322

1423
The log file will output to ***/Library/Logs/Microsoft/IntuneScripts/Adobe Acrobat Reader DC/Adobe Acrobat Reader DC.log*** by default. Exit status is either 0 or 1. To gather this log with Intune remotely take a look at [Troubleshoot macOS shell script policies using log collection](https://docs.microsoft.com/en-us/mem/intune/apps/macos-shell-scripts#troubleshoot-macos-shell-script-policies-using-log-collection)
1524

@@ -53,3 +62,40 @@ Wed 5 Jan 2022 17:28:33 GMT | Fixing up permissions
5362
Wed 5 Jan 2022 17:28:34 GMT | Application [Adobe Acrobat Reader DC] succesfully installed
5463
Wed 5 Jan 2022 17:28:34 GMT | Writing last modifieddate [Mon, 10 May 2021 07:25:20 GMT] to [/Library/Logs/Microsoft/IntuneScripts/Adobe Acrobat Reader DC/Adobe Acrobat Reader DC.meta]
5564
```
65+
## Uninstallation Script
66+
67+
> [!NOTE]
68+
> This uninstallation script is suitable for separate uninstallation deployment via [script](https://learn.microsoft.com/en-us/intune/intune-service/apps/macos-shell-scripts) or as [pre-installation script](https://learn.microsoft.com/en-us/intune/intune-service/apps/macos-unmanaged-pkg) when installing company deployed Adobe Acrobat as PKG-package.
69+
70+
This uninstallation script uninstalls following Adobe Acrobat versions from the Mac-device if one of these versions are installed:
71+
72+
- Adobe Acrobat Reader 2020.
73+
- Adobe Acrobat 2020.
74+
- Adobe Acrobat Classic / Adobe Acrobat Reader Classic.
75+
- Adobe Acrobat DC / Adobe Acrobat Reader DC.
76+
77+
### Script Settings
78+
79+
- Run script as signed-in user : No
80+
- Hide script notifications on devices : Yes
81+
- Script frequency : Not configured
82+
- Number of times to retry if script fails : 3
83+
84+
### Log File
85+
86+
The log file will output to ***/Library/Logs/Microsoft/IntuneScripts/UninstallAdobeAcrobatAndAdobeAcrobatReader/UninstallAdobeAcrobatAndAdobeAcrobatReader.log*** by default. Exit status is either 0 or 1. To gather this log with Intune remotely take a look at [Troubleshoot macOS shell script policies using log collection](https://docs.microsoft.com/en-us/mem/intune/apps/macos-shell-scripts#troubleshoot-macos-shell-script-policies-using-log-collection)
87+
```
88+
Fri Jun 20 19:15:10 EEST 2025 | Creating log directory - /Library/Logs/Microsoft/IntuneScripts/UninstallAdobeAcrobatAndAdobeAcrobatReader
89+
90+
##############################################################
91+
# Fri Jun 20 19:15:10 EEST 2025 | Starting running of script UninstallAdobeAcrobatAndAdobeAcrobatReader
92+
############################################################
93+
94+
Fri Jun 20 19:15:10 EEST 2025 | Adobe Acrobat Reader 2020 is not installed. Let's proceed...
95+
Fri Jun 20 19:15:10 EEST 2025 | Adobe Acrobat / Adobe Acrobat Reader 2020 is not installed. Let's proceed...
96+
Fri Jun 20 19:15:10 EEST 2025 | Adobe Acrobat / Adobe Acrobat Reader Classic is not installed. Let's proceed...
97+
Fri Jun 20 19:15:10 EEST 2025 | Adobe Acrobat / Adobe Acrobat Reader DC is installed. Making sure, that application is closed...
98+
Fri Jun 20 19:15:21 EEST 2025 | Done. Uninstalling Adobe Acrobat / Adobe Acrobat Reader DC...
99+
Fri Jun 20 19:15:53 EEST 2025 | Adobe Acrobat / Adobe Acrobat Reader DC successfully uninstalled. You can now install it back if needed. Closing script...
100+
101+
```
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
#!/bin/zsh
2+
#set -x
3+
############################################################################################
4+
##
5+
## Script to uninstall Adobe Acrobat / Adobe Acrobat Reader 2020, Classic and DC
6+
##
7+
############################################################################################
8+
9+
## Copyright (c) 2025 Microsoft Corp. All rights reserved.
10+
## Scripts are not supported under any Microsoft standard support program or service. The scripts are provided AS IS without warranty of any kind.
11+
## Microsoft disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a
12+
## particular purpose. The entire risk arising out of the use or performance of the scripts and documentation remains with you. In no event shall
13+
## Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever
14+
## (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary
15+
## loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility
16+
## of such damages.
17+
## Feedback: neiljohn@microsoft.com
18+
19+
# Define variables
20+
appname="UninstallAdobeAcrobatAndAdobeAcrobatReader" # The name of our file deployment script
21+
logandmetadir="/Library/Logs/Microsoft/IntuneScripts/$appname" # The location of our logs and last updated data
22+
acrobatreader2020installationpath="/Applications/Adobe Acrobat Reader 2020.app" # The first location where Adobe Acrobat Reader 2020 is installed
23+
adobeacrobat2020installationpath="/Applications/Adobe Acrobat 2020/Adobe Acrobat.app" # The second location where Adobe Acrobat / Adobe Acrobat Reader 2020 is installed
24+
adobeacrobatclassicinstallationpath="/Applications/Adobe Acrobat Classic/Adobe Acrobat.app" # The second location where Adobe Acrobat / Adobe Acrobat Reader Classic is installed
25+
adobeacrobatdcinstallationpath="/Applications/Adobe Acrobat DC/Adobe Acrobat.app" # The location where Adobe Acrobat / Adobe Acrobat Reader DC is installed
26+
log="$logandmetadir/$appname.log" # The location of the script log file
27+
# The location of Acrobat Uninstaller for Adobe Acrobat / Adobe Acrobat Reader 2020
28+
acrobat2020uninstaller="/Applications/Adobe Acrobat 2020/Adobe Acrobat.app/Contents/Helpers/Acrobat Uninstaller.app/Contents/Library/LaunchServices/com.adobe.Acrobat.RemoverTool"
29+
# The location of Acrobat Uninstaller for Adobe Acrobat / Adobe Acrobat Reader Classic
30+
acrobatclassicuninstaller="/Applications/Adobe Acrobat Classic/Adobe Acrobat.app/Contents/Helpers/Acrobat Uninstaller.app/Contents/Library/LaunchServices/com.adobe.Acrobat.RemoverTool"
31+
# The location of Acrobat Uninstaller for Adobe Acrobat / Adobe Acrobat Reader DC
32+
acrobatdcuninstaller="/Applications/Adobe Acrobat DC/Adobe Acrobat.app/Contents/Helpers/Acrobat Uninstaller.app/Contents/Library/LaunchServices/com.adobe.Acrobat.RemoverTool"
33+
34+
# Check if the log directory has been created
35+
if [ -d $logandmetadir ]; then
36+
# Already created
37+
echo "$(date) | Log directory already exists - $logandmetadir"
38+
else
39+
# Creating Metadirectory
40+
echo "$(date) | Creating log directory - $logandmetadir"
41+
mkdir -p $logandmetadir
42+
fi
43+
44+
# Check if Adobe Acrobat Reader 2020 is already installed
45+
CheckIfAcrobatReader2020IsInstalled() {
46+
if [ -d $acrobatreader2020installationpath ]; then
47+
# If Adobe Acrobat Reader 2020 is installed, inform this and uninstall the application
48+
echo "$(date) | Adobe Acrobat Reader 2020 is installed. Making sure, that application is closed..."
49+
osascript -e 'tell application "Adobe Acrobat Reader 2020" to quit' >/dev/null 2>&1
50+
killall "AdobeReader" >/dev/null 2>&1
51+
sleep 10
52+
echo "$(date) | Done. Uninstalling Adobe Acrobat Reader 2020..."
53+
rm -rf "$acrobatreader2020installationpath" >/dev/null 2>&1
54+
sleep 30
55+
if ! [ -e "$acrobatreader2020installationpath" ]; then
56+
echo "$(date) | Adobe Acrobat Reader 2020 successfully uninstalled. Let's proceed..."
57+
fi
58+
else
59+
# If Adobe Acrobat Reader 2020 is not installed, inform this and continue
60+
echo "$(date) | Adobe Acrobat Reader 2020 is not installed. Let's proceed..."
61+
fi
62+
}
63+
64+
# Check if Adobe Acrobat / Adobe Acrobat Reader 2020 is already installed
65+
CheckIfAcrobat2020IsInstalled() {
66+
if [ -d $adobeacrobat2020installationpath ]; then
67+
# If Adobe Acrobat / Adobe Acrobat Reader 2020 is installed, inform this and uninstall the application
68+
echo "$(date) | Adobe Acrobat / Adobe Acrobat Reader 2020 is installed. Making sure, that application is closed..."
69+
osascript -e 'tell application "Adobe Acrobat" to quit' >/dev/null 2>&1
70+
killall "AdobeAcrobat" >/dev/null 2>&1
71+
sleep 10
72+
echo "$(date) | Done. Uninstalling Adobe Acrobat / Adobe Acrobat Reader 2020..."
73+
$acrobat2020uninstaller Uninstall $adobeacrobat2020installationpath > /dev/null 2>&1
74+
sleep 30
75+
if ! [ -e "$adobeacrobat2020installationpath" ]; then
76+
echo "$(date) | Adobe Acrobat / Adobe Acrobat Reader 2020 successfully uninstalled. Let's proceed..."
77+
fi
78+
else
79+
# If Adobe Acrobat / Adobe Acrobat Reader 2020 is not installed, inform this and continue
80+
echo "$(date) | Adobe Acrobat / Adobe Acrobat Reader 2020 is not installed. Let's proceed..."
81+
fi
82+
}
83+
84+
# Check if Adobe Acrobat / Adobe Acrobat Reader Classic is already installed
85+
CheckIfAcrobatClassicIsInstalled() {
86+
if [ -d $adobeacrobatclassicinstallationpath ]; then
87+
# If Adobe Acrobat / Adobe Acrobat Reader Classic is installed, inform this and uninstall the application
88+
echo "$(date) | Adobe Acrobat / Adobe Acrobat Reader Classic is installed. Making sure, that application is closed..."
89+
osascript -e 'tell application "Adobe Acrobat" to quit' >/dev/null 2>&1
90+
killall "AdobeAcrobat" >/dev/null 2>&1
91+
sleep 10
92+
echo "$(date) | Done. Uninstalling Adobe Acrobat / Adobe Acrobat Reader Classic..."
93+
$acrobatclassicuninstaller Uninstall $adobeacrobatclassicinstallationpath > /dev/null 2>&1
94+
sleep 30
95+
if ! [ -e "$adobeacrobatclassicinstallationpath" ]; then
96+
echo "$(date) | Adobe Acrobat / Adobe Acrobat Reader Classic successfully uninstalled. Let's proceed..."
97+
fi
98+
else
99+
# If Adobe Acrobat / Adobe Acrobat Reader Classic is not installed, inform this and continue
100+
echo "$(date) | Adobe Acrobat / Adobe Acrobat Reader Classic is not installed. Let's proceed..."
101+
fi
102+
}
103+
104+
# Check if Adobe Acrobat / Adobe Acrobat Reader DC is already installed
105+
CheckIfAcrobatDCIsInstalled() {
106+
if [ -d $adobeacrobatdcinstallationpath ]; then
107+
# If Adobe Acrobat / Adobe Acrobat Reader DC is installed, inform this and uninstall the application
108+
echo "$(date) | Adobe Acrobat / Adobe Acrobat Reader DC is installed. Making sure, that application is closed..."
109+
osascript -e 'tell application "Adobe Acrobat" to quit' >/dev/null 2>&1
110+
killall "AdobeAcrobat" >/dev/null 2>&1
111+
sleep 10
112+
echo "$(date) | Done. Uninstalling Adobe Acrobat / Adobe Acrobat Reader DC..."
113+
$acrobatdcuninstaller Uninstall $adobeacrobatdcinstallationpath > /dev/null 2>&1
114+
sleep 30
115+
if ! [ -e "$adobeacrobatdcinstallationpath" ]; then
116+
echo "$(date) | Adobe Acrobat / Adobe Acrobat Reader DC successfully uninstalled. You can now install it back if needed. Closing script..."
117+
exit 0
118+
fi
119+
else
120+
# If Adobe Acrobat / Adobe Acrobat Reader DC is not installed, inform this and continue
121+
echo "$(date) | Adobe Acrobat / Adobe Acrobat Reader DC is not installed. You can now install it if needed. Closing script..."
122+
exit 0
123+
fi
124+
}
125+
126+
# Start logging
127+
exec &> >(tee -a "$log")
128+
129+
# Begin Script Body
130+
echo ""
131+
echo "##############################################################"
132+
echo "# $(date) | Starting running of script $appname"
133+
echo "############################################################"
134+
echo ""
135+
136+
# Run function
137+
CheckIfAcrobatReader2020IsInstalled
138+
CheckIfAcrobat2020IsInstalled
139+
CheckIfAcrobatClassicIsInstalled
140+
CheckIfAcrobatDCIsInstalled

0 commit comments

Comments
 (0)