Allow architecture specific shortcuts for special cases like dont-sleep or mpc-hc

This commit is contained in:
Richard Kuhnt
2017-05-23 22:28:49 +02:00
parent a4d44ac8f0
commit 884a7a3361
4 changed files with 11 additions and 6 deletions
+1 -1
View File
@@ -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
+6 -4
View File
@@ -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)"
+1 -1
View File
@@ -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
+3
View File
@@ -97,6 +97,9 @@
"pre_install": {
"$ref": "#/definitions/stringOrArrayOfStrings"
},
"shortcuts": {
"$ref": "#/definitions/arrayOfArrayOfStrings"
},
"uninstaller": {
"$ref": "#/definitions/uninstaller"
},