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 2229def
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/winetricks
Original file line number Diff line number Diff line change
Expand Up @@ -9480,9 +9480,24 @@ 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_NAME="$(mktemp)"
TMP_USERNAME="$(basename ${TMP_NAME})"
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}"
w_try rm "${TMP_NAME}"
fi

w_restore_winver

# Doesn't install any ngen.exe
Expand Down

0 comments on commit 2229def

Please sign in to comment.