diff --git a/lib/install.ps1 b/lib/install.ps1 index 4208571ef..e09a608f8 100644 --- a/lib/install.ps1 +++ b/lib/install.ps1 @@ -44,7 +44,7 @@ function install_app($app, $architecture, $global, $suggested) { ensure_install_dir_not_in_path $dir $global $dir = link_current $dir create_shims $manifest $dir $global $architecture - create_startmenu_shortcuts $manifest $dir $global + create_startmenu_shortcuts $manifest $dir $global $architecture install_psmodule $manifest $dir $global if($global) { ensure_scoop_in_path $global } # can assume local scoop is in path env_add_path $manifest $dir $global diff --git a/lib/shortcuts.ps1 b/lib/shortcuts.ps1 index eccca5005..cf0030a82 100644 --- a/lib/shortcuts.ps1 +++ b/lib/shortcuts.ps1 @@ -1,6 +1,7 @@ # Creates shortcut for the app in the start menu -function create_startmenu_shortcuts($manifest, $dir, $global) { - $manifest.shortcuts | ?{ $_ -ne $null } | % { +function create_startmenu_shortcuts($manifest, $dir, $global, $arch) { + $shortcuts = @(arch_specific 'shortcuts' $manifest $arch) + $shortcuts | ?{ $_ -ne $null } | % { $target = $_.item(0) $name = $_.item(1) startmenu_shortcut "$dir\$target" $name @@ -28,8 +29,9 @@ function startmenu_shortcut($target, $shortcutName) { } # Removes the Startmenu shortcut if it exists -function rm_startmenu_shortcuts($manifest, $global) { - $manifest.shortcuts | ?{ $_ -ne $null } | % { +function rm_startmenu_shortcuts($manifest, $global, $arch) { + $shortcuts = @(arch_specific 'shortcuts' $manifest $arch) + $shortcuts | ?{ $_ -ne $null } | % { $name = $_.item(1) $shortcut = "$(shortcut_folder)\$name.lnk" write-host "Removing shortcut $(friendly_path $shortcut)" diff --git a/libexec/scoop-uninstall.ps1 b/libexec/scoop-uninstall.ps1 index cc0e56a97..a8bb504d7 100644 --- a/libexec/scoop-uninstall.ps1 +++ b/libexec/scoop-uninstall.ps1 @@ -68,7 +68,7 @@ foreach($app in $apps) { run_uninstaller $manifest $architecture $dir rm_shims $manifest $global $architecture - rm_startmenu_shortcuts $manifest $global + rm_startmenu_shortcuts $manifest $global $architecture # If a junction was used during install, that will have been used # as the reference directory. Otherwise it will just be the version diff --git a/schema.json b/schema.json index c239c5666..1fd2b651b 100644 --- a/schema.json +++ b/schema.json @@ -97,6 +97,9 @@ "pre_install": { "$ref": "#/definitions/stringOrArrayOfStrings" }, + "shortcuts": { + "$ref": "#/definitions/arrayOfArrayOfStrings" + }, "uninstaller": { "$ref": "#/definitions/uninstaller" },