[PATCH 1/2] Adapt windows-unattend.xml for Windows 8

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

 



From: "Zeeshan Ali (Khattak)" <zeeshanak@xxxxxxxxx>

We still can't use this script directly for Windows 8 though as product
key is once again mandatory in Windows 8.
---
 data/install-scripts/windows-unattend.xml | 74 +++++++++++++++++++------------
 1 file changed, 46 insertions(+), 28 deletions(-)

diff --git a/data/install-scripts/windows-unattend.xml b/data/install-scripts/windows-unattend.xml
index d8c7563..baf4d59 100644
--- a/data/install-scripts/windows-unattend.xml
+++ b/data/install-scripts/windows-unattend.xml
@@ -129,12 +129,14 @@
 		</DiskConfiguration>
 		<ImageInstall>
 		  <OSImage>
-		    <InstallFrom>
-		      <MetaData wcm:action="add">
-			<Key>/IMAGE/INDEX</Key>
-			<Value>1</Value>
-		      </MetaData>
-		    </InstallFrom>
+                    <xsl:if test="os/version &lt; 6.2">
+		      <InstallFrom>
+		        <MetaData wcm:action="add">
+			  <Key>/IMAGE/INDEX</Key>
+			  <Value>1</Value>
+		        </MetaData>
+		      </InstallFrom>
+                    </xsl:if>
 		    <InstallTo>
 		      <DiskID>0</DiskID>
 		      <PartitionID>1</PartitionID>
@@ -144,6 +146,11 @@
 		</ImageInstall>
 		<UserData>
 		  <AcceptEula>true</AcceptEula>
+                  <xsl:if test="os/version &gt; 6.1">
+                    <ProductKey>
+                      <Key><xsl:value-of select="config/reg-product-key"/></Key>
+                    </ProductKey>
+                  </xsl:if>
 		</UserData>
 	      </component>
 	      <component name="Microsoft-Windows-International-Core-WinPE" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
@@ -215,15 +222,17 @@
 		</FirstLogonCommands>
 	      </component>
 	    </settings>
-	    <settings pass="specialize">
-	      <component name="Microsoft-Windows-Shell-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
-		<xsl:attribute name="processorArchitecture">
-		  <xsl:call-template name="arch"/>
-		</xsl:attribute>
+            <xsl:if test="os/version &lt; 6.2">
+	      <settings pass="specialize">
+	        <component name="Microsoft-Windows-Shell-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+		  <xsl:attribute name="processorArchitecture">
+		    <xsl:call-template name="arch"/>
+		  </xsl:attribute>
 
-		<ProductKey><xsl:value-of select="config/reg-product-key"/></ProductKey>
-	      </component>
-	    </settings>
+		  <ProductKey><xsl:value-of select="config/reg-product-key"/></ProductKey>
+	        </component>
+	      </settings>
+            </xsl:if>
 	  </unattend>
 	</xsl:template>
       </xsl:stylesheet>
@@ -365,12 +374,14 @@
          </DiskConfiguration>
          <ImageInstall>
           <OSImage>
-           <InstallFrom>
-            <MetaData wcm:action="add">
-             <Key>/IMAGE/INDEX</Key>
-             <Value>1</Value>
-            </MetaData>
-           </InstallFrom>
+           <xsl:if test="os/version &lt; 6.2">
+            <InstallFrom>
+             <MetaData wcm:action="add">
+              <Key>/IMAGE/INDEX</Key>
+              <Value>1</Value>
+             </MetaData>
+            </InstallFrom>
+           </xsl:if>
            <InstallTo>
             <DiskID>0</DiskID>
             <PartitionID>1</PartitionID>
@@ -380,6 +391,11 @@
          </ImageInstall>
          <UserData>
           <AcceptEula>true</AcceptEula>
+          <xsl:if test="os/version &gt; 6.1">
+           <ProductKey>
+            <Key><xsl:value-of select="config/reg-product-key"/></Key>
+           </ProductKey>
+          </xsl:if>
          </UserData>
         </component>
         <component name="Microsoft-Windows-International-Core-WinPE" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
@@ -460,15 +476,17 @@
          </xsl:if>
         </component>
        </settings>
-       <settings pass="specialize">
-        <component name="Microsoft-Windows-Shell-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
-         <xsl:attribute name="processorArchitecture">
-          <xsl:call-template name="arch"/>
-         </xsl:attribute>
+       <xsl:if test="os/version &lt; 6.2">
+        <settings pass="specialize">
+         <component name="Microsoft-Windows-Shell-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+          <xsl:attribute name="processorArchitecture">
+           <xsl:call-template name="arch"/>
+          </xsl:attribute>
 
-         <ProductKey><xsl:value-of select="config/reg-product-key"/></ProductKey>
-        </component>
-       </settings>
+          <ProductKey><xsl:value-of select="config/reg-product-key"/></ProductKey>
+         </component>
+        </settings>
+       </xsl:if>
       </unattend>
      </xsl:template>
     </xsl:stylesheet>
-- 
1.8.0.2

_______________________________________________
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