Skip to content

Commit 8dac9a7

Browse files
committed
fix(install): Add back arg $Name in Invoke-Installer() (#5971)
1 parent 008095a commit 8dac9a7

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
### Code Refactoring
1616

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

2020
## [v0.4.2](https://github.com/ScoopInstaller/Scoop/compare/v0.4.1...v0.4.2) - 2024-05-14
2121

lib/install.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function install_app($app, $architecture, $global, $suggested, $use_cache = $tru
5353
Invoke-Extraction -Path $dir -Name $fname -Manifest $manifest -ProcessorArchitecture $architecture
5454
Invoke-HookScript -HookType 'pre_install' -Manifest $manifest -ProcessorArchitecture $architecture
5555

56-
Invoke-Installer -Path $dir -Manifest $manifest -ProcessorArchitecture $architecture -AppName $app -Global:$global
56+
Invoke-Installer -Path $dir -Name $fname -Manifest $manifest -ProcessorArchitecture $architecture -AppName $app -Global:$global
5757
ensure_install_dir_not_in_path $dir $global
5858
$dir = link_current $dir
5959
create_shims $manifest $dir $global $architecture
@@ -656,6 +656,8 @@ function Invoke-Installer {
656656
param (
657657
[string]
658658
$Path,
659+
[string[]]
660+
$Name,
659661
[psobject]
660662
$Manifest,
661663
[Alias('Arch', 'Architecture')]
@@ -673,7 +675,10 @@ function Invoke-Installer {
673675
$installer = arch_specific $type $Manifest $ProcessorArchitecture
674676
if ($installer.file -or $installer.args) {
675677
# Installer filename is either explicit defined ('installer.file') or file name in the first URL
676-
$progName = "$Path\$(coalesce $installer.file (url_filename @(url $manifest $architecture)[0]))"
678+
if (!$Name) {
679+
$Name = url_filename @(url $manifest $architecture)
680+
}
681+
$progName = "$Path\$(coalesce $installer.file $Name[0])"
677682
if (!(is_in_dir $Path $progName)) {
678683
abort "Error in manifest: $((Get-Culture).TextInfo.ToTitleCase($type)) $progName is outside the app directory."
679684
} elseif (!(Test-Path $progName)) {

0 commit comments

Comments
 (0)