Skip to content

Commit

Permalink
fix(install): Add back arg $Name in Invoke-Installer() (ScoopInst…
Browse files Browse the repository at this point in the history
  • Loading branch information
niheaven authored and brian6932 committed Jun 1, 2024
1 parent af5f5df commit 70b7daa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
### Code Refactoring

- **install:** Separate archive extraction from downloader ([#5951](https://github.com/ScoopInstaller/Scoop/issues/5951))
- **install:** Replace 'run_(un)installer()' with 'Invoke-Installer()' ([#5968](https://github.com/ScoopInstaller/Scoop/issues/5968))
- **install:** Replace 'run_(un)installer()' with 'Invoke-Installer()' ([#5968](https://github.com/ScoopInstaller/Scoop/issues/5968), [#5971](https://github.com/ScoopInstaller/Scoop/issues/5971))

## [v0.4.1](https://github.com/ScoopInstaller/Scoop/compare/v0.4.0...v0.4.1) - 2024-04-25

Expand Down
9 changes: 7 additions & 2 deletions lib/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function install_app($app, $architecture, $global, $suggested, $use_cache = $tru
Invoke-Extraction -Path $dir -Name $fname -Manifest $manifest -ProcessorArchitecture $architecture
Invoke-HookScript -HookType 'pre_install' -Manifest $manifest -ProcessorArchitecture $architecture

Invoke-Installer -Path $dir -Manifest $manifest -ProcessorArchitecture $architecture -AppName $app -Global:$global
Invoke-Installer -Path $dir -Name $fname -Manifest $manifest -ProcessorArchitecture $architecture -AppName $app -Global:$global
ensure_install_dir_not_in_path $dir $global
$dir = link_current $dir
create_shims $manifest $dir $global $architecture
Expand Down Expand Up @@ -656,6 +656,8 @@ function Invoke-Installer {
param (
[string]
$Path,
[string[]]
$Name,
[psobject]
$Manifest,
[Alias('Arch', 'Architecture')]
Expand All @@ -673,7 +675,10 @@ function Invoke-Installer {
$installer = arch_specific $type $Manifest $ProcessorArchitecture
if ($installer.file -or $installer.args) {
# Installer filename is either explicit defined ('installer.file') or file name in the first URL
$progName = "$Path\$(coalesce $installer.file (url_filename @(url $manifest $architecture)[0]))"
if (!$Name) {
$Name = url_filename @(url $manifest $architecture)
}
$progName = "$Path\$(coalesce $installer.file $Name[0])"
if (!(is_in_dir $Path $progName)) {
abort "Error in manifest: $((Get-Culture).TextInfo.ToTitleCase($type)) $progName is outside the app directory."
} elseif (!(Test-Path $progName)) {
Expand Down

0 comments on commit 70b7daa

Please sign in to comment.