Commit 66d6f798 authored by Nurlan's avatar Nurlan

- winetricks: update for previous patch with "work workaround for guest user…

- winetricks: update for previous patch with "work workaround for guest user (eterbug #17026) (github #2203)"
parent a72356cf
From 49995a0022b81bef51c1dc0f7e911a06f66ef28d Mon Sep 17 00:00:00 2001
From fba388e7e6a18f1eb575e5e98f6998f1f02b1413 Mon Sep 17 00:00:00 2001
From: Nurlan Usenov <suren@etersoft.ru>
Date: Tue, 27 Feb 2024 17:18:23 +0300
Subject: [PATCH] dotnet35sp1: Workaround for error if the username is "guest"
---
src/winetricks | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
src/winetricks | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/src/winetricks b/src/winetricks
index 05b6683d8..012db2210 100755
index 4544e3d..374c2bd 100755
--- a/src/winetricks
+++ b/src/winetricks
@@ -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".
@@ -1346,6 +1346,36 @@ w_dotnet_verify()
w_info ".Net Verifier returned ${dn_status}"
}
+# Workaround for "You do not have sufficient rights to run this application" error if the username is "guest".
+w_replace_username_guest()
+{
+ if [ -n "${WINEUSERNAME}" ]; then
+ WINEUSERNAME_COPY="${WINEUSERNAME}"
+ else
+ WINEUSERNAME="${USERNAME}"
+ fi
+
+ if "$(echo "${WINEUSERNAME}" | grep -q -i "^guest$")"; then
+ if echo "${WINEUSERNAME}" | grep -q -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
+# Restore username if it has been changed in w_replace_username_guest
+w_restore_username()
+{
+ if [ -n "${TMP_USERNAME}" ]; then
+ w_try rm "${W_DRIVE_C}/users/${TMP_USERNAME}"
+ fi
......@@ -40,7 +43,73 @@ index 05b6683d8..012db2210 100755
+ else
+ WINEUSERNAME="${WINEUSERNAME_COPY}"
+ fi
+}
+
# Checks if the user can run the self-update/rollback commands
winetricks_check_update_availability()
{
@@ -9297,8 +9327,10 @@ load_dotnet20sp1()
w_set_winver winxp
fi
+ w_replace_username_guest
w_try_cd "${W_CACHE}/${W_PACKAGE}"
w_try_ms_installer "${WINE}" "${exe}" ${W_OPT_UNATTENDED:+/q}
+ w_restore_username
if [ "${W_ARCH}" = "win32" ]; then
# We can't stop installing dotnet20sp1 in win2k mode until Wine supports
@@ -9358,8 +9390,10 @@ load_dotnet20sp2()
exe="NetFx20SP2_x64.exe"
fi
+ w_replace_username_guest
w_try_cd "${W_CACHE}/${W_PACKAGE}"
w_try_ms_installer "${WINE}" "${exe}" ${W_OPT_UNATTENDED:+ /q /c:"install.exe /q"}
+ w_restore_username
if [ "${W_ARCH}" = "win32" ]; then
# We can't stop installing dotnet20sp1 in win2k mode until Wine supports
@@ -9443,9 +9477,11 @@ load_dotnet30()
WINEDLLOVERRIDES="ngen.exe,mscorsvw.exe=b;${WINEDLLOVERRIDES}"
export WINEDLLOVERRIDES
+ w_replace_username_guest
w_try_cd "${W_CACHE}/${W_PACKAGE}"
w_warn "Installing .NET 3.0 runtime silently, as otherwise it gets hidden behind taskbar. Installation usually takes about 3 minutes."
w_try "${WINE}" "${file1}" /q /c:"install.exe /q"
+ w_restore_username
w_override_dlls native mscorwks
w_restore_winver
@@ -9497,7 +9533,9 @@ load_dotnet30sp1()
"${WINE}" sc delete FontCache3.0.0.0
+ w_replace_username_guest
w_try_ms_installer "${WINE}" "${file1}" ${W_OPT_UNATTENDED:+/q}
+ w_restore_username
w_override_dlls native mscorwks
w_restore_winver
@@ -9543,8 +9581,10 @@ load_dotnet35()
w_override_dlls native mscoree mscorwks
w_wineserver -w
+ w_replace_username_guest
w_try_cd "${W_CACHE}/${W_PACKAGE}"
w_try_ms_installer "${WINE}" "${file1}" /lang:ENU ${W_OPT_UNATTENDED:+/q}
+ w_restore_username
w_restore_winver
# Doesn't install any ngen.exe
@@ -9597,8 +9637,10 @@ load_dotnet35sp1()
w_try_cd "${W_TMP}"
w_try ln -s "${W_CACHE}/${W_PACKAGE}/${file1}" .
+ w_replace_username_guest
WINEDLLOVERRIDES="ngen.exe=n" w_try_ms_installer "${WINE}" dotnetfx35.exe /lang:ENU ${W_OPT_UNATTENDED:+/q}
w_try rm dotnetfx35.exe
+ w_restore_username
w_restore_winver
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment