mirror of
https://github.com/dockur/windows.git
synced 2026-08-24 07:39:00 +01:00
fix: Handle answer files without product keys (#2097)
This commit is contained in:
+9
-1
@@ -1198,7 +1198,15 @@ removeEmbeddedProductKeys() {
|
||||
|
||||
local product_keys='//u:ProductKey'
|
||||
local separator=$'\x1f' delete_xpath=""
|
||||
local records position child_key direct_key
|
||||
local count records position child_key direct_key
|
||||
|
||||
count=$(xmlstarlet sel \
|
||||
-N "$XML_NS_UNATTEND_ARG" -T -t \
|
||||
-v "count($product_keys)" \
|
||||
"$asset") || return 1
|
||||
|
||||
[[ "$count" =~ ^[0-9]+$ ]] || return 1
|
||||
(( count == 0 )) && return 0
|
||||
|
||||
records=$(xmlstarlet sel \
|
||||
-N "$XML_NS_UNATTEND_ARG" -T -t \
|
||||
|
||||
Reference in New Issue
Block a user