質問

I've made an XMLNS file with Windows System Image Manager tool included in the WAIK package, the XMLNS file is to unattended install Windows 8.1, well now I would like to add some variables in the XMLNS file to set up some values like the UserName, the ComputerName or the ProductKey.

I just need an example of how to set a variable and use it inside the attribute that I want.

For example, set a variable (this is pseudo code 'cause I don't know how to set the var):

<ComputerNameVariable>MyPc</ComputerNameVariable>

And then use the variable in the right attribute (pseudo code too):

...
<ComputerName><%= ComputerNameVariable %></ComputerName>
...

Then when the Windows installation is gonna process the XMLNS file to make the unattended installation it should read the variable value that I've previously set into the attribute so the computer name for the installation should be in this case MyPc

This is possibly to do?

PS: I've read something about XSLT but I don't know if that is compatible with this or how to integrate it, sorry, I'm an XML newbie.

This is the entire XMLNS file:

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <servicing>
        <package action="configure">
            <assemblyIdentity name="Microsoft-Windows-CoreEdition" version="6.2.9200.16384" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="" />
            <selection name="Microsoft-Windows-Printing-XPSServices-Package" state="false" />
        </package>
        <package action="configure">
            <assemblyIdentity name="Microsoft-Windows-Client-LanguagePack-Package" version="6.2.9200.16384" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="es-ES" />
        </package>
        <package action="configure">
            <assemblyIdentity name="Microsoft-Windows-Foundation-Package" version="6.2.9200.16384" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="" />
            <selection name="Printing-XPSServices-Features" state="false" />
            <selection name="Printing-Foundation-InternetPrinting-Client" state="false" />
            <selection name="FaxServicesClientPackage" state="false" />
        </package>
    </servicing>
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <UserLocale>es-ES</UserLocale>
            <UILanguageFallback>es-ES</UILanguageFallback>
            <UILanguage>es-ES</UILanguage>
            <SystemLocale>es-ES</SystemLocale>
            <InputLocale>es-ES</InputLocale>
        </component>
        <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <Display>
                <HorizontalResolution>1920</HorizontalResolution>
                <VerticalResolution>1080</VerticalResolution>
                <ColorDepth>32</ColorDepth>
            </Display>
            <UserData>
                <ProductKey>
                    <WillShowUI>Never</WillShowUI>
                    <Key>334NH-RXG76-64THK-C7CKG-D3VPT</Key>
                </ProductKey>
                <AcceptEula>true</AcceptEula>
                <Organization>Elektro Studios</Organization>
                <FullName>Christian Soriano</FullName>
            </UserData>
            <EnableNetwork>true</EnableNetwork>
            <EnableFirewall>true</EnableFirewall>
            <Restart>Restart</Restart>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <AutoLogon>
                <Enabled>true</Enabled>
                <LogonCount>1</LogonCount>
                <Username>Administrator</Username>
            </AutoLogon>
            <ComputerName>Elektro-PC</ComputerName>
            <ProductKey>334NH-RXG76-64THK-C7CKG-D3VPT</ProductKey>
            <RegisteredOrganization>Elektro Studios</RegisteredOrganization>
            <TimeZone>Romance Standard Time</TimeZone>
            <WindowsFeatures>
                <ShowInternetExplorer>false</ShowInternetExplorer>
                <ShowMediaCenter>false</ShowMediaCenter>
                <ShowWindowsMediaPlayer>false</ShowWindowsMediaPlayer>
            </WindowsFeatures>
            <Themes>
                <WindowColor>0</WindowColor>
            </Themes>
            <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
            <BluetoothTaskbarIconEnabled>false</BluetoothTaskbarIconEnabled>
        </component>
        <component name="Microsoft-Windows-HelpAndSupport" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <HelpAndSupport>
                <Manufacturer>Elektro Studios</Manufacturer>
            </HelpAndSupport>
        </component>
        <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <UserLocale>es-ES</UserLocale>
            <UILanguageFallback>es-ES</UILanguageFallback>
            <UILanguage>es-ES</UILanguage>
            <SystemLocale>es-ES</SystemLocale>
            <InputLocale>es-ES</InputLocale>
        </component>
        <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SkipAutoActivation>true</SkipAutoActivation>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <OOBE>
                <HideEULAPage>true</HideEULAPage>
                <SkipUserOOBE>true</SkipUserOOBE>
                <SkipMachineOOBE>true</SkipMachineOOBE>
                <ProtectYourPC>3</ProtectYourPC>
                <NetworkLocation>Home</NetworkLocation>
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
                <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
                <HideLocalAccountScreen>true</HideLocalAccountScreen>
            </OOBE>
            <VisualEffects>
                <FontSmoothing>On</FontSmoothing>
                <SystemDefaultBackgroundColor>0</SystemDefaultBackgroundColor>
            </VisualEffects>
            <TimeZone>Romance Standard Time</TimeZone>
            <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
            <BluetoothTaskbarIconEnabled>false</BluetoothTaskbarIconEnabled>
            <Themes>
                <WindowColor>0</WindowColor>
            </Themes>
            <WindowsFeatures>
                <ShowInternetExplorer>false</ShowInternetExplorer>
                <ShowMediaCenter>false</ShowMediaCenter>
                <ShowWindowsMediaPlayer>false</ShowWindowsMediaPlayer>
            </WindowsFeatures>
        </component>
        <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <InputLocale>es-ES</InputLocale>
            <SystemLocale>es-ES</SystemLocale>
            <UILanguage>es-ES</UILanguage>
            <UILanguageFallback>es-ES</UILanguageFallback>
            <UserLocale>es-ES</UserLocale>
        </component>
    </settings>
    <settings pass="auditSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <Themes>
                <WindowColor>0</WindowColor>
            </Themes>
            <WindowsFeatures>
                <ShowWindowsMediaPlayer>false</ShowWindowsMediaPlayer>
                <ShowMediaCenter>false</ShowMediaCenter>
                <ShowInternetExplorer>false</ShowInternetExplorer>
            </WindowsFeatures>
        </component>
    </settings>
    <settings pass="auditUser">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <Themes>
                <WindowColor>0</WindowColor>
            </Themes>
            <WindowsFeatures>
                <ShowWindowsMediaPlayer>false</ShowWindowsMediaPlayer>
                <ShowInternetExplorer>false</ShowInternetExplorer>
                <ShowMediaCenter>false</ShowMediaCenter>
            </WindowsFeatures>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:c:/users/administrador/desktop/es_windows_8_x64_dvd_915404/x64/sources/install.wim#Windows 8" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
役に立ちましたか?

解決

You have to modify the xml-file before it is being used. I.e. the installation processes stills sees a static file, but it is modified for that pariticular install, e.g. via a replace with a batch script. You might also want to use a temp directory so the xml-file doesn't conflict because it's being used by many users.

More details are described here - in German, but running it via Google translate or something similar should give you an idea.

http://social.technet.microsoft.com/Forums/windows/de-DE/b13b59c3-ab93-4aa5-b4cd-e7238aa88e83/umgebungsvariable-wds-deployment-mit-waik-autounattendxml?forum=windowsdeploymentde

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top