installAction :: (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags)
              -> [String] -> Action
installAction (configFlags, _, installFlags, _) _ globalFlags
  | fromFlagOrDefault False (installOnly installFlags) = do
      let verbosity = fromFlagOrDefault normal (configVerbosity configFlags)
      (_, config) <- loadConfigOrSandboxConfig verbosity globalFlags
      distPref <- findSavedDistPref config (configDistPref configFlags)
      let setupOpts = defaultSetupScriptOptions { useDistPref = distPref }
      setupWrapper verbosity setupOpts Nothing installCommand (const mempty) []
installAction :: (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags)
              -> [String] -> Action
installAction (configFlags, _, installFlags, _) _ globalFlags
  | fromFlagOrDefault False (installOnly installFlags) = do
      let verbosity = fromFlagOrDefault normal (configVerbosity configFlags)
      (_, config) <- loadConfigOrSandboxConfig verbosity globalFlags
      distPref <- findSavedDistPref config (configDistPref configFlags)
      let setupOpts = defaultSetupScriptOptions { useDistPref = distPref }
      setupWrapper verbosity setupOpts Nothing installCommand (const mempty) []
installAction (configFlags, _, installFlags, _) _ globalFlags
  | fromFlagOrDefault False (installOnly installFlags) = do
      let verbosity = fromFlagOrDefault normal (configVerbosity configFlags)
      (_, config) <- loadConfigOrSandboxConfig verbosity globalFlags
      distPref <- findSavedDistPref config (configDistPref configFlags)
      let setupOpts = defaultSetupScriptOptions { useDistPref = distPref }
      setupWrapper verbosity setupOpts Nothing installCommand (const mempty) []