autopkg / foigus-recipes

21 stars 30 forks source link

foigus-recipes/WoodWing/WoodwingSmartConnectionInDesignCC2015.munki.recipe does not work with newest build #25

Closed lukashofstaetter closed 6 years ago

lukashofstaetter commented 6 years ago

hi there with munki it worked for Smart_Connection_for_Adobe_CC_2015_v11.0.2_Build9.dmg and Smart_Connection_for_Adobe_CC_2015_v11.1.0_Build38.dmg. But on with Build Smart_Connection_for_Adobe_CC_2015_v11.2.0_Build42.dmg there are Checksum errors. Is there a way to fix that? Thanks a lot. Sincerely, Lukas

foigus commented 6 years ago

Lukas--a quick note, the checksum failures are intentional. Since Smart Connection's "installer" is a thicket of impenetrable bash, I intentionally have the recipes set to fail when they change the installation scripts (since I replace their scripts). I'll take a look.

lukashofstaetter commented 6 years ago

great! thank you very much!

foigus commented 6 years ago

The big question is how to translate this pile into something that will work in an uninstall_script:

#---------------------------------------------------------------------
# Uninstalls the ZXP extensions

function UninstallZXPExtensions()
{
    USERNAME=`id -un`
    BASENAME=`basename "$0"`
    #BASENAME="${BASENAME/Uninstall }"
    #BASENAME="${BASENAME/DAILY }"
    BASENAME="${BASENAME/.sh}"

    # Get the password from the currect user.
    pw="$(osascript -e 'Tell application "System Events" to display dialog "Please enter the password for '"'"$USERNAME"'"':" default answer "" with hidden answer with title "'"$BASENAME"'"' -e 'text returned of result' 2>/dev/null)" 

    # If the password is emprt (cancel) we stop the uninstaller.
    if [ "$pw" == "" ]; then
        exit 1
    fi

    # Get the path to the ExManCmd tool.
    EXMANPATH=`dirname "${0}"`
    EXMANPATH=`dirname "${EXMANPATH}"`

    # Give all rights to installation paths.
    echo "$pw" | sudo -S chmod -R 777 "$path_only/Plug-Ins/WoodWing"
    echo "$pw" | sudo -S chmod -R 777 "$path_only/Plug-Outs"

    # Uninstall the ZXP extensions.
    echo "$pw" | sudo -S "${EXMANPATH}/ExManCmd/MacOS/ExManCmd" --remove "Sticky Notes"
    echo "$pw" | sudo -S "${EXMANPATH}/ExManCmd/MacOS/ExManCmd" --remove "Smart Caching 2015"

    # If the password was not correct we let the user try again.
    if [ "$?" == "1" ]; then
        UninstallZXPExtensions      
    fi
}
# Uninstall the installed ZXP extensions from Adobe Extension Manager.
UninstallZXPExtensions
foigus commented 6 years ago

Probably something like this (at first blush):

function UninstallZXPExtensions()
{
##  Don't need these variables any more
##  USERNAME=`id -un`
##  BASENAME=`basename "$0"`
##  #BASENAME="${BASENAME/Uninstall }"
##  #BASENAME="${BASENAME/DAILY }"
##  BASENAME="${BASENAME/.sh}"

    # Get the password from the currect user.
##  We're already root, don't need to run this
##  pw="$(osascript -e 'Tell application "System Events" to display dialog "Please enter the password for '"'"$USERNAME"'"':" default answer "" with hidden answer with title "'"$BASENAME"'"' -e 'text returned of result' 2>/dev/null)" 
##
##  # If the password is emprt (cancel) we stop the uninstaller.
##  if [ "$pw" == "" ]; then
##      exit 1
##  fi

    # Get the path to the ExManCmd tool.
##  I reject your reality of EXMANPATH and substitute my own, since "dirname" isn't
##  effective if I'm not running the script from just the right directory.
##  EXMANPATH=`dirname "${0}"`
##  EXMANPATH=`dirname "${EXMANPATH}"`

    # Give all rights to installation paths.
##  We're already root, we don't need additional rights
##  echo "$pw" | sudo -S chmod -R 777 "$path_only/Plug-Ins/WoodWing"
##  echo "$pw" | sudo -S chmod -R 777 "$path_only/Plug-Outs"

    # Uninstall the ZXP extensions.
##  I again reject your reality of EXMANPATH and substitute my own, since "dirname" isn't
##  effective if I'm not running the script from just the right directory.
##  echo "$pw" | sudo -S "${EXMANPATH}/ExManCmd/MacOS/ExManCmd" --remove "Sticky Notes"
##  echo "$pw" | sudo -S "${EXMANPATH}/ExManCmd/MacOS/ExManCmd" --remove "Smart Caching 2015"
    "/Applications/Adobe InDesign CC 2015/Uninstall Smart Connection for Adobe CC 2015 v* Build*.app/Contents/ExManCmd/MacOS/ExManCmd" --remove "Sticky Notes"
    "/Applications/Adobe InDesign CC 2015/Uninstall Smart Connection for Adobe CC 2015 v* Build*.app/Contents/ExManCmd/MacOS/ExManCmd" --remove "Smart Caching 2015"

    # If the password was not correct we let the user try again.
##  Again, we're root--this no longer applies
##  if [ "$?" == "1" ]; then
##      UninstallZXPExtensions      
##  fi
}
# Uninstall the installed ZXP extensions from Adobe Extension Manager.
UninstallZXPExtensions
lukashofstaetter commented 6 years ago

i now can see why it asks for the path where indesign is installed, when i try to add it manually... magic.

foigus commented 6 years ago

The further I dig into this, the greater the craziness becomes. The installation of the Sticky Notes Extension is (from /Applications/Adobe InDesign CC 2015/WoodWing ZXP/mac_installer_CC.app/Contents/MacOS/mac_installer_CC):

# Check if the initial installation output contains an error.
# In any error case we will install the unzipped Sticky Notes extension.
if [[ ${OUTPUT} == *"-156"* ]] || [[ ${OUTPUT} == *"-411"* ]]; then
    echo "Yes it contains the -411 error"
    # Check if the Sticky Notes folder is installed.
    # If so, remove it and install the unzipped version.
    STICKYNOTEDIR="/Library/Application Support/Adobe/CEP/extensions/Sticky Notes"
    if [[ -d "${STICKYNOTEDIR}" ]]; then
        echo "Sticky Notes folder exists, first remove it"
        rm -rf "${STICKYNOTEDIR}"
    else
        echo "Sticky Notes folder does not exist"
    fi

    # Unzip the wrapper ZXP
    unzip "${DIR}/StickyNotesPanel_CC2015.zxp" -d "${DIR}/temp1"
    # Unzip the actual Sicky Note ZXP.
    unzip "${DIR}/temp1/StickyNotesPanel.zxp" -d "${DIR}/temp2"
    # Copy the content of the Sticky Note extension to a "Sticky Notes"
    # folder in the default extension location.
    cp -rf "${DIR}/temp2/" "${STICKYNOTEDIR}/"
    # Remove the two temporary unzipped folders.
    rm -rf "${DIR}/temp1"
    rm -rf "${DIR}/temp2"
else
    echo "No error found."
fi

However the uninstall of the Sticky Notes (and Smart Caching) extension (from /Applications/Adobe InDesign CC 2015/Uninstall Smart Connection for Adobe CC 2015 v11.2.0 Build42.app/Contents/Resources/Uninstall Smart Connection for Adobe CC 2015 v11.2.0 Build42.sh, code in an earlier comment) only tries to remove the extension via ExManCmd and not via deletion of the copy of the products of decompressing the .zip. This has a pretty high potential of failure.

Beyond this, the Woodwing ZXP and PluginConfig.txt files are now no longer removed properly during an uninstallation.

Which circles me back to the original (rhetorical) question I had when I started writing this recipe--is it enough to twiddle Woodwing's nearly thousand-lines-of-bash shell script to make it function as the authors originally intended? Or should I go further and fix their errors?

foigus commented 6 years ago

In short at least the Extensions (Sticky Notes, Smart Caching), Woodwing ZXP, and PluginConfig.txt files/folders are not uninstalled properly by Woodwing's own uninstaller.

foigus commented 6 years ago

@lukashofstaetter repo-update and try the latest commits.

lukashofstaetter commented 6 years ago

thanks a lot, tomorrow morning i will try it! I'll let you know!

foigus commented 6 years ago

Make sure to test installing and uninstalling. The changes in the recipe are practically all about uninstallation.

lukashofstaetter commented 6 years ago

first attempt after updating the repos:

munki:~ macadm$ autopkg run WoodwingSmartConnectionInDesignCC2015.munki -p /Users/macadm/Desktop/Smart_Connection_for_Adobe_CC_2015_v11.2.0_Build42.dmg
Processing WoodwingSmartConnectionInDesignCC2015.munki...
Traceback (most recent call last):
  File "/usr/local/bin/autopkg", line 2436, in <module>
    sys.exit(main(sys.argv))
  File "/usr/local/bin/autopkg", line 2430, in main
    exit(subcommands[verb]['function'](argv))
  File "/usr/local/bin/autopkg", line 2024, in run_recipes
    autopackager.verify(recipe)
  File "/Library/AutoPkg/autopkglib/__init__.py", line 406, in verify
    recipe=recipe, env=self.env)
  File "/Library/AutoPkg/autopkglib/__init__.py", line 602, in get_processor
    processor_name, processor_filename)
  File "/Users/macadm/Library/AutoPkg/RecipeRepos/com.github.autopkg.hjuutilainen-recipes/SharedProcessors/ChecksumVerifier.py", line 2
    processor = ChecksumVerifier()
    ^
IndentationError: unexpected indent
foigus commented 6 years ago

@lukashofstaetter Could you run autopkg run -vv WoodwingSmartConnectionInDesignCC2015.munki -p /Users/macadm/Desktop/Smart_Connection_for_Adobe_CC_2015_v11.2.0_Build42.dmg?

lukashofstaetter commented 6 years ago

same output:

munki:~ macadm$ autopkg run -vv WoodwingSmartConnectionInDesignCC2015.munki -p /Users/macadm/Desktop/Smart_Connection_for_Adobe_CC_2015_v11.2.0_Build42.dmg
Processing WoodwingSmartConnectionInDesignCC2015.munki...
Traceback (most recent call last):
  File "/usr/local/bin/autopkg", line 2436, in <module>
    sys.exit(main(sys.argv))
  File "/usr/local/bin/autopkg", line 2430, in main
    exit(subcommands[verb]['function'](argv))
  File "/usr/local/bin/autopkg", line 2024, in run_recipes
    autopackager.verify(recipe)
  File "/Library/AutoPkg/autopkglib/__init__.py", line 406, in verify
    recipe=recipe, env=self.env)
  File "/Library/AutoPkg/autopkglib/__init__.py", line 602, in get_processor
    processor_name, processor_filename)
  File "/Users/macadm/Library/AutoPkg/RecipeRepos/com.github.autopkg.hjuutilainen-recipes/SharedProcessors/ChecksumVerifier.py", line 2
    processor = ChecksumVerifier()
    ^
IndentationError: unexpected indent
foigus commented 6 years ago

At first blush it appears that something is wrong with your local copy of hjuutilainen-recipes. Try the following:

autopkg repo-delete hjuutilainen-recipes
autopkg repo-add hjuutilainen-recipes

Then:

autopkg run -vv WoodwingSmartConnectionInDesignCC2015.munki -p /Users/macadm/Desktop/Smart_Connection_for_Adobe_CC_2015_v11.2.0_Build42.dmg
lukashofstaetter commented 6 years ago

thanks! fiddeling around with deleting and adding the repo, new local override, trust and so the recipe worked and i have the package now in munki avaliable for testing.

foigus commented 6 years ago

👍

foigus commented 6 years ago

Any update on testing installation and (especially) uninstallation?

lukashofstaetter commented 6 years ago

installing works great, uninstalling i will be able to test tomorrow.

lukashofstaetter commented 6 years ago

first try: munki uninstalls the package sucessfully. however, the smartconnection plugin stays on the disk and remains active. will try on a clean install maybe next week sometimes.

foigus commented 6 years ago

For the record, I'm modifying the bare minimum of Woodwing's original uninstall script to make it work for InCopy and InDesign.

I also add my own postuninstall_script for InCopy, InDesign, and InDesign Digital Magazine plugins, mostly to clean up things Woodwing missed and to forget the receipts.

I suppose the proper uninstall script for you might include non-English characters? Maybe?

foigus commented 6 years ago

Any luck testing the uninstallation?

foigus commented 6 years ago

Any feedback?

lukashofstaetter commented 6 years ago

sorry the late feedback. on a clean install: installing WoodwingSmartConnectionInDesignCC works. however, uninstalling does not and leaves the plugin where it has been installed. it's a german system, but i don't think there are non-English characters around.

foigus commented 6 years ago

Does Woodwing's Smart Connection uninstaller work (the double-clickable one)?

lukashofstaetter commented 6 years ago

yes, this one works. (after entering the password for the user that is logged in)

foigus commented 6 years ago

Try something for me:

The recipe I've written is designed to stop running if Woodwing has changed their uninstall script, since I'm editing it. I want to know what happens on your computer when my edited uninstall script runs.

lukashofstaetter commented 6 years ago

seems to work when starting the script manually:

mb-101:Desktop root# ./wwuninstall_indesigncc2015_fixed.sh 
#!/bin/bash -xv
echo ""
+ echo ''

##Double pound signs are edits from Patrick Fergus
#---------------------------------------------------------------------
# Declare the path finding variables.

# Get the absolute path to this very script with script name and extension.
# To get the path only, detract the directory name.
##Don't need to find the application folder to uninstall from, let's hard-code this
##path_only=`dirname "$0"`
##path_only=`dirname "$path_only"`
##path_only=`dirname "$path_only"`
##path_only=`dirname "$path_only"`
##path_only="/Applications/Adobe InCopy CC 2015"
path_only="/Applications/Adobe InDesign CC 2015"
+ path_only='/Applications/Adobe InDesign CC 2015'

# Boolean to show message on success.
B_MSG=true
+ B_MSG=true

#---------------------------------------------------------------------
# Uninstalls the ZXP extensions

function UninstallZXPExtensions()
{
##  Don't need these variables any more
##  USERNAME=`id -un`
##  BASENAME=`basename "$0"`
##  #BASENAME="${BASENAME/Uninstall }"
##  #BASENAME="${BASENAME/DAILY }"
##  BASENAME="${BASENAME/.sh}"

    # Get the password from the currect user.
##  We're already root, don't need to run this
##  pw="$(osascript -e 'Tell application "System Events" to display dialog "Please enter the password for '"'"$USERNAME"'"':" default answer "" with hidden answer with title "'"$BASENAME"'"' -e 'text returned of result' 2>/dev/null)" 
##
##  # If the password is emprt (cancel) we stop the uninstaller.
##  if [ "$pw" == "" ]; then
##      exit 1
##  fi

    # Get the path to the ExManCmd tool.
##  I reject your reality of EXMANPATH and substitute my own, since "dirname" isn't
##  effective if I'm not running the script from just the right directory.
##  EXMANPATH=`dirname "${0}"`
##  EXMANPATH=`dirname "${EXMANPATH}"`

    # Give all rights to installation paths.
##  We're already root, we don't need additional rights
##  echo "$pw" | sudo -S chmod -R 777 "$path_only/Plug-Ins/WoodWing"
##  echo "$pw" | sudo -S chmod -R 777 "$path_only/Plug-Outs"

    # Uninstall the ZXP extensions.
##  I again reject your reality of EXMANPATH and substitute my own, since "dirname" isn't
##  effective if I'm not running the script from just the right directory.
##  echo "$pw" | sudo -S "${EXMANPATH}/ExManCmd/MacOS/ExManCmd" --remove "Sticky Notes"
##  echo "$pw" | sudo -S "${EXMANPATH}/ExManCmd/MacOS/ExManCmd" --remove "Smart Caching 2015"
    /Applications/Adobe\ InDesign\ CC\ 2015/Uninstall\ Smart\ Connection\ for\ Adobe\ CC\ 2015\ v*\ Build*.app/Contents/ExManCmd/MacOS/ExManCmd --remove "Sticky Notes"
    /Applications/Adobe\ InDesign\ CC\ 2015/Uninstall\ Smart\ Connection\ for\ Adobe\ CC\ 2015\ v*\ Build*.app/Contents/ExManCmd/MacOS/ExManCmd --remove "Smart Caching 2015"

    # If the password was not correct we let the user try again.
##  Again, we're root--this no longer applies
##  if [ "$?" == "1" ]; then
##      UninstallZXPExtensions      
##  fi
}
# Uninstall the installed ZXP extensions from Adobe Extension Manager.
UninstallZXPExtensions
+ UninstallZXPExtensions
+ '/Applications/Adobe InDesign CC 2015/Uninstall Smart Connection for Adobe CC 2015 v11.2.0 Build42.app/Contents/ExManCmd/MacOS/ExManCmd' --remove 'Sticky Notes'
Failed to get extension handle by extension name, status = -406!
+ '/Applications/Adobe InDesign CC 2015/Uninstall Smart Connection for Adobe CC 2015 v11.2.0 Build42.app/Contents/ExManCmd/MacOS/ExManCmd' --remove 'Smart Caching 2015'
Failed to get extension handle by extension name, status = -406!

#---------------------------------------------------------------------
# Check if a certain (sent) product currently is installed.

function IsProductInstalled()
{
    # The product name to look for.
    PRODUCT=$1

    # Check if any installed plugins which match the sent criteria are found.
    FILES=$(find "$path_only/Plug-Ins/WoodWing/" -maxdepth "1" -iname "$PRODUCT*.InDesignPlugin")

    # Check if files exist and return a value correctly.
    if [[ ! $FILES ]]; then
        echo "No $PRODUCT plugins are installed."
        echo ""
        return 1    # False.
    else
        echo "$PRODUCT plugins are installed:"
        echo ""
        echo "    $FILES"
        echo ""
        return 0    # True.
    fi
}

#---------------------------------------------------------------------
# Check if we can uninstall.

function CanWeUninstallAll()
{
    # Check if the "SmartCatalog" plugins currently are installed.
    IsProductInstalled "SmartCatalog"
    if [ $? == 0 ]; then
        return 1
    fi

    # Check if the "SmartLayout" plugins currently are installed.
    IsProductInstalled "SmartLayout"
    if [ $? == 0 ]; then
        return 1
    fi

    # Check if the "SmartStyle(s)" plugins currently are installed.
    IsProductInstalled "SmartStyle"
    if [ $? == 0 ]; then
        return 1
    fi

    # Check if the "SmartTables" plugins currently are installed.
    IsProductInstalled "SmartTables"
    if [ $? == 0 ]; then
        return 1
    fi

    # Check if the "WWStyling" plugins currently are installed.
    IsProductInstalled "WWStyling"
    if [ $? == 0 ]; then
        return 1
    fi

    return 0
}

#---------------------------------------------------------------------
# Remove plugins.

function UninstallPlugins()
{
    # Tells the function what and how to remove.
    MODE=$1

    # Delete only the conventional plugins.
    if [ "$MODE" == "conventional" ]; then

        # Find all the conventional Smart Connection plugins.
        # Includes strange SmartJump naming.
        # Remove the found plugins.
        find "$path_only/Plug-Ins/WoodWing" \
                -maxdepth "1" \
                \( -iname "SCCore*.InDesignPlugin" \
                -o -iname "SCEnt*.InDesignPlugin" \
                -o -iname "SCEnt*.swf" \
                -o -iname "SCPro*.InDesignPlugin" \
                -o -iname "SmartImage*.InDesignPlugin" \
## Removed above line in find command due to problematic characters, SmartXXtJump*.InDesignPlugin.  XX are bad characters \
##              -o -iname "SmarXXtJump*.InDesignPlugin" \
                -o -iname "SmartJump*.InDesignPlugin" \
                -o -iname "SmartDPSTools*.InDesignPlugin" \) \
                -exec echo "  Deleting {}" \; \
                -exec rm -Rf {} \;

    fi

    # Delete the whole 'Plug-Ins/WoodWing' folder.
    if [ "$MODE" == "totally" ]; then
        echo "  Deleting the WoodWing Folder"
        rm -Rf "$path_only/Plug-Ins/WoodWing"
    fi

    echo ""
}

#---------------------------------------------------------------------
# Re-Install a single Plug-Out
# If target destination already exists, it will first merge it with Plug-Outs
# No-op if Plug-Out does not exists
function ReInstallPlugOut()
{
    # Plug-Out path of plugin to be re-installed
    SOURCEPATH=$1

    # Destination path of Plug-In
    TARGETPATH=$2

    # Plug-in name
    TARGET=$3

    # Only if the Plug-Out exists
    if [ -d "${SOURCEPATH}/$TARGET" ]; then
        # If there  is already a Plug-In in the destination path, first
        # copy this plug-in back into the Plug-Outs.
        # This Plug-In was probably placed by an Adobe Update and might only be partial.
        # By copying it into Plug-Outs we apply it to the older Plug-In version
        if [ -d "${TARGETPATH}/$TARGET" ]; then
            cp -LRPp "${TARGETPATH}/$TARGET" "$SOURCEPATH"
            rm -rf "$TARGETPATH/$TARGET"
        fi

        # Finally re-install the Plug-Out
        mv "$SOURCEPATH/$TARGET"            "$TARGETPATH"
    fi
}

#---------------------------------------------------------------------
# Re-install InDesign/InCopy plugins from the Plug-Outs folder to their
# original Plug-Ins folder InCopyWorkflow and UI.

function ReInstallPlugOuts()
{
    # Plug-Outs folder.
    WW_PLOUT="$path_only/Plug-Outs"
    PI_ICWF="$path_only/Plug-Ins/InCopyWorkflow"
    PI_UI="$path_only/Plug-Ins/UI"
    echo "PI_ICWF: $PI_ICWF"
    echo "PI_UI: $PI_UI"
    echo ""

    # Check if the 'InCopyWorkflow' folder exists.
    if [ -d "$PI_ICWF" ]; then

        ReInstallPlugOut "$WW_PLOUT" "$PI_ICWF" "InCopy Bridge.InDesignPlugin"
        ReInstallPlugOut "$WW_PLOUT" "$PI_ICWF" "InCopy Bridge UI.InDesignPlugin"
        ReInstallPlugOut "$WW_PLOUT" "$PI_ICWF" "InCopyImport.InDesignPlugin"
        ReInstallPlugOut "$WW_PLOUT" "$PI_ICWF" "Assignment UI.InDesignPlugin"
        ReInstallPlugOut "$WW_PLOUT" "$PI_ICWF" "InCopyExport.InDesignPlugin"
        ReInstallPlugOut "$WW_PLOUT" "$PI_ICWF" "InCopyExportUI.InDesignPlugin"
        ReInstallPlugOut "$WW_PLOUT" "$PI_ICWF" "InCopyWorkflow UI.InDesignPlugin"

    else
        echo "$WW_PLOUT DOES NOT exist"
        echo ""
    fi

    # Check if the 'UI' folder exists.
    if [ -d "$PI_UI" ]; then

        ReInstallPlugOut "$WW_PLOUT" "$PI_UI" "InCopyFileActions.InDesignPlugin"
        ReInstallPlugOut "$WW_PLOUT" "$PI_UI" "InCopyFileActionsUI.InDesignPlugin"

    else
        echo "$PI_UI DOES NOT exist"
        echo ""
    fi

    # We assume that we have re-installed everything so delete the Plug-Outs folder.
    rm -Rf "$WW_PLOUT"
}

#---------------------------------------------------------------------
# Main script.

# Check if we can uninstall the Smart Connection product.
CanWeUninstallAll
+ CanWeUninstallAll
+ IsProductInstalled SmartCatalog
+ PRODUCT=SmartCatalog
find "$path_only/Plug-Ins/WoodWing/" -maxdepth "1" -iname "$PRODUCT*.InDesignPlugin"
++ find '/Applications/Adobe InDesign CC 2015/Plug-Ins/WoodWing/' -maxdepth 1 -iname 'SmartCatalog*.InDesignPlugin'
+ FILES=
+ [[ ! -n '' ]]
+ echo 'No SmartCatalog plugins are installed.'
No SmartCatalog plugins are installed.
+ echo ''

+ return 1
+ '[' 1 == 0 ']'
+ IsProductInstalled SmartLayout
+ PRODUCT=SmartLayout
find "$path_only/Plug-Ins/WoodWing/" -maxdepth "1" -iname "$PRODUCT*.InDesignPlugin"
++ find '/Applications/Adobe InDesign CC 2015/Plug-Ins/WoodWing/' -maxdepth 1 -iname 'SmartLayout*.InDesignPlugin'
+ FILES=
+ [[ ! -n '' ]]
+ echo 'No SmartLayout plugins are installed.'
No SmartLayout plugins are installed.
+ echo ''

+ return 1
+ '[' 1 == 0 ']'
+ IsProductInstalled SmartStyle
+ PRODUCT=SmartStyle
find "$path_only/Plug-Ins/WoodWing/" -maxdepth "1" -iname "$PRODUCT*.InDesignPlugin"
++ find '/Applications/Adobe InDesign CC 2015/Plug-Ins/WoodWing/' -maxdepth 1 -iname 'SmartStyle*.InDesignPlugin'
+ FILES=
+ [[ ! -n '' ]]
+ echo 'No SmartStyle plugins are installed.'
No SmartStyle plugins are installed.
+ echo ''

+ return 1
+ '[' 1 == 0 ']'
+ IsProductInstalled SmartTables
+ PRODUCT=SmartTables
find "$path_only/Plug-Ins/WoodWing/" -maxdepth "1" -iname "$PRODUCT*.InDesignPlugin"
++ find '/Applications/Adobe InDesign CC 2015/Plug-Ins/WoodWing/' -maxdepth 1 -iname 'SmartTables*.InDesignPlugin'
+ FILES=
+ [[ ! -n '' ]]
+ echo 'No SmartTables plugins are installed.'
No SmartTables plugins are installed.
+ echo ''

+ return 1
+ '[' 1 == 0 ']'
+ IsProductInstalled WWStyling
+ PRODUCT=WWStyling
find "$path_only/Plug-Ins/WoodWing/" -maxdepth "1" -iname "$PRODUCT*.InDesignPlugin"
++ find '/Applications/Adobe InDesign CC 2015/Plug-Ins/WoodWing/' -maxdepth 1 -iname 'WWStyling*.InDesignPlugin'
+ FILES=
+ [[ ! -n '' ]]
+ echo 'No WWStyling plugins are installed.'
No WWStyling plugins are installed.
+ echo ''

+ return 1
+ '[' 1 == 0 ']'
+ return 0
# No, just delete the conventional SCEnt plugins.
if [ $? == 1 ]; then

    # We cannot uninstall totally due to other installed products.
    # Only install the conventional Smart Connection plugins.
    UninstallPlugins "conventional"

    B_MSG=false

# Yes, delete the whole 'Plug-Ins/WoodWing' folder.
else
    UninstallPlugins "totally"

    B_MSG=true
fi
+ '[' 0 == 1 ']'
+ UninstallPlugins totally
+ MODE=totally
+ '[' totally == conventional ']'
+ '[' totally == totally ']'
+ echo '  Deleting the WoodWing Folder'
  Deleting the WoodWing Folder
+ rm -Rf '/Applications/Adobe InDesign CC 2015/Plug-Ins/WoodWing'
+ echo ''

+ B_MSG=true

# if [ -d "$path_only/Plug-Outs" ]; then
#   B_MSG=false
# fi

# What ever the outcome of the 'CanWeUninstallAll' function
# we set back all original InCopyWorkflow and UI plugins during
# the de-installation of the Smart Connection product.
ReInstallPlugOuts
+ ReInstallPlugOuts
+ WW_PLOUT='/Applications/Adobe InDesign CC 2015/Plug-Outs'
+ PI_ICWF='/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
+ PI_UI='/Applications/Adobe InDesign CC 2015/Plug-Ins/UI'
+ echo 'PI_ICWF: /Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
PI_ICWF: /Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow
+ echo 'PI_UI: /Applications/Adobe InDesign CC 2015/Plug-Ins/UI'
PI_UI: /Applications/Adobe InDesign CC 2015/Plug-Ins/UI
+ echo ''

+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow' ']'
+ ReInstallPlugOut '/Applications/Adobe InDesign CC 2015/Plug-Outs' '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow' 'InCopy Bridge.InDesignPlugin'
+ SOURCEPATH='/Applications/Adobe InDesign CC 2015/Plug-Outs'
+ TARGETPATH='/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
+ TARGET='InCopy Bridge.InDesignPlugin'
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Outs/InCopy Bridge.InDesignPlugin' ']'
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow/InCopy Bridge.InDesignPlugin' ']'
+ mv '/Applications/Adobe InDesign CC 2015/Plug-Outs/InCopy Bridge.InDesignPlugin' '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
+ ReInstallPlugOut '/Applications/Adobe InDesign CC 2015/Plug-Outs' '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow' 'InCopy Bridge UI.InDesignPlugin'
+ SOURCEPATH='/Applications/Adobe InDesign CC 2015/Plug-Outs'
+ TARGETPATH='/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
+ TARGET='InCopy Bridge UI.InDesignPlugin'
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Outs/InCopy Bridge UI.InDesignPlugin' ']'
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow/InCopy Bridge UI.InDesignPlugin' ']'
+ mv '/Applications/Adobe InDesign CC 2015/Plug-Outs/InCopy Bridge UI.InDesignPlugin' '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
+ ReInstallPlugOut '/Applications/Adobe InDesign CC 2015/Plug-Outs' '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow' InCopyImport.InDesignPlugin
+ SOURCEPATH='/Applications/Adobe InDesign CC 2015/Plug-Outs'
+ TARGETPATH='/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
+ TARGET=InCopyImport.InDesignPlugin
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Outs/InCopyImport.InDesignPlugin' ']'
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow/InCopyImport.InDesignPlugin' ']'
+ mv '/Applications/Adobe InDesign CC 2015/Plug-Outs/InCopyImport.InDesignPlugin' '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
+ ReInstallPlugOut '/Applications/Adobe InDesign CC 2015/Plug-Outs' '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow' 'Assignment UI.InDesignPlugin'
+ SOURCEPATH='/Applications/Adobe InDesign CC 2015/Plug-Outs'
+ TARGETPATH='/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
+ TARGET='Assignment UI.InDesignPlugin'
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Outs/Assignment UI.InDesignPlugin' ']'
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow/Assignment UI.InDesignPlugin' ']'
+ mv '/Applications/Adobe InDesign CC 2015/Plug-Outs/Assignment UI.InDesignPlugin' '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
+ ReInstallPlugOut '/Applications/Adobe InDesign CC 2015/Plug-Outs' '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow' InCopyExport.InDesignPlugin
+ SOURCEPATH='/Applications/Adobe InDesign CC 2015/Plug-Outs'
+ TARGETPATH='/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
+ TARGET=InCopyExport.InDesignPlugin
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Outs/InCopyExport.InDesignPlugin' ']'
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow/InCopyExport.InDesignPlugin' ']'
+ mv '/Applications/Adobe InDesign CC 2015/Plug-Outs/InCopyExport.InDesignPlugin' '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
+ ReInstallPlugOut '/Applications/Adobe InDesign CC 2015/Plug-Outs' '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow' InCopyExportUI.InDesignPlugin
+ SOURCEPATH='/Applications/Adobe InDesign CC 2015/Plug-Outs'
+ TARGETPATH='/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
+ TARGET=InCopyExportUI.InDesignPlugin
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Outs/InCopyExportUI.InDesignPlugin' ']'
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow/InCopyExportUI.InDesignPlugin' ']'
+ mv '/Applications/Adobe InDesign CC 2015/Plug-Outs/InCopyExportUI.InDesignPlugin' '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
+ ReInstallPlugOut '/Applications/Adobe InDesign CC 2015/Plug-Outs' '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow' 'InCopyWorkflow UI.InDesignPlugin'
+ SOURCEPATH='/Applications/Adobe InDesign CC 2015/Plug-Outs'
+ TARGETPATH='/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
+ TARGET='InCopyWorkflow UI.InDesignPlugin'
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Outs/InCopyWorkflow UI.InDesignPlugin' ']'
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow/InCopyWorkflow UI.InDesignPlugin' ']'
+ mv '/Applications/Adobe InDesign CC 2015/Plug-Outs/InCopyWorkflow UI.InDesignPlugin' '/Applications/Adobe InDesign CC 2015/Plug-Ins/InCopyWorkflow'
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Ins/UI' ']'
+ ReInstallPlugOut '/Applications/Adobe InDesign CC 2015/Plug-Outs' '/Applications/Adobe InDesign CC 2015/Plug-Ins/UI' InCopyFileActions.InDesignPlugin
+ SOURCEPATH='/Applications/Adobe InDesign CC 2015/Plug-Outs'
+ TARGETPATH='/Applications/Adobe InDesign CC 2015/Plug-Ins/UI'
+ TARGET=InCopyFileActions.InDesignPlugin
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Outs/InCopyFileActions.InDesignPlugin' ']'
+ ReInstallPlugOut '/Applications/Adobe InDesign CC 2015/Plug-Outs' '/Applications/Adobe InDesign CC 2015/Plug-Ins/UI' InCopyFileActionsUI.InDesignPlugin
+ SOURCEPATH='/Applications/Adobe InDesign CC 2015/Plug-Outs'
+ TARGETPATH='/Applications/Adobe InDesign CC 2015/Plug-Ins/UI'
+ TARGET=InCopyFileActionsUI.InDesignPlugin
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Outs/InCopyFileActionsUI.InDesignPlugin' ']'
+ '[' -d '/Applications/Adobe InDesign CC 2015/Plug-Ins/UI/InCopyFileActionsUI.InDesignPlugin' ']'
+ mv '/Applications/Adobe InDesign CC 2015/Plug-Outs/InCopyFileActionsUI.InDesignPlugin' '/Applications/Adobe InDesign CC 2015/Plug-Ins/UI'
+ rm -Rf '/Applications/Adobe InDesign CC 2015/Plug-Outs'

# Show a message to the user on success.
##Want this to be silent--removing this bit of UI
##if [ $B_MSG == true ]; then
##  osascript \
##  -e 'with timeout of 1800 seconds' \
##  -e  'tell application "Finder"' \
##  -e      'display dialog "Smart Connection is successfully uninstalled." buttons {"OK"}' \
##  -e  'end tell' \
##  -e 'end timeout'
##fi

# Remove the uninstaller.
##Another hard path here
##new_path_only=`dirname "$0"`
##new_path_only=`dirname "$new_path_only"`
##new_path_only=`dirname "$new_path_only"`
##new_path_only="/Applications/Adobe InCopy CC 2015/Uninstall Smart Connection for Adobe CC 2015"
new_path_only="/Applications/Adobe InDesign CC 2015/Uninstall Smart Connection for Adobe CC 2015"
+ new_path_only='/Applications/Adobe InDesign CC 2015/Uninstall Smart Connection for Adobe CC 2015'

##rm -Rf "$new_path_only"
##Wildcarded to remove all Smart Connection CC 2015 uninstallers since they're named "Uninstall Smart Connection for Adobe CC 2015 <version>"
rm -Rf "$new_path_only"*
+ rm -Rf '/Applications/Adobe InDesign CC 2015/Uninstall Smart Connection for Adobe CC 2015 v11.2.0 Build42.app'

exit 0
+ exit 0
mb-101:Desktop root# 
foigus commented 6 years ago

You mentioned first try: munki uninstalls the package sucessfully. however, the smartconnection plugin stays on the disk and remains active. Do you mean that the plugins still exist at /Applications/Adobe InDesign CC 2015/Plug-Ins/WoodWing? The original uninstall script says:

    # Delete the whole 'Plug-Ins/WoodWing' folder.
    if [ "$MODE" == "totally" ]; then
        echo "  Deleting the WoodWing Folder"
        rm -Rf "$path_only/Plug-Ins/WoodWing"
    fi

Lines 349-352 of what you pasted says:

+ echo '  Deleting the WoodWing Folder'
  Deleting the WoodWing Folder
+ rm -Rf '/Applications/Adobe InDesign CC 2015/Plug-Ins/WoodWing'
+ echo ''

Woodwing detects path_only via this creative construct:

# Get the absolute path to this very script with script name and extension.
# To get the path only, detract the directory name.
path_only=`dirname "$0"`
path_only=`dirname "$path_only"`
path_only=`dirname "$path_only"`
path_only=`dirname "$path_only"`

Whereas I set path_only statically:

##Don't need to find the application folder to uninstall from, let's hard-code this
##path_only=`dirname "$0"`
##path_only=`dirname "$path_only"`
##path_only=`dirname "$path_only"`
##path_only=`dirname "$path_only"`
##path_only="/Applications/Adobe InCopy CC 2015"
path_only="/Applications/Adobe InDesign CC 2015"

So I'm now curious if your (German?) path to InDesign CC 2015 doesn't match my (English?) path to InDesign CC 2015? Can you drag and drop Adobe InDesign CC 2015.app into a Terminal window, and copy and paste the path that's generated?

lukashofstaetter commented 6 years ago

The Path is:

/Applications/Adobe\ InDesign\ CC\ 2015/Adobe\ InDesign\ CC\ 2015.app/

Now the Plug-In Folder WoodWing is deleted when executing the Script manually.

foigus commented 6 years ago

Can you set up a simple repo with just InDesign and the Smart Connection plugins and test uninstallation? I'm confused why the uninstallation is a significant issue.

lukashofstaetter commented 6 years ago

I can and will try after my Holidays in January, ok?

foigus commented 6 years ago

Since I've used this recipe to deploy in my own environment twice now, going to close.