1
0
mirror of https://github.com/dockur/windows.git synced 2026-07-27 21:42:36 +07:00

feat: Add option to disable shared folder shortcuts (#1928)

This commit is contained in:
Kroese
2026-07-21 18:46:45 +02:00
committed by GitHub
parent ef5ce4ad65
commit 21d628e924
3 changed files with 17 additions and 1 deletions
+1
View File
@@ -105,6 +105,7 @@ An empty default means the variable is unset and its value is determined automat
|---|---|---|
| `SAMBA` | `Y` | Enables the Samba shared folder. |
| `SAMBA_DEBUG` | `N` | Enables Samba debug output. |
| `SHORTCUT` | `Y` | Creates desktop and drive shortcuts to the shared folder. |
## ⚙️ System
+15
View File
@@ -604,6 +604,21 @@ updateXML() {
sed -i "s|</UserData>| <ProductKey>\n <Key>$key</Key>\n <WillShowUI>OnError</WillShowUI>\n </ProductKey>\n </UserData>|g" "$asset" || return 1
fi
if disabled "$SHORTCUT" || disabled "$SAMBA"; then
if ! sed -i -E '
/<SynchronousCommand([[:space:]>])/ {
:command
N
/<\/SynchronousCommand>/!b command
/<Description>Create desktop shortcut to shared folder<\/Description>/d
/<Description>Map shared folder<\/Description>/d
}
' "$asset"; then
error "Failed to remove shared folder shortcuts from answer file!"
return 1
fi
fi
if ! xmllint --nonet --noout "$asset"; then
error "The generated answer file is not valid XML!"
return 1
+1 -1
View File
@@ -18,6 +18,7 @@ set -Eeuo pipefail
: "${LANGUAGE:=""}"
: "${USERNAME:=""}"
: "${PASSWORD:=""}"
: "${SHORTCUT:=""}"
: "${DOMAIN_OU:=""}"
: "${WORKGROUP:=""}"
: "${AUTOLOGIN:=""}"
@@ -36,7 +37,6 @@ LANGUAGE=$(strip "$LANGUAGE")
USERNAME=$(strip "$USERNAME")
DOMAIN_OU=$(strip "$DOMAIN_OU")
WORKGROUP=$(strip "$WORKGROUP")
AUTOLOGIN=$(strip "$AUTOLOGIN")
MIRRORS=3