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 Feb 27, 2024
1 parent 61b5e46 commit 60221c2
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/winetricks
Original file line number Diff line number Diff line change
Expand Up @@ -9480,9 +9480,22 @@ load_dotnet35sp1()
w_try_cd "${W_TMP}"
w_try ln -s "${W_CACHE}/${W_PACKAGE}/${file1}" .

WINEDLLOVERRIDES="ngen.exe=n" w_try_ms_installer "${WINE}" dotnetfx35.exe /lang:ENU ${W_OPT_UNATTENDED:+/q}
# Workaround for "You do not have sufficient rights to run this application" error if the username is "guest".
TMP_USERNAME="$(echo ${USERNAME} | tr '[:upper:]' '[:lower:]')"
if [ "${TMP_USERNAME}" = "guest" ]; then
TMP_USERNAME="$(basename $(mktemp -u))"
w_try ln -s "${W_DRIVE_C}/users/${USERNAME}" "${W_DRIVE_C}/users/${TMP_USERNAME}"
else
TMP_USERNAME="${USERNAME}"
fi

WINEUSERNAME="${TMP_USERNAME}" 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}"
fi

w_restore_winver

# Doesn't install any ngen.exe
Expand Down

0 comments on commit 60221c2

Please sign in to comment.