Skip to content

Commit

Permalink
Add AdobeReaderDC.pkg.recipe; change AdobeReaderDC.install.recipe so …
Browse files Browse the repository at this point in the history
…AdobeReaderDC.pkg.recipe is its parent; update AdobeReaderRepackager.py to make changes to AcroRdrDC_FOO_.pkg equivilent to those we made to Adobe Reader (non DC).pkg
  • Loading branch information
gregneagle committed Apr 24, 2015
1 parent b1c3dbf commit e1b806f
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 11 deletions.
7 changes: 1 addition & 6 deletions AdobeReader/AdobeReaderDC.install.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,12 @@
<key>MinimumVersion</key>
<string>0.4.0</string>
<key>ParentRecipe</key>
<string>com.github.autopkg.download.AdobeReaderDC</string>
<string>com.github.autopkg.pkg.AdobeReaderDC</string>
<key>Process</key>
<array>
<dict>
<key>Processor</key>
<string>Installer</string>
<key>Arguments</key>
<dict>
<key>pkg_path</key>
<string>%pathname%/*.pkg</string>
</dict>
</dict>
</array>
</dict>
Expand Down
38 changes: 38 additions & 0 deletions AdobeReader/AdobeReaderDC.pkg.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Description</key>
<string>Downloads the current Adobe Acrobat Reader DC pkg and repackages, replacing a problematic preinstall script,
and enabling installation on non-boot volumes.</string>
<key>Identifier</key>
<string>com.github.autopkg.pkg.AdobeReaderDC</string>
<key>Input</key>
<dict>
<key>LANGUAGE</key>
<string>English</string>
<key>MAJOR_VERSION</key>
<string>AcrobatDC</string>
<key>OS_VERSION</key>
<string>10.9.0</string>
<key>NAME</key>
<string>AdobeReaderDC</string>
</dict>
<key>MinimumVersion</key>
<string>0.4.0</string>
<key>ParentRecipe</key>
<string>com.github.autopkg.download.AdobeReaderDC</string>
<key>Process</key>
<array>
<dict>
<key>Processor</key>
<string>AdobeReaderRepackager</string>
<key>Arguments</key>
<dict>
<key>dmg_path</key>
<string>%pathname%</string>
</dict>
</dict>
</array>
</dict>
</plist>
22 changes: 17 additions & 5 deletions AdobeReader/AdobeReaderRepackager.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,30 @@ def modify_distribution(self, expanded_pkg):

def replace_app_preinstall(self, expanded_pkg):
'''Replace the preinstall script in application.pkg with our own'''
pkg_name = os.path.basename(expanded_pkg)
app_pkg = os.path.join(expanded_pkg, "application.pkg")
if not os.path.exists(app_pkg):
raise ProcessorError("application.pkg not found!")
preinstall_script = os.path.join(app_pkg, "Scripts/preinstall")
our_script = os.path.join(
os.path.dirname(__file__),
"package_resources/scripts/preinstall")
if pkg_name.startswith("AcroRdrDC"):
our_script = os.path.join(
os.path.dirname(__file__),
"package_resources/scripts/readerdc_preinstall")
else:
our_script = os.path.join(
os.path.dirname(__file__),
"package_resources/scripts/reader_preinstall")
if not os.path.exists(our_script):
raise ProcessorError("%s not found" % our_script)
try:
os.unlink(preinstall_script)
except (OSError, IOError), err:
raise ProcessorError("%s removing %s" % (err, preinstall_script))
try:
shutil.copy(our_script, preinstall_script)
except (OSError, IOError), err:
raise ProcessorError("%s copying %s" % (err, preinstall_script))
raise ProcessorError(
"%s copying %s to %s" % (err, our_script, preinstall_script))
self.output(
"Replaced pkg preinstall script with our custom script at %s"
% our_script)
Expand All @@ -176,8 +187,9 @@ def main(self):
# unmounted.
try:
pkg = self.find_pkg(mount_point)
pkg_name = os.path.splitext(os.path.basename(pkg))[0]
expand_dir = os.path.join(
self.env["RECIPE_CACHE_DIR"], "AdobeReaderPkg")
self.env["RECIPE_CACHE_DIR"], pkg_name)
modified_pkg = os.path.join(
self.env["RECIPE_CACHE_DIR"], os.path.basename(pkg))
expanded_pkg = self.expand(pkg, expand_dir)
Expand Down
9 changes: 9 additions & 0 deletions AdobeReader/package_resources/scripts/readerdc_preinstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# replacement preinstall script for Adobe Acrobat Reader DC

installation_path=$2
readerApp="Adobe Acrobat Reader DC.app"

if [ -e "$installation_path/$readerApp" ] ; then
/bin/rm -r "$installation_path/$readerApp"
fi

0 comments on commit e1b806f

Please sign in to comment.