diff --git a/Casks/adobe-air.rb b/Casks/adobe-air.rb index b3ec04e9fbd24..285563527fcd6 100644 --- a/Casks/adobe-air.rb +++ b/Casks/adobe-air.rb @@ -7,7 +7,7 @@ class AdobeAir < Cask caskroom_only true - after_install do + postflight do system '/usr/bin/sudo', '-E', '--', "#{destination_path}/Adobe AIR Installer.app/Contents/MacOS/Adobe AIR Installer", '-silent' end diff --git a/Casks/adobe-arh.rb b/Casks/adobe-arh.rb index 514ca202568f3..75e1d5fd6b9aa 100644 --- a/Casks/adobe-arh.rb +++ b/Casks/adobe-arh.rb @@ -9,7 +9,7 @@ class AdobeArh < Cask binary 'arh' container_type :naked - after_install do + postflight do system '/bin/chmod', '--', '755', "#{destination_path}/arh" end diff --git a/Casks/alfred.rb b/Casks/alfred.rb index be5f3cb1dd4d1..f2432ebf2a9b9 100644 --- a/Casks/alfred.rb +++ b/Casks/alfred.rb @@ -8,7 +8,7 @@ class Alfred < Cask link 'Alfred 2.app' link 'Alfred 2.app/Contents/Preferences/Alfred Preferences.app' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'com.runningwithcrayons.alfred-2', 'suppressMoveToApplications', '-bool', 'true' end diff --git a/Casks/alib1.rb b/Casks/alib1.rb index 421d1dd75fd7f..c80a46e86e910 100644 --- a/Casks/alib1.rb +++ b/Casks/alib1.rb @@ -8,7 +8,7 @@ class Alib1 < Cask screen_saver 'Presstube-ALib1.app/Contents/Resources/Presstube - ALib1.saver' - after_install do + postflight do system '/usr/libexec/PlistBuddy', '-c', 'Set :CFBundleName ALib1 (Presstube)', "#{destination_path}/presstube-alib1.app/Contents/Resources/Presstube - ALib1.saver/Contents/Info.plist" end diff --git a/Casks/amazon-music.rb b/Casks/amazon-music.rb index 0287699a0c569..2d469fd44af18 100644 --- a/Casks/amazon-music.rb +++ b/Casks/amazon-music.rb @@ -7,7 +7,7 @@ class AmazonMusic < Cask caskroom_only true - after_install do + postflight do system '/usr/bin/sudo', '-E', '--', "#{destination_path}/Amazon Music Installer.app/Contents/MacOS/osx-intel" end diff --git a/Casks/android-studio-bundle.rb b/Casks/android-studio-bundle.rb index ea0aa9ec31a8f..31470e77fd621 100644 --- a/Casks/android-studio-bundle.rb +++ b/Casks/android-studio-bundle.rb @@ -7,7 +7,7 @@ class AndroidStudioBundle < Cask link 'Android Studio.app' - after_install do + postflight do system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/Android Studio.app/Contents/Info.plist" end end diff --git a/Casks/android-studio.rb b/Casks/android-studio.rb index d39ac3dc000e4..5b2908d4ade4b 100644 --- a/Casks/android-studio.rb +++ b/Casks/android-studio.rb @@ -7,7 +7,7 @@ class AndroidStudio < Cask link 'Android Studio.app' - after_install do + postflight do system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/Android Studio.app/Contents/Info.plist" end end diff --git a/Casks/appcode.rb b/Casks/appcode.rb index 506ba47e07748..5635e253d465e 100644 --- a/Casks/appcode.rb +++ b/Casks/appcode.rb @@ -7,7 +7,7 @@ class Appcode < Cask link 'AppCode.app' - after_install do + postflight do system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/AppCode.app/Contents/Info.plist" end end diff --git a/Casks/atom.rb b/Casks/atom.rb index 6d70f2dfffc0b..982ca505c371f 100644 --- a/Casks/atom.rb +++ b/Casks/atom.rb @@ -8,7 +8,7 @@ class Atom < Cask link 'Atom.app' binary 'Atom.app/Contents/Resources/app/apm/node_modules/.bin/apm', :target => 'apm' binary 'Atom.app/Contents/Resources/app/atom.sh', :target => 'atom' - after_install do + postflight do system '/usr/bin/defaults', 'write', 'com.github.atom', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end end diff --git a/Casks/bankid.rb b/Casks/bankid.rb index b8ea092be95b3..37a6a970bf19a 100644 --- a/Casks/bankid.rb +++ b/Casks/bankid.rb @@ -6,7 +6,7 @@ class Bankid < Cask homepage 'http://www.bankid.com/' container_type :naked - before_install do + preflight do system '/bin/mv', '--', destination_path.join('FileDownloader'), destination_path.join('bankid-latest.pkg') end diff --git a/Casks/bartender.rb b/Casks/bartender.rb index 2ee590c372fe2..9c819897844c6 100644 --- a/Casks/bartender.rb +++ b/Casks/bartender.rb @@ -8,7 +8,7 @@ class Bartender < Cask link 'Bartender.app' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'com.surteesstudios.Bartender', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end diff --git a/Casks/changes-meter.rb b/Casks/changes-meter.rb index f083afa1e81d6..d4820dbfc39bf 100644 --- a/Casks/changes-meter.rb +++ b/Casks/changes-meter.rb @@ -6,7 +6,7 @@ class ChangesMeter < Cask homepage 'http://intuiware.com/apps/changes-meter' link 'Changes Meter.app' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system %Q{/usr/bin/defaults write com.intuiware.ChangesMeter moveToApplicationsFolderAlertSuppress -bool true} end diff --git a/Casks/cheatsheet.rb b/Casks/cheatsheet.rb index b8a0a48ed8510..9d1833e5caeba 100644 --- a/Casks/cheatsheet.rb +++ b/Casks/cheatsheet.rb @@ -8,7 +8,7 @@ class Cheatsheet < Cask link 'CheatSheet.app' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'com.mediaatelier.CheatSheet', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end diff --git a/Casks/chunkulus.rb b/Casks/chunkulus.rb index ff724507e3e4c..25d6c894d1d40 100644 --- a/Casks/chunkulus.rb +++ b/Casks/chunkulus.rb @@ -7,7 +7,7 @@ class Chunkulus < Cask screen_saver 'presstube-chunkulus.app/Contents/Resources/Presstube - Chunkulus.saver' - after_install do + postflight do system '/usr/libexec/PlistBuddy', '-c', 'Set :CFBundleName Chunkulus (Presstube)', "#{destination_path}/presstube-chunkulus.app/Contents/Resources/Presstube - Chunkulus.saver/Contents/Info.plist" end diff --git a/Casks/clamxav.rb b/Casks/clamxav.rb index cbcf8f7a2b953..8c353cd5ef824 100644 --- a/Casks/clamxav.rb +++ b/Casks/clamxav.rb @@ -7,7 +7,7 @@ class Clamxav < Cask homepage 'http://www.clamxav.com/' link 'ClamXav.app' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'uk.co.markallan.clamxav', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end diff --git a/Casks/crosspack-avr.rb b/Casks/crosspack-avr.rb index 7b34b957f0bee..348b8e5c4a876 100644 --- a/Casks/crosspack-avr.rb +++ b/Casks/crosspack-avr.rb @@ -6,7 +6,7 @@ class CrosspackAvr < Cask homepage 'http://www.obdev.at/products/crosspack/' install 'CrossPack-AVR.pkg' - after_uninstall do + uninstall_postflight do IO.popen('/usr/bin/yes | /usr/bin/sudo -E -- /usr/local/CrossPack-AVR/uninstall && /usr/bin/sudo -- /usr/sbin/pkgutil --forget at.obdev.CrossPack-AVR', 'r+') do |pipe| pipe.close_write while line = pipe.gets diff --git a/Casks/daisydisk.rb b/Casks/daisydisk.rb index 36f50e4a55b10..0bfc0622bf9d7 100644 --- a/Casks/daisydisk.rb +++ b/Casks/daisydisk.rb @@ -8,7 +8,7 @@ class Daisydisk < Cask link 'DaisyDisk.app' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'com.daisydiskapp.DaisyDiskStandAlone', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end diff --git a/Casks/dash.rb b/Casks/dash.rb index f0c4667cdfbb1..bbbffcf697824 100644 --- a/Casks/dash.rb +++ b/Casks/dash.rb @@ -8,7 +8,7 @@ class Dash < Cask link 'Dash.app' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'com.kapeli.dash', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end diff --git a/Casks/decitime.rb b/Casks/decitime.rb index e3f5f81d2c5ab..99a7f09ccf17a 100644 --- a/Casks/decitime.rb +++ b/Casks/decitime.rb @@ -10,7 +10,7 @@ class Decitime < Cask # fix wonky DMG by mounting it once read-write per discussion at # https://github.com/caskroom/homebrew-cask/pull/2654 - before_install do + preflight do system %Q{/usr/bin/hdiutil eject "$(/usr/bin/hdiutil mount -readwrite -noidme -nobrowse -mountrandom /tmp #{destination_path.join(artifacts[:nested_container].first)} | /usr/bin/cut -f3 -- - | /usr/bin/grep -- '.' -)" >/dev/null 2>&1} end end diff --git a/Casks/fantastical.rb b/Casks/fantastical.rb index 784de9c41ff8c..c90e3cb002d47 100644 --- a/Casks/fantastical.rb +++ b/Casks/fantastical.rb @@ -8,7 +8,7 @@ class Fantastical < Cask link 'Fantastical.app' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'com.flexibits.fantastical', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end diff --git a/Casks/flux.rb b/Casks/flux.rb index 8f35c22814d80..b372f54cedd5c 100644 --- a/Casks/flux.rb +++ b/Casks/flux.rb @@ -8,7 +8,7 @@ class Flux < Cask link 'Flux.app' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'org.herf.Flux', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end diff --git a/Casks/git-annex.rb b/Casks/git-annex.rb index 3f08dbf171797..bc4a641142911 100644 --- a/Casks/git-annex.rb +++ b/Casks/git-annex.rb @@ -3,7 +3,7 @@ class GitAnnex < Cask url 'http://downloads.kitenet.net/git-annex/OSX/current/10.8.2_Mountain_Lion/git-annex.dmg.bz2' # This is a horrible hack to force the file extension. The # backend code should be fixed so that this is not needed. - before_install do + preflight do system '/bin/mv', '--', destination_path.join('git-annex-latest'), destination_path.join('git-annex-latest.dmg') end nested_container 'git-annex-latest.dmg' diff --git a/Casks/github.rb b/Casks/github.rb index 39821a014abd1..dcb576ed3e655 100644 --- a/Casks/github.rb +++ b/Casks/github.rb @@ -7,7 +7,7 @@ class Github < Cask link 'GitHub.app' binary 'GitHub.app/Contents/MacOS/github_cli', :target => 'github' - after_install do + postflight do system '/usr/bin/defaults', 'write', 'com.github.GitHub', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end end diff --git a/Casks/gpgtools.rb b/Casks/gpgtools.rb index 686cc908163a3..544907fa90b0a 100644 --- a/Casks/gpgtools.rb +++ b/Casks/gpgtools.rb @@ -6,7 +6,7 @@ class Gpgtools < Cask homepage 'https://gpgtools.org/index.html' install 'Install.pkg' - after_install do + postflight do system '/usr/bin/sudo', '-E', '--', '/usr/local/MacGPG2/libexec/fixGpgHome', Etc.getpwuid(Process.euid).name, ENV['GNUPGHOME'] ? ENV['GNUPGHOME'] : "#{ENV['HOME']}/.gnupg" @@ -35,7 +35,7 @@ class Gpgtools < Cask '/Library/PreferencePanes/GPGPreferences.prefPane', "ENV['HOME']/Library/PreferencePanes/GPGPreferences.prefPane", ] - after_uninstall do + uninstall_postflight do system '/bin/bash', '-c', '[[ "$(/usr/bin/readlink /usr/local/bin/gpg2)" =~ MacGPG2 ]] && /bin/rm -- /usr/local/bin/gpg2' system '/bin/bash', '-c', '[[ "$(/usr/bin/readlink /usr/local/bin/gpg)" =~ MacGPG2 ]] && /bin/rm -- /usr/local/bin/gpg' system '/bin/bash', '-c', '[[ "$(/usr/bin/readlink /usr/local/bin/gpg-agent)" =~ MacGPG2 ]] && /bin/rm -- /usr/local/bin/gpg-agent' diff --git a/Casks/heart.rb b/Casks/heart.rb index 9a6b64589818f..8a4a61776b6bc 100644 --- a/Casks/heart.rb +++ b/Casks/heart.rb @@ -7,7 +7,7 @@ class Heart < Cask screen_saver 'presstube-heart.app/Contents/Resources/Presstube - Heart.saver' - after_install do + postflight do system '/usr/libexec/PlistBuddy', '-c', 'Set :CFBundleName Heart (Presstube)', "#{destination_path}/presstube-heart.app/Contents/Resources/Presstube - Heart.saver/Contents/Info.plist" end diff --git a/Casks/hipchat.rb b/Casks/hipchat.rb index cfda1cd617a7a..e1d5624597f88 100644 --- a/Casks/hipchat.rb +++ b/Casks/hipchat.rb @@ -8,7 +8,7 @@ class Hipchat < Cask link 'HipChat.app' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'com.hipchat.HipChat', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end diff --git a/Casks/hive.rb b/Casks/hive.rb index 47b5fd391dae1..321267d8e6876 100644 --- a/Casks/hive.rb +++ b/Casks/hive.rb @@ -8,7 +8,7 @@ class Hive < Cask link 'Hive.app' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'com.hivewallet.Hive', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end diff --git a/Casks/hockeyapp.rb b/Casks/hockeyapp.rb index d9edcd573d540..c6f995d2ee372 100644 --- a/Casks/hockeyapp.rb +++ b/Casks/hockeyapp.rb @@ -9,7 +9,7 @@ class Hockeyapp < Cask link 'HockeyApp.app' binary 'HockeyApp.app/Contents/Resources/puck' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'com.hockeyapp.mac', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end diff --git a/Casks/houdahspot.rb b/Casks/houdahspot.rb index dcb3145c757b2..b3e725fb9bcf9 100644 --- a/Casks/houdahspot.rb +++ b/Casks/houdahspot.rb @@ -8,7 +8,7 @@ class Houdahspot < Cask link 'HoudahSpot.app' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'com.houdah.HoudahSpot', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end diff --git a/Casks/intellij-idea-ce.rb b/Casks/intellij-idea-ce.rb index fa62049f1cdb7..66c7f128da731 100644 --- a/Casks/intellij-idea-ce.rb +++ b/Casks/intellij-idea-ce.rb @@ -7,7 +7,7 @@ class IntellijIdeaCe < Cask link 'IntelliJ IDEA 13 CE.app' - after_install do + postflight do system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/IntelliJ IDEA 13 CE.app/Contents/Info.plist" end diff --git a/Casks/intellij-idea.rb b/Casks/intellij-idea.rb index cc3df2c016d9c..470a612fada2d 100644 --- a/Casks/intellij-idea.rb +++ b/Casks/intellij-idea.rb @@ -7,7 +7,7 @@ class IntellijIdea < Cask link 'IntelliJ IDEA 13.app' - after_install do + postflight do system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/IntelliJ IDEA 13.app/Contents/Info.plist" end diff --git a/Casks/jabber-video.rb b/Casks/jabber-video.rb index 606ceec0e035e..a9a5cc22ce1e2 100644 --- a/Casks/jabber-video.rb +++ b/Casks/jabber-video.rb @@ -7,7 +7,7 @@ class JabberVideo < Cask link 'Jabber Video.app' - after_install do + postflight do system "/bin/rm", "#{destination_path}/Jabber Video.app/Contents/Resources/ForcedConfig.plist" end end diff --git a/Casks/java.rb b/Casks/java.rb index 8b89caa647a0a..a810dc2e6bd9e 100644 --- a/Casks/java.rb +++ b/Casks/java.rb @@ -9,7 +9,7 @@ class Java < Cask homepage 'http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html' install 'JDK 8 Update 20.pkg' - after_install do + postflight do system '/usr/bin/sudo', '-E', '--', '/usr/libexec/PlistBuddy', '-c', 'Add :JavaVM:JVMCapabilities: string BundledApp', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Info.plist" system '/usr/bin/sudo', '-E', '--', diff --git a/Casks/jxplorer.rb b/Casks/jxplorer.rb index 1141f9b7f6852..4001917295244 100644 --- a/Casks/jxplorer.rb +++ b/Casks/jxplorer.rb @@ -6,7 +6,7 @@ class Jxplorer < Cask homepage 'http://jxplorer.org' link 'jxplorer-3.3.1.app' - after_install do + postflight do system '/bin/chmod', '--', 'a+x', "#{destination_path}/jxplorer-3.3.1.app/Contents/MacOS/jxplorer" end end diff --git a/Casks/kaleidoscope.rb b/Casks/kaleidoscope.rb index ad2d453afc219..abc60c37b8db4 100644 --- a/Casks/kaleidoscope.rb +++ b/Casks/kaleidoscope.rb @@ -9,7 +9,7 @@ class Kaleidoscope < Cask link 'Kaleidoscope.app' binary 'Kaleidoscope.app/Contents/Resources/bin/ksdiff' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'com.blackpixel.kaleidoscope', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end diff --git a/Casks/macupdate-desktop.rb b/Casks/macupdate-desktop.rb index 7e0280eb5706f..024e1943af928 100644 --- a/Casks/macupdate-desktop.rb +++ b/Casks/macupdate-desktop.rb @@ -7,7 +7,7 @@ class MacupdateDesktop < Cask appcast 'https://www.macupdate.com/desktop/updates.xml' link 'MacUpdate Desktop.app' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'com.macupdate.desktop6', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end diff --git a/Casks/mamp.rb b/Casks/mamp.rb index 1b5a6378ac328..be8e2f32597a4 100644 --- a/Casks/mamp.rb +++ b/Casks/mamp.rb @@ -6,7 +6,7 @@ class Mamp < Cask homepage 'http://www.mamp.info/en/index.html' install 'MAMP_MAMP_PRO_3.0.6.pkg' - after_install do + postflight do system '/usr/bin/sudo', '-E', '--', '/usr/sbin/chown', '-R', '--', "#{Etc.getpwuid(Process.euid).name}:staff", '/Applications/MAMP', '/Applications/MAMP PRO' end diff --git a/Casks/nodeclipse.rb b/Casks/nodeclipse.rb index a4876fe440767..eeebe9907ea2d 100644 --- a/Casks/nodeclipse.rb +++ b/Casks/nodeclipse.rb @@ -5,7 +5,7 @@ class Nodeclipse < Cask url 'https://downloads.sourceforge.net/sourceforge/nodeclipse/Enide-Studio-2014-011-20140228-macosx-cocoa-x86_64.zip' homepage 'http://www.nodeclipse.org/' - before_install do + preflight do system '/bin/mv', '--', destination_path.join('eclipse/Eclipse.app'), destination_path.join('eclipse/Nodeclipse.app') end link 'eclipse/Nodeclipse.app' diff --git a/Casks/openarena.rb b/Casks/openarena.rb index 67d7aad4fe52b..d9c45ba1f21df 100644 --- a/Casks/openarena.rb +++ b/Casks/openarena.rb @@ -7,7 +7,7 @@ class Openarena < Cask link 'openarena-0.8.8/OpenArena.app' - after_install do + postflight do system '/bin/chmod', '--', '755', "#{destination_path}/openarena-0.8.8/OpenArena.app/Contents/MacOS/openarena.ub" end end diff --git a/Casks/parse.rb b/Casks/parse.rb index 1dbf307fbbef3..a2ba73573096e 100644 --- a/Casks/parse.rb +++ b/Casks/parse.rb @@ -8,7 +8,7 @@ class Parse < Cask binary 'parse' container_type :naked - after_install do + postflight do system "chmod", "755", "#{destination_path}/#{title}" end end diff --git a/Casks/path-finder.rb b/Casks/path-finder.rb index d8efae5ad769c..26bc70085df06 100644 --- a/Casks/path-finder.rb +++ b/Casks/path-finder.rb @@ -7,7 +7,7 @@ class PathFinder < Cask link 'Path Finder.app' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'com.cocoatech.PathFinder', 'kNTMoveToApplicationsFolderAlertSuppress', '-bool', 'true' end diff --git a/Casks/pd-extended.rb b/Casks/pd-extended.rb index fbf36d879b05a..71f37272094b7 100644 --- a/Casks/pd-extended.rb +++ b/Casks/pd-extended.rb @@ -7,7 +7,7 @@ class PdExtended < Cask link 'Pd-extended.app' - before_uninstall do + uninstall_preflight do system '/bin/chmod', '-R', '--', 'u+w', "#{destination_path}/Pd-extended.app" end end diff --git a/Casks/phpstorm.rb b/Casks/phpstorm.rb index 4b0d953d473d6..522296ee28400 100644 --- a/Casks/phpstorm.rb +++ b/Casks/phpstorm.rb @@ -7,7 +7,7 @@ class Phpstorm < Cask link 'PhpStorm.app' - after_install do + postflight do system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/PhpStorm.app/Contents/Info.plist" end end diff --git a/Casks/private-internet-access.rb b/Casks/private-internet-access.rb index ccb5f1e21f011..4721066afc740 100644 --- a/Casks/private-internet-access.rb +++ b/Casks/private-internet-access.rb @@ -5,7 +5,7 @@ class PrivateInternetAccess < Cask url 'https://www.privateinternetaccess.com/installer/installer_osx.dmg' homepage 'https://www.privateinternetaccess.com' - after_install do + postflight do system '/usr/bin/sudo', '-E', '--', "#{destination_path}/Private Internet Access Installer.app/Contents/MacOS/runner.sh" system '/usr/bin/sudo', '-E', '--', diff --git a/Casks/programmer-dvorak.rb b/Casks/programmer-dvorak.rb index 0ebc9c7ba3b8e..dcf4c6acbebfa 100644 --- a/Casks/programmer-dvorak.rb +++ b/Casks/programmer-dvorak.rb @@ -15,7 +15,7 @@ class ProgrammerDvorak < Cask '/private/var/folders/*/*/-Caches-/com.apple.IntlDataCache.le*' ] if MacOS.version >= :mavericks - after_install do + postflight do # clear the layout cache before new layouts are recognized # note: this will not work because the glob will not be expanded system '/bin/rm', '-f', '--', '/System/Library/Caches/com.apple.IntlDataCache.le*' diff --git a/Casks/pycharm-ce.rb b/Casks/pycharm-ce.rb index 7b507517599df..b6f0c0bd03a3d 100644 --- a/Casks/pycharm-ce.rb +++ b/Casks/pycharm-ce.rb @@ -7,7 +7,7 @@ class PycharmCe < Cask link 'PyCharm CE.app' - after_install do + postflight do system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/PyCharm CE.app/Contents/Info.plist" end end diff --git a/Casks/pycharm.rb b/Casks/pycharm.rb index 0eb226df0e284..335bf3b67e40e 100644 --- a/Casks/pycharm.rb +++ b/Casks/pycharm.rb @@ -7,7 +7,7 @@ class Pycharm < Cask link 'PyCharm.app' - after_install do + postflight do system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/PyCharm.app/Contents/Info.plist" end end diff --git a/Casks/qlmarkdown.rb b/Casks/qlmarkdown.rb index cf8070beacc85..f0262b0cf28f6 100644 --- a/Casks/qlmarkdown.rb +++ b/Casks/qlmarkdown.rb @@ -9,7 +9,7 @@ class Qlmarkdown < Cask # not needed for version 1.3.2. We could add an option to the main # DSL to identify such containers and generate a target directory. container_type :naked - before_install do + preflight do system '/usr/bin/ditto', '-xk', '--', "#{destination_path}/QLMarkdown.qlgenerator.zip", "#{destination_path}/QLMarkdown.qlgenerator" end diff --git a/Casks/quick-search-box.rb b/Casks/quick-search-box.rb index eb8636c04c46a..282708289380c 100644 --- a/Casks/quick-search-box.rb +++ b/Casks/quick-search-box.rb @@ -6,7 +6,7 @@ class QuickSearchBox < Cask homepage 'http://www.google.com/quicksearchbox/' link 'Quick Search Box.app' - after_install do + postflight do system '/bin/chmod', '-R', '--', 'u+w', destination_path end end diff --git a/Casks/ridibooks.rb b/Casks/ridibooks.rb index 0521c172c3a74..9cd9b9f1ea424 100644 --- a/Casks/ridibooks.rb +++ b/Casks/ridibooks.rb @@ -6,7 +6,7 @@ class Ridibooks < Cask homepage 'http://ridibooks.com/support/introduce_appdown' container_type :naked - before_install do + preflight do system '/bin/mv', '--', destination_path.join('getapp'), destination_path.join('ridibooks.pkg') end install 'ridibooks.pkg' diff --git a/Casks/rubymine.rb b/Casks/rubymine.rb index f611aa088b827..a9c2be232432f 100644 --- a/Casks/rubymine.rb +++ b/Casks/rubymine.rb @@ -7,7 +7,7 @@ class Rubymine < Cask link 'RubyMine.app' - after_install do + postflight do system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/RubyMine.app/Contents/Info.plist" end end diff --git a/Casks/screens-connect.rb b/Casks/screens-connect.rb index 05368d758d01b..ac467789e6dac 100644 --- a/Casks/screens-connect.rb +++ b/Casks/screens-connect.rb @@ -8,7 +8,7 @@ class ScreensConnect < Cask install 'Screens Connect.pkg' uninstall :script => 'Uninstall Screens Connect.app/Contents/Resources/sc-uninstaller.tool' - before_uninstall do + uninstall_preflight do system '/bin/chmod', '+x', "#{destination_path}/Uninstall Screens Connect.app/Contents/Resources/sc-uninstaller.tool" end end diff --git a/Casks/soulver.rb b/Casks/soulver.rb index 8ce692a044fb3..96cc8c8e6ab74 100644 --- a/Casks/soulver.rb +++ b/Casks/soulver.rb @@ -8,7 +8,7 @@ class Soulver < Cask link 'Soulver.app' - after_install do + postflight do # Don't ask to move the app bundle to /Applications system '/usr/bin/defaults', 'write', 'com.acqualia.soulver', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end diff --git a/Casks/td-toolbelt.rb b/Casks/td-toolbelt.rb index abd09df40958c..ff577815f2d8b 100644 --- a/Casks/td-toolbelt.rb +++ b/Casks/td-toolbelt.rb @@ -6,7 +6,7 @@ class TdToolbelt < Cask homepage 'http://toolbelt.treasuredata.com/' container_type :naked - before_install do + preflight do system '/bin/mv', '--', "#{destination_path}/mac", "#{destination_path}/td-toolbelt.pkg" end diff --git a/Casks/vmware-fusion.rb b/Casks/vmware-fusion.rb index 0aedf054afcc7..216c1b9039660 100644 --- a/Casks/vmware-fusion.rb +++ b/Casks/vmware-fusion.rb @@ -7,7 +7,7 @@ class VmwareFusion < Cask binary 'VMware Fusion.app/Contents/Library/vmrun' link 'VMware Fusion.app' - before_uninstall do + uninstall_preflight do system '/usr/bin/sudo', '-E', '--', '/usr/sbin/chown', '-R', '--', "#{Etc.getpwuid(Process.euid).name}:staff", "#{destination_path}/VMware Fusion.app" end diff --git a/Casks/voicemac.rb b/Casks/voicemac.rb index b4090673e94c6..c4c55984516a8 100644 --- a/Casks/voicemac.rb +++ b/Casks/voicemac.rb @@ -7,7 +7,7 @@ class Voicemac < Cask homepage 'https://mrgeckosmedia.com/applications/info/VoiceMac' link 'VoiceMac/VoiceMac.app' - after_install do + postflight do system '/bin/chmod', '--', 'a+r', "#{destination_path}/VoiceMac/VoiceMac.app/Contents/Info.plist" end end diff --git a/Casks/webstorm.rb b/Casks/webstorm.rb index 57da5bf9d17d5..51d735eab4214 100644 --- a/Casks/webstorm.rb +++ b/Casks/webstorm.rb @@ -7,7 +7,7 @@ class Webstorm < Cask link 'WebStorm.app' - after_install do + postflight do system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/WebStorm.app/Contents/Info.plist" end end diff --git a/Casks/wireshark.rb b/Casks/wireshark.rb index 64bb3f8d15374..8f85d57a5a9cc 100644 --- a/Casks/wireshark.rb +++ b/Casks/wireshark.rb @@ -11,7 +11,7 @@ class Wireshark < Cask x11_required end - after_install do + postflight do if Process.euid == 0 then ohai "Note:" puts <<-EOS.undent diff --git a/Casks/xquartz.rb b/Casks/xquartz.rb index fa877e9cab7e6..78ba772993843 100644 --- a/Casks/xquartz.rb +++ b/Casks/xquartz.rb @@ -8,7 +8,7 @@ class Xquartz < Cask install 'XQuartz.pkg' - after_install do + postflight do Pathname.new(File.expand_path('~')).join('Library', 'Logs').mkpath # Set default path to X11 = avoid the need of manual setup diff --git a/Casks/yojimbo.rb b/Casks/yojimbo.rb index fdf787e30ce1e..92b66e2d504e7 100644 --- a/Casks/yojimbo.rb +++ b/Casks/yojimbo.rb @@ -6,7 +6,7 @@ class Yojimbo < Cask homepage 'http://www.barebones.com/products/yojimbo/' link 'Yojimbo.app' - after_install do + postflight do system '/usr/bin/defaults', 'write', 'com.barebones.yojimbo4', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true' end end diff --git a/Casks/zeroxdbe-eap.rb b/Casks/zeroxdbe-eap.rb index 93e214ffad418..07a230f55d355 100644 --- a/Casks/zeroxdbe-eap.rb +++ b/Casks/zeroxdbe-eap.rb @@ -7,7 +7,7 @@ class ZeroxdbeEap < Cask link '0xDBE EAP.app' - after_install do + postflight do system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/0xDBE\ EAP.app/Contents/Info.plist" end end