downloadAndInstallTool :: (MonadIO m, MonadMask m, MonadLogger m, MonadReader env m, HasConfig env, HasHttpManager env, MonadBaseControl IO m)
                       => SetupInfo
                       -> DownloadInfo
                       -> PackageName
                       -> Version
                       -> (SetupInfo -> Path Abs File -> ArchiveType -> Path Abs Dir -> PackageIdentifier -> m ())
                       -> m PackageIdentifier
downloadAndInstallTool si downloadInfo name version installer = do
    let ident = PackageIdentifier name version
    (file, at) <- downloadFromInfo downloadInfo ident
    dir <- installDir ident
    unmarkInstalled ident
    installer si file at dir ident
    markInstalled ident
    return ident
downloadAndInstallTool :: (MonadIO m, MonadMask m, MonadLogger m, MonadReader env m, HasConfig env, HasHttpManager env, MonadBaseControl IO m)
                       => SetupInfo
                       -> DownloadInfo
                       -> PackageName
                       -> Version
                       -> (SetupInfo -> Path Abs File -> ArchiveType -> Path Abs Dir -> PackageIdentifier -> m ())
                       -> m PackageIdentifier
downloadAndInstallTool si downloadInfo name version installer = do
    let ident = PackageIdentifier name version
    (file, at) <- downloadFromInfo downloadInfo ident
    dir <- installDir ident
    unmarkInstalled ident
    installer si file at dir ident
    markInstalled ident
    return ident
downloadAndInstallTool si downloadInfo name version installer = do
    let ident = PackageIdentifier name version
    (file, at) <- downloadFromInfo downloadInfo ident
    dir <- installDir ident
    unmarkInstalled ident
    installer si file at dir ident
    markInstalled ident
    return ident