Skip to content

Commit a14063e

Browse files
committed
fix(prefix,shortcuts,setup): skip installed winetricks verbs; install-shortcut all --reinstall
prefix.sh: pre-fetch 'winetricks list-installed' once before the fast verb loop. Verbs already present are printed as 'already installed' and skipped with no winetricks invocation. Only missing verbs go through the install+retry path. Saves the full re-install time on wig init / wig quick when the prefix is already set up. shortcuts.sh: create_all_shortcuts() accepts an optional --reinstall flag. Without it (current behaviour) only launchers with a detectable exe get shortcuts. With --reinstall, shortcuts are created for all APP_REGISTRY entries regardless of install status — useful for updating the .desktop template (e.g. after the StartupNotify fix) on a fresh or mid-setup prefix. setup: install-shortcut all --reinstall now routes through create_all_shortcuts --reinstall.
1 parent 496a28f commit a14063e

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

lib/prefix.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,17 @@ _install_winetricks_verbs() {
4545
export LD_LIBRARY_PATH="$PROTON_DIR/files/lib:$PROTON_DIR/files/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
4646

4747
print_info "Installing fast winetricks verbs (${#fast_verbs[@]} packages)..."
48+
# Pre-fetch installed verbs once; avoids reinstalling on quick/init runs.
49+
local _installed_verbs
50+
_installed_verbs=$(WINETRICKS_LATEST_VERSION_CHECK=disabled winetricks list-installed 2>/dev/null || true)
51+
4852
local v _ok
4953
for v in "${fast_verbs[@]}"; do
5054
printf " → %s ... " "$v"
55+
if echo "$_installed_verbs" | grep -qx "$v" 2>/dev/null; then
56+
echo "already installed"
57+
continue
58+
fi
5159
_ok=0
5260
for _try in 1 2; do
5361
WINETRICKS_LATEST_VERSION_CHECK=disabled \

lib/shortcuts.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,15 @@ remove_shortcut() {
237237
# Recreate shortcuts for every installed launcher.
238238
# Skips apps not currently present in the prefix.
239239
create_all_shortcuts() {
240-
print_info "Recreating shortcuts for all installed launchers..."
240+
local _force="${1:-}"
241+
if [ "$_force" = "--reinstall" ]; then
242+
print_info "Recreating shortcuts for all registered launchers (--reinstall: ignoring install status)..."
243+
else
244+
print_info "Recreating shortcuts for all installed launchers..."
245+
fi
241246
local created=0 skipped=0
242247
for app_key in "${!APP_REGISTRY[@]}"; do
243-
if find_app_exe "$app_key" >/dev/null 2>&1; then
248+
if [ "$_force" = "--reinstall" ] || find_app_exe "$app_key" >/dev/null 2>&1; then
244249
create_shortcut "$app_key" && ((created++)) || true
245250
else
246251
((skipped++))

setup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ main() {
176176
install-shortcut)
177177
shift
178178
if [ "$1" = "all" ]; then
179-
create_all_shortcuts
179+
create_all_shortcuts "${2:-}"
180180
elif [[ "$1" == /* || "$1" == ./* || "${1,,}" == *.exe || "${1,,}" == *.lnk ]]; then
181181
create_external_shortcut "$@"
182182
else

0 commit comments

Comments
 (0)