Skip to content

Commit 3a605bf

Browse files
committed
fix(prefix): restructure full_setup — purge first, then Proton, then pre-build prefix for winetricks
Bug: full_setup installed Proton THEN called purge(), which now removes Proton; all six launcher installs failed with 'Proton not found'. New order: stash data → purge (prefix + Proton) → install latest Proton → pre-build pfx with 'proton run cmd.exe /c exit' → init (winetricks now runs — prefix exists) → backup → install launchers → restore stash. The no-op cmd.exe run creates $WINEPREFIX/pfx/drive_c/windows/system32 so _install_winetricks_verbs is no longer skipped during init. This means vcrun/d3dx/cacerts/etc are installed before any launcher, giving every installer a properly prepared prefix.
1 parent db93141 commit 3a605bf

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

lib/prefix.sh

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -323,25 +323,32 @@ _install_with_fallback() {
323323
fi
324324
}
325325

326-
# Full setup: purge → init → install all launchers.
326+
# Full setup: purge → fresh Proton → pre-build prefix → init (verbs) → install all launchers.
327327
full_setup() {
328328
print_info "Running full setup..."
329329

330-
# One-click: install GE-Proton automatically if not present.
331-
if [ ! -x "$PROTON_DIR/proton" ]; then
332-
print_info "GE-Proton not found — installing latest automatically..."
333-
install_proton latest || { print_error "GE-Proton install failed; cannot continue."; return 1; }
334-
fi
335-
336-
# If a prefix already exists, back up launcher sessions before wiping.
330+
# Stash launcher data before purge removes the prefix.
337331
local _had_data=0
338332
if [ -d "$WINEPREFIX/pfx/drive_c" ]; then
339333
print_info "Preserving launcher data before purge (instant move — no compression)..."
340334
_stash_launcher_data && _had_data=1 || true
341335
fi
342336

343-
purge
344-
WIG_BULK=1 init "$@"
337+
purge # removes prefix AND existing GE-Proton installation
338+
339+
# Always install latest GE-Proton after a full purge.
340+
install_proton latest || { print_error "GE-Proton install failed; cannot continue."; return 1; }
341+
342+
# Pre-build the Proton prefix ($WINEPREFIX/pfx) with a no-op so that
343+
# winetricks can install verbs before any real launcher installer runs.
344+
print_warning "Building Proton prefix (no op command)..."
345+
mkdir -p "$WINE_DIR/steam-root" "$WINEPREFIX"
346+
STEAM_COMPAT_DATA_PATH="$WINEPREFIX" \
347+
STEAM_COMPAT_CLIENT_INSTALL_PATH="$WINE_DIR/steam-root" \
348+
PROTON_LOG=0 \
349+
"$PROTON_DIR/proton" run cmd.exe /c exit >/dev/null 2>&1 || true
350+
351+
WIG_BULK=1 init "$@" # winetricks verbs run here — prefix now exists
345352
backup
346353

347354
print_info "Installing all registered launchers..."
@@ -369,12 +376,6 @@ full_setup() {
369376
_unstash_launcher_data || true
370377
fi
371378

372-
# Prefix was built by the first launcher install above — now verbs can run.
373-
if [ -d "$WINEPREFIX/pfx/drive_c/windows/system32" ]; then
374-
print_info "Installing winetricks verbs..."
375-
_install_winetricks_verbs
376-
fi
377-
378379
print_success "Full setup complete"
379380
}
380381

0 commit comments

Comments
 (0)