|
1 | 1 | #!/bin/bash
|
2 | 2 |
|
3 |
| -# osxapp_vers 1.7 |
| 3 | +# osxapp_vers 1.8 |
4 | 4 | # Get product name, product version and build version of [Mac] OS X
|
5 | 5 | # from "Install*OS X*.app", "Install macOS *.app" or "Mac OS X install DVD"
|
6 | 6 | #
|
@@ -122,32 +122,50 @@ else
|
122 | 122 | fi
|
123 | 123 |
|
124 | 124 | if [ -f "$APPNAME/Contents/SharedSupport/BaseSystem.dmg" ]; then
|
125 |
| - # Starting with High Sierra ... |
126 |
| - # Mount the BaseSystem.dmg |
| 125 | + # Starting with High Sierra (>= 10.13) |
127 | 126 | hdiutil attach "$APPNAME/Contents/SharedSupport/BaseSystem.dmg" \
|
128 | 127 | -noverify -nobrowse -mountpoint /Volumes/BaseSystem.$$ &> $DEBUG
|
129 |
| - else |
130 |
| - # Anything earlier then High Sierra ... |
131 |
| - # Mount the InstallESD.dmg |
| 128 | + |
| 129 | + CONTCODE=1 |
| 130 | + |
| 131 | + elif [ -f "$APPNAME/Contents/SharedSupport/InstallESD.dmg" ]; then |
| 132 | + # Anything earlier then High Sierra (< 10.13) ... |
132 | 133 | hdiutil attach "$APPNAME/Contents/SharedSupport/InstallESD.dmg" \
|
133 | 134 | -noverify -nobrowse -mountpoint /Volumes/InstallESD.$$ &> $DEBUG
|
134 | 135 |
|
135 |
| - # Mount the BaseSystem.dmg |
136 | 136 | hdiutil attach "/Volumes/InstallESD.$$/BaseSystem.dmg" \
|
137 | 137 | -noverify -nobrowse -mountpoint /Volumes/BaseSystem.$$ &> $DEBUG
|
| 138 | + |
| 139 | + CONTCODE=2 |
| 140 | + |
| 141 | + elif [ -f "/macOS Install Data/BaseSystem.dmg" ]; then |
| 142 | + printf "INFO: this an install stub and the install stub was running.\n" |
| 143 | + # BaseSystem.dmg location is different if we have an install stub and |
| 144 | + # the install stub was running |
| 145 | + hdiutil attach "/macOS Install Data/BaseSystem.dmg" \ |
| 146 | + -noverify -nobrowse -mountpoint /Volumes/BaseSystem.$$ &> $DEBUG |
| 147 | + |
| 148 | + CONTCODE=1 |
| 149 | + |
| 150 | + else |
| 151 | + printf "ERROR: this seems to be an install stub only, run it in order to download the required files.\n" |
| 152 | + CONTCODE=0 |
| 153 | + |
138 | 154 | fi
|
139 | 155 |
|
140 | 156 | # call sw_vers in the changed root environment
|
141 | 157 | # sudo chroot "/Volumes/BaseSystem.$$" /usr/bin/sw_vers
|
142 | 158 |
|
143 |
| - # Read the xml and print info |
144 |
| - print_xml_info "/Volumes/BaseSystem.$$/System/Library/CoreServices/SystemVersion.plist" |
| 159 | + if [ $CONTCODE -gt 0 ]; then |
| 160 | + # Read the xml and print info |
| 161 | + print_xml_info "/Volumes/BaseSystem.$$/System/Library/CoreServices/SystemVersion.plist" |
145 | 162 |
|
146 |
| - # Unmount again in reverse order |
147 |
| - hdiutil detach "/Volumes/BaseSystem.$$" &> $DEBUG |
| 163 | + # Unmount again in reverse order |
| 164 | + hdiutil detach "/Volumes/BaseSystem.$$" &> $DEBUG |
148 | 165 |
|
149 |
| - if [ "$OSNAME" != "Mojave" -a "$OSNAME" != "High Sierra" ]; then |
150 |
| - hdiutil detach "/Volumes/InstallESD.$$" &> $DEBUG |
| 166 | + if [ $CONTCODE -gt 1 ]; then |
| 167 | + hdiutil detach "/Volumes/InstallESD.$$" &> $DEBUG |
| 168 | + fi |
151 | 169 | fi
|
152 | 170 | fi
|
153 | 171 | done
|
|
0 commit comments