Skip to content

Commit

Permalink
tweak removal of ALL previous shortcuts, also on reconfigure (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
mintty committed Mar 5, 2020
1 parent 9ae697a commit 00c4c2f
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions config-distros.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,6 @@ case "$1" in
shift;;
-shortcuts-remove)
remove=true

(cd "$INSTDIR"
for lnk in *.lnk
do
if cmd /C comp/M "$lnk" "%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\$lnk"
then cmd /C del "%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\$lnk"
fi
done
for bat in *.bat
do
if cmd /C comp/M "$bat" "%LOCALAPPDATA%\\Microsoft\\WindowsApps\\$bat"
then cmd /C del "%LOCALAPPDATA%\\Microsoft\\WindowsApps\\$bat"
fi
done
)

shift;;
-contextmenu)
contextmenu=true
Expand Down Expand Up @@ -92,6 +76,25 @@ case "$1" in
shift;;
esac

if $config && ! $contextmenu
then
# remove shortcut entries in Start menu and cmd-line bat shortcuts
(cd "$INSTDIR"
for lnk in *.lnk
do
if cmd /C comp/M "$lnk" "%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\$lnk"
then cmd /C del "%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\$lnk"
fi
done
for bat in *.bat
do
if cmd /C comp/M "$bat" "%LOCALAPPDATA%\\Microsoft\\WindowsApps\\$bat"
then cmd /C del "%LOCALAPPDATA%\\Microsoft\\WindowsApps\\$bat"
fi
done
)
fi

# test w/o WSL: call this script with REGTOOLFAKE=true dash config-distros.sh
if ${REGTOOLFAKE:-false}
then
Expand Down

0 comments on commit 00c4c2f

Please sign in to comment.