Skip to content

Commit

Permalink
dotnet35sp1: Workaround for error if the username is "guest"
Browse files Browse the repository at this point in the history
  • Loading branch information
SurenIV committed Mar 26, 2024
1 parent f87bf9e commit 7ab1d88
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/winetricks
Original file line number Diff line number Diff line change
Expand Up @@ -9480,9 +9480,33 @@ load_dotnet35sp1()
w_try_cd "${W_TMP}"
w_try ln -s "${W_CACHE}/${W_PACKAGE}/${file1}" .

# Workaround for "You do not have sufficient rights to run this application" error if the username is "guest".
if [ -n "${WINEUSERNAME}" ]; then
WINEUSERNAME_COPY="${WINEUSERNAME}"
else
WINEUSERNAME="${USERNAME}"
fi

TMP_USERNAME="$(echo '${WINEUSERNAME}' | tr '[:upper:]' '[:lower:]')"

if [ "${TMP_USERNAME}" = "guest" ]; then
TMP_USERNAME="$(basename '$(mktemp -u)')"
w_try ln -s "${W_DRIVE_C}/users/${WINEUSERNAME}" "${W_DRIVE_C}/users/${TMP_USERNAME}"
export WINEUSERNAME="${TMP_USERNAME}"
else
TMP_USERNAME="${USERNAME}"
fi

WINEDLLOVERRIDES="ngen.exe=n" w_try_ms_installer "${WINE}" dotnetfx35.exe /lang:ENU ${W_OPT_UNATTENDED:+/q}
w_try rm dotnetfx35.exe

if [ "${TMP_USERNAME}" != "${USERNAME}" ]; then
w_try rm "${W_DRIVE_C}/users/${TMP_USERNAME}"
WINEUSERNAME="${WINEUSERNAME_COPY}"
fi

[ -n "${WINEUSERNAME}" ] || unset WINEUSERNAME

w_restore_winver

# Doesn't install any ngen.exe
Expand Down

0 comments on commit 7ab1d88

Please sign in to comment.