[PATCH 09/10] win, installer: Improve "setting product key" logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Only a few variants of Windows 8 and Windows 8.1, like Enterprise,
Enterprise Debug and Professioanl, have to have the ProductKey skipped
during the WindowsPE phase of the installation script.

This patch re-writes the "skipping ProductKey" logic in a cleaner way
(that will also work for Windows 10).

Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
---
 .../microsoft.com/windows-unattend-desktop.xml.in   | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/data/install-script/microsoft.com/windows-unattend-desktop.xml.in b/data/install-script/microsoft.com/windows-unattend-desktop.xml.in
index a207c1d..3d58a88 100644
--- a/data/install-script/microsoft.com/windows-unattend-desktop.xml.in
+++ b/data/install-script/microsoft.com/windows-unattend-desktop.xml.in
@@ -150,17 +150,22 @@
          <UserData>
           <AcceptEula>true</AcceptEula>
           <xsl:choose>
-            <xsl:when test="os/version &lt; 6.2"> <!-- Windows 7 and older -->
+            <xsl:when test="os/version = 6.2 or os/version = 6.3"> <!-- Windwos 8 and Windows 8.1 -->
+              <xsl:choose>
+                <xsl:when test="count(media/variant != 0) and (contains(media/variant, 'enterprise') or contains(media/variant, 'professional'))">
+                  <!-- Skip the ProductKey during this phase of the script for the following variants: Enterprise, Enterprise Debug and Professional -->
+                </xsl:when>
+                <xsl:otherwise>
+                  <ProductKey>
+                    <Key><xsl:value-of select="config/reg-product-key"/></Key>
+                  </ProductKey>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:when>
+            <xsl:otherwise>
               <ProductKey>
                 <Key><xsl:value-of select="config/reg-product-key"/></Key>
               </ProductKey>
-            </xsl:when>
-            <xsl:otherwise> <!-- Windows 8 and 8.1 -->
-              <xsl:if test="count(media/variant) = 0 or (contains(media/variant, 'debug') and not(contains(media/variant, 'enterprise')))"> <!-- "No Variant" or "Debug" variant -->
-                <ProductKey>
-                  <Key><xsl:value-of select="config/reg-product-key"/></Key>
-                </ProductKey>
-              </xsl:if>
             </xsl:otherwise>
           </xsl:choose>
          </UserData>
-- 
2.7.4

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux