feat: Allow product key configuration (#275)
This commit is contained in:
parent
66d5c41083
commit
2dbed4ead7
3 changed files with 17 additions and 2 deletions
13
readme.md
13
readme.md
|
@ -174,7 +174,7 @@ The example folder `./example` will be available as ` \\host.lan\Data`.
|
|||
|
||||
By default, a user called `Docker` (with an empty password) is created during installation.
|
||||
|
||||
If you want to use different credentials, you can configure them (only BEFORE installation) in your compose file:
|
||||
If you want to use different credentials, you can configure them in your compose file (only before installation):
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
|
@ -197,7 +197,7 @@ The example folder `./example` will be available as ` \\host.lan\Data`.
|
|||
|
||||
### How do I select the keyboard layout?
|
||||
|
||||
If you want to use a keyboard layout or locale that is not the default for your selected language, before installation you can add `KEYBOARD` and `REGION` variables like this:
|
||||
If you want to use a keyboard layout or locale that is not the default for your selected language, you can add `KEYBOARD` and `REGION` variables like this (before installation):
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
|
@ -205,6 +205,15 @@ The example folder `./example` will be available as ` \\host.lan\Data`.
|
|||
KEYBOARD: "en-US"
|
||||
```
|
||||
|
||||
### How do I set the product key?
|
||||
|
||||
By default, an evaluation version of Windows will be installed, but if you have product key you can add a `KEY` variable like this (before installation):
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
KEY: "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
|
||||
```
|
||||
|
||||
### How do I install a custom image?
|
||||
|
||||
In order to download an unsupported ISO image, specify its URL in the `VERSION` environment variable:
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
: "${KEY:=""}"
|
||||
: "${WIDTH:=""}"
|
||||
: "${HEIGHT:=""}"
|
||||
: "${VERIFY:=""}"
|
||||
|
|
|
@ -681,6 +681,11 @@ updateXML() {
|
|||
sed -i "s/SERVERSTANDARD<\/Value>/SERVER${EDITION^^}<\/Value>/g" "$asset"
|
||||
fi
|
||||
|
||||
if [ -n "$KEY" ]; then
|
||||
sed -i '/<ProductKey>/,/<\/ProductKey>/d' "$asset"
|
||||
sed -i "s/<\/UserData>/ <ProductKey>\n <Key>${KEY}<\/Key>\n <WillShowUI>OnError<\/WillShowUI>\n <\/ProductKey>\n <\/UserData>/g" "$asset"
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue