Jump to content











Photo
- - - - -

How to use more XML configuration files to start the unattended installation of Windows 7


  • Please log in to reply
No replies to this topic

#1 Marietto

Marietto

    Frequent Member

  • Advanced user
  • 267 posts
  • Location:Italy
  • Interests:Computers,movies,read/write,talking about philosophy and religion.
  •  
    Italy

Posted 12 October 2010 - 09:00 PM

I'm trying to make the unattended re-installation of Windows Seven 32 and 64 bit on the same partition where it had been previously installed. There could be 4 situations to handle :

1) The old installation of Windows Seven 32 bit had created an hidden 100 MB partition on (hd0,0),but the whole installation had been put on (hd0,1)

2) The old installation of Windows Seven 32 bit hadn't created the 100 MB hidden partition on (hd0,0),so that the whole installation had been put on (hd0,0)

3) The old installation of Windows Seven 64 bit had created an hidden 100 MB partition on (hd0,0),but the whole installation had been put on (hd0,1)

4) The old installation of Windows Seven 64 bit hadn't created the 100 MB hidden partition on (hd0,0),so that the whole installation had been put on (hd0,0)

For each situation to handle,there is a specific unattended configuration file to use. I created a basic autounattend.xml file and I have put it on the root of the CD/ROM :


autounattend.xml :


<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.micro...fig/2002/State" xmlns:xsi="http://www.w3.org/20...hema-instance">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Credentials />
<Path>c:\checkpartition.bat</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>
<cpi:offlineImage cpi:source="wim://marietto2008/edownloads/os/windows/7/sources/install.wim#Windows 7 ULTIMATE" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>


Now let's take in consideration the example n.1,when the old installation of Windows Seven 32 bit had created an hidden 100 MB partition. I have copied this batch file on (hd0,0) and I have named it as checkpartition.bat

checkpartition.bat

@echo off

cls
c:
cd \
if exist "C:\Windows" goto yeshp

:nohp

echo.
echo.
echo YOU ARE STARTING THE RE-INSTALLATION OF WINDOWS 7 ON THIS PC
echo.
echo It seems that you have an hidden partition on (hd0,0).
echo The reinstallation of Windows 7 will start from (hd0,1).
echo.
x:\setup.exe /unattend:c:\unattend_x32d0p1.xml

:yeshp

echo.
echo.
echo YOU ARE STARTING THE RE-INSTALLATION OF WINDOWS 7 ON THIS PC
echo.
echo It seems that you haven't an hidden partition on (hd0,0).
echo The reinstallation of Windows 7 will start from (hd0,0).
echo.
x:\setup.exe /unattend:c:\unattend_x32d0p2.xml


Also I have copied the files unattend_x32d0p1.xml and unattend_x32d0p2.xml on (hd0,0). This is the content :


unattend_x32d0p1.xml :


<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.micro...fig/2002/State" xmlns:xsi="http://www.w3.org/20...hema-instance">
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>en-US</UserLocale>
</component>
<component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.micro...fig/2002/State" xmlns:xsi="http://www.w3.org/20...hema-instance">
<DiskConfiguration>
<Disk wcm:action="add">
<DiskID>0</DiskID>
<WillWipeDisk>false</WillWipeDisk>
</Disk>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>1</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
<UserData>
<AcceptEula>false</AcceptEula>
<FullName>Windows</FullName>
<Organization>Windows</Organization>
</UserData>
</component>
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.micro...fig/2002/State" xmlns:xsi="http://www.w3.org/20...hema-instance">
<ComputerName>Windows</ComputerName>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.micro...fig/2002/State" xmlns:xsi="http://www.w3.org/20...hema-instance">
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Phase2</Description>
<CommandLine>c:\phase2.bat</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
</component>
</settings>
</unattend>


and unattend_x32d0p2.xml :


<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.micro...fig/2002/State" xmlns:xsi="http://www.w3.org/20...hema-instance">
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>en-US</UserLocale>
</component>
<component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.micro...fig/2002/State" xmlns:xsi="http://www.w3.org/20...hema-instance">
<DiskConfiguration>
<Disk wcm:action="add">
<DiskID>0</DiskID>
<WillWipeDisk>false</WillWipeDisk>
</Disk>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>2</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
<UserData>
<AcceptEula>false</AcceptEula>
<FullName>Windows</FullName>
<Organization>Windows</Organization>
</UserData>
</component>
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.micro...fig/2002/State" xmlns:xsi="http://www.w3.org/20...hema-instance">
<ComputerName>Windows</ComputerName>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.micro...fig/2002/State" xmlns:xsi="http://www.w3.org/20...hema-instance">
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Phase2</Description>
<CommandLine>c:\phase2.bat</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
</component>
</settings>
</unattend>


I have copied also the Windows 7 installation files on (hd0,1) and I have removed the folder Boot and the file bootmgr located on (hd0,0) so that the old installation of Windows 7 can't start anymore. When I start the reinstallation of Windows 7,it reads the autounattend.xml file from the CD/ROM and it stops the process before to do anything,because I've used a Synchronous command on the WinPE phase that should restart the installation giving to setup.exe the right unattended configuration files,unattend_x32d0p1.xml or unattend_x32d0p2.xml,depending if there is the hidden partition or not. But this solution does not work.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users