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 06d60d0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/winetricks
Original file line number Diff line number Diff line change
Expand Up @@ -9480,9 +9480,32 @@ 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

if [ "$(echo "${WINEUSERNAME}" | grep -i "^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}"
fi

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

if [ -n "${TMP_USERNAME}" ]; then
w_try rm "${W_DRIVE_C}/users/${TMP_USERNAME}"
fi

if [ -z "${WINEUSERNAME_COPY}" ]; then
unset WINEUSERNAME
else
WINEUSERNAME="${WINEUSERNAME_COPY}"
fi

w_restore_winver

# Doesn't install any ngen.exe
Expand Down

0 comments on commit 06d60d0

Please sign in to comment.