diff --git a/Library/Homebrew/cask/lib/hbc/installer.rb b/Library/Homebrew/cask/lib/hbc/installer.rb
index 3875e1c8feee2df0760c31b40bff4415a124ac0c..465011735e01677e454f6bde78fb0aabaa014d3d 100644
--- a/Library/Homebrew/cask/lib/hbc/installer.rb
+++ b/Library/Homebrew/cask/lib/hbc/installer.rb
@@ -141,8 +141,8 @@ module Hbc
 
       artifacts.each do |artifact|
         odebug "Installing artifact of class #{artifact}"
-        already_installed_artifacts.unshift(artifact)
         artifact.new(@cask, options).install_phase
+        already_installed_artifacts.unshift(artifact)
       end
     rescue StandardError => e
       begin