Homebrew / homebrew-cask

🍻 A CLI workflow for the administration of macOS applications distributed as binaries
https://brew.sh
BSD 2-Clause "Simplified" License
20.93k stars 10.71k forks source link

Can't update or reinstall imaging-edge #83146

Closed amharris closed 4 years ago

amharris commented 4 years ago

General troubleshooting steps

Description of issue

I tried upgrading Sony's Imaging Edge bundle with brew cu -a and saying y to imaging-edge but it failed. I also tried uninstalling with brew cask zap imaging-edge and reinstalling but to no avail. Specifically, the version 1.0.02, as recently updated (at the time of writing) in https://github.com/Homebrew/homebrew-cask/commit/2534986b9c711740ec5be5e04575d4ac6917d247.

Command that failed

brew cask install imaging-edge

Output of command with --force --verbose --debug

~ ❯❯❯ brew cask install imaging-edge --force --verbose --debug                                                     ✘ 1
==> Downloading https://di.update.sony.net/NEX/2BqD6b8EKL/ied_1_0_02.dmg
Already downloaded: /Users/amharris/Library/Caches/Homebrew/downloads/f8933b288fddde7cb0b4347f8cd5b3d98d68aee7c91faed6f8fdd939bb6ee584--ied_1_0_02.dmg
==> Verifying SHA-256 checksum for Cask 'imaging-edge'.
==> Installing Cask imaging-edge
hdiutil attach -plist -nobrowse -readonly -noidme -mountrandom /var/folders/8h/tx933b3x3pv284q10hymzr5h0000gn/T/d20200523-29003-qceg70 /Users/amharris/Library/Caches/Homebrew/downloads/f8933b288fddde7cb0b4347f8cd5b3d98d68aee7c91faed6f8fdd939bb6ee584--ied_1_0_02.dmg
mkbom -s -i /var/folders/8h/tx933b3x3pv284q10hymzr5h0000gn/T/20200523-29003-1l4je0d.list -- /var/folders/8h/tx933b3x3pv284q10hymzr5h0000gn/T/20200523-29003-1qh3fjl.bom
ditto --bom /var/folders/8h/tx933b3x3pv284q10hymzr5h0000gn/T/20200523-29003-1qh3fjl.bom -- /private/var/folders/8h/tx933b3x3pv284q10hymzr5h0000gn/T/d20200523-29003-qceg70/dmg.YhiUA3 /var/folders/8h/tx933b3x3pv284q10hymzr5h0000gn/T/d20200523-29003-dfv6j7
diskutil eject /private/var/folders/8h/tx933b3x3pv284q10hymzr5h0000gn/T/d20200523-29003-qceg70/dmg.YhiUA3
cp -pR /var/folders/8h/tx933b3x3pv284q10hymzr5h0000gn/T/d20200523-29003-dfv6j7/ied_1_0_02.pkg /usr/local/Caskroom/imaging-edge/1.0.02,2BqD6b8EKL/ied_1_0_02.pkg
cp -pR /var/folders/8h/tx933b3x3pv284q10hymzr5h0000gn/T/d20200523-29003-dfv6j7/Uninstall.app/. /usr/local/Caskroom/imaging-edge/1.0.02,2BqD6b8EKL/Uninstall.app
chmod -Rf +w /var/folders/8h/tx933b3x3pv284q10hymzr5h0000gn/T/d20200523-29003-dfv6j7
==> Running installer for imaging-edge; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
installer: Package name is Imaging Edge Desktop
installer: Installing at base path /
installer:PHASE:Preparing for installation…
installer:PHASE:Preparing the disk…
installer:PHASE:Preparing Imaging Edge Desktop…
installer:PHASE:Waiting for other installations to complete…
installer:PHASE:Configuring the installation…
installer:STATUS:
installer:%83.428430
installer:PHASE:Running package scripts…
installer:PHASE:Validating packages…
installer:%97.750000
installer: The install failed. (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance. An error occurred while running scripts from the package “ied_1_0_02.pkg”.)
==> Purging files for version 1.0.02,2BqD6b8EKL of Cask imaging-edge
Error: Failure while executing; `/usr/bin/sudo -E -- /usr/bin/env LOGNAME=amharris USER=amharris USERNAME=amharris /usr/sbin/installer -pkg /usr/local/Caskroom/imaging-edge/1.0.02,2BqD6b8EKL/ied_1_0_02.pkg -target / -verboseR` exited with 1. Here's the output:
installer: Package name is Imaging Edge Desktop
installer: Installing at base path /
installer:PHASE:Preparing for installation…
installer:PHASE:Preparing the disk…
installer:PHASE:Preparing Imaging Edge Desktop…
installer:PHASE:Waiting for other installations to complete…
installer:PHASE:Configuring the installation…
installer:STATUS:
installer:%83.428430
installer:PHASE:Running package scripts…
installer:PHASE:Validating packages…
installer:%97.750000
installer: The install failed. (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance. An error occurred while running scripts from the package “ied_1_0_02.pkg”.)
Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs
/usr/local/Homebrew/Library/Homebrew/system_command.rb:176:in `assert_success!'
/usr/local/Homebrew/Library/Homebrew/system_command.rb:53:in `run!'
/usr/local/Homebrew/Library/Homebrew/system_command.rb:29:in `run'
/usr/local/Homebrew/Library/Homebrew/system_command.rb:33:in `run!'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/pkg.rb:59:in `block in run_installer'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/pkg.rb:65:in `with_choices_file'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/pkg.rb:52:in `run_installer'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/pkg.rb:34:in `install_phase'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:218:in `block in install_artifacts'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:777:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/set.rb:777:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:209:in `install_artifacts'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:101:in `install'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:22:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:16:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:16:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:36:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:150:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:92:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:9:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:110:in `<main>'

Output of brew cask doctor

~ ❯❯❯ brew cask doctor                                                                                             ✘ 1
==> Homebrew Version
2.2.17-96-g2e801c3
==> macOS
10.15.4
==> SIP
Enabled
==> Java
14.0.1, 14, 13.0.2, 13.0.1, 13, 12.0.2, 12.0.1, 12, 11.0.2, 11.0.1, 11, 1.8.0_144
==> xattr issues
<NONE>
==> Gatekeeper support
Enabled
==> Homebrew Cask Install Location
<NONE>
==> Homebrew Cask Staging Location
/usr/local/Caskroom
==> Homebrew Cask Taps:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask (3551 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions (152 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-fonts (924 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-drivers (149 casks)
/usr/local/Homebrew/Library/Taps/adoptopenjdk/homebrew-openjdk (32 casks)
==> Contents of $LOAD_PATH
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/ruby-macho-2.2.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rubocop-rspec-1.39.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rubocop-performance-1.6.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rexml-3.2.4/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/plist-3.5.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/mechanize-2.7.6/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/activesupport-6.0.3.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/zeitwerk-2.3.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/tzinfo-1.2.7/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/thread_safe-0.3.6/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/i18n-1.8.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby
/Library/Ruby/Site/2.6.0
/Library/Ruby/Site/2.6.0/universal-darwin19
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0/universal-darwin19
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19
/usr/local/Homebrew/Library/Homebrew
==> Environment Variables
LC_ALL="en_US.UTF-8"
PATH="/usr/local/Homebrew/Library/Homebrew/shims/scm:/usr/bin:/bin:/usr/sbin:/sbin"
SHELL="/bin/zsh"

Output of brew tap

~ ❯❯❯ brew tap
adoptopenjdk/openjdk
buo/cask-upgrade
dart-lang/dart
ethereum/ethereum
homebrew/cask
homebrew/cask-drivers
homebrew/cask-fonts
homebrew/cask-versions
homebrew/core
homebrew/services
osx-cross/avr
paritytech/paritytech
px4/px4
sambadevi/powerlevel9k
sass/sass
miccal commented 4 years ago

@amharris do you get the same error if you run the command

brew cask install imaging-edge --no-quarantine

?

amharris commented 4 years ago

@miccal Unfortunately, yes.

miccal commented 4 years ago

How about if you download and install the pkg manually, does the install succeed?

vitorgalvao commented 4 years ago

I can confirm on a VM this doesn’t work via HBC but does work via a manual install. The failure may be because two licenses that have to be agreed on are show. Two possible ways to go about it. The first one is preferred because it uses features we support.

  1. Use pkg choices: to accept the licenses.
  2. Extract the contents of the pkg and move the app inside (there’s no pre install script and the post install script seems to be irrelevant for functionality).

Also, a license caveat should be added, if there’s a webpage we can link to.

amharris commented 4 years ago

@miccal Yes. Interestingly, I also tried upgrading it (before I had run brew cask zap imaging-edge to try with a clean slate) via MacUpdater and it also experienced issues, even though it launched the pkg installer. It seemed to think there were multiple versioned copies of the app installed on the system but the new one seemed to disappear and the old one was always left in place.

That aside, I can't give much more information, other than trying any suggestions. However, @vitorgalvao being a team member seems to have much more insight.

Any time you need me to test something to try and fix this updated Cask, just give me a shout. 👍

amharris commented 4 years ago

@vitorgalvao It's probably worth noting that before, the Imaging Edge suite comprised of three separate apps installed within an Imaging Edge/ subdirectory within /Applications/.

Having installed the newly-updated package, fresh from the pkg, it appears that it's now stored in the root of /Applications/ and is a unified launcher that requires you to perform another download to install each of the programmes.

image

image

That secondary pkg then launches a new install with two licenses to be agreed to in and of itself.

After that's been installed, the older version's structure of /Applications/Imaging Edge/<Each of the three programmes> is set up once again.

vitorgalvao commented 4 years ago

Having to download stuff after the download to be usable makes the cask way less useful. Considering it has so few users, unless someone fixes it, it will be best to just remove it.

amharris commented 4 years ago

@vitorgalvao I'll be honest; I wouldn't disagree. After all, if updates involve a two-part process (that may change in structure once again), it's likely more work than it's worth to keep maintained.

I would say that, in theory, it could be possible to find the endpoint to downloading the RVE_INST.dmg package and using that, as the 'Imaging Edge Desktop' app itself may not strictly be necessary. It seems like extra bulk in my view.

Of course, I'm not the experienced one here in terms of scripting a Cask formula, so don't take my concurrence above as a well-informed agreement or conclusion. However, if Homebrew Cask maintainers deem it to be too troublesome–yeah, get rid of it.

miccal commented 4 years ago
  1. Use pkg choices: to accept the licenses.

There does not appear to be any valid choices for these:

-bash-5.0.17- /Users/miccal (30) [> installer -showChoicesXML -pkg /Users/miccal/Downloads/ied_1_0_02.pkg  -target /
<?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">
<array>
    <dict>
        <key>childItems</key>
        <array>
            <dict>
                <key>childItems</key>
                <array/>
                <key>choiceDescription</key>
                <string></string>
                <key>choiceIdentifier</key>
                <string>installer_choice_1</string>
                <key>choiceIsEnabled</key>
                <false/>
                <key>choiceIsSelected</key>
                <integer>1</integer>
                <key>choiceIsVisible</key>
                <true/>
                <key>choiceSizeInKilobytes</key>
                <integer>15072</integer>
                <key>choiceTitle</key>
                <string>Image Data Converter</string>
                <key>pathsOfActivePackagesInChoice</key>
                <array>
                    <string>file://localhost/Users/miccal/Downloads/ied_1_0_02.pkg#Imaging_Edge.pkg</string>
                </array>
            </dict>
        </array>
        <key>choiceIdentifier</key>
        <string>__ROOT_CHOICE_IDENT_DISTRIBUTION_TITLE</string>
        <key>choiceIsEnabled</key>
        <true/>
        <key>choiceIsSelected</key>
        <integer>1</integer>
        <key>choiceIsVisible</key>
        <true/>
        <key>choiceSizeInKilobytes</key>
        <integer>0</integer>
        <key>choiceTitle</key>
        <string>Imaging Edge Desktop</string>
        <key>pathsOfActivePackagesInChoice</key>
        <array/>
    </dict>
</array>
</plist>
adidalal commented 4 years ago

@amharris If you're curious:

The direct link to IE_INST.pkg can be grabbed from https://support.d-imaging.sony.co.jp/disoft_DL/imagingedge_DL/mac?fm=dt

That pkg directly installs the 3 apps inside ~/Applications/Imaging Edge, I don't think there's a need for the wrapper app at all in the cask, considering I was able to directly extract and run them.

Also, if you were curious, here is the (Automator) script that Uninstall.app for the "wrapper application" runs:

# Display a simple welcome message first.
#
echo "Welcome to the Imaging Edge Desktop uninstaller script."

appPath="$1"
shift

## Change Working Dir
cd $appPath

## Kill Process
pgrep "Imaging Edge Desktop" | xargs kill -9

## Remove login service
echo "Removing Login Service"
osascript -e 'tell application "System Events" to delete login item "Imaging Edge Desktop"' 

## Remove application
## Forget we ever got installed
echo "Removing Imaging Edge Desktop from /Applications/ folder"
echo "Removing installation info"
osascript -e 'do shell script "sudo /bin/rm -r /Applications/Imaging\\ Edge\\ Desktop.app ; sudo /usr/sbin/pkgutil --forget com.sony.ImagingEdgeDesktop.pkg" with administrator privileges'

echo "Done."

tl;dr: the wrapper app is bloat, you could change the cask to directly install the main pkg

amharris commented 4 years ago

@adidalal Oh, agreed. I was presenting this particular approach as one option as well—the parent-level app is a bit pointless.

I'd personally be fine with that. Sony just has a habit of changing these things a fair bit; but I suppose if it ever needs to be removed, we can cross that bridge then. For now, perhaps I'll have a go but it'd be my first contribution to a Cask formula, so I'd need to dig into the docs to figure out how to make it work locally, before creating a PR. I don't want to submit guesswork. 🙂

Thanks for providing the script from the wrapper app's uninstall process.

adidalal commented 4 years ago

I just thought it was funny that the wrapper app did nothing, I don't think you need to worry about it at all for the cask, just skip it entirely. That URL should be stable, but, it's Sony, so who knows.

The main pkg should be fairly straightforward. There are a bunch of examples on how to install pkgs, but essentially it's this. Test locally with these directions.

Suspicious Package and AppCleaner may also help: brew cask install appcleaner suspicious-package

Good luck!

vitorgalvao commented 4 years ago

https://github.com/Homebrew/homebrew-cask/pull/88058