Jump to content

New to 7 unattended (and kinda perfectionist)


Recommended Posts

Thanks, I remember reading that somewhere. So at least the HKCU tweaks should be applied via the synchronous command.

unfortunately I am getting an error during Windows setup using the autounattend.xml file from my previous post:

Windows could not parse or process the unattend answer file for pass [specialize]. The settings specified in the answer file cannot be applied. The error was detected while processing settings for component [Microsoft-Windows-Deployment].

Would be nice if it would just say wich line caused the error..

Link to comment
Share on other sites


You have used a component without value inside your "Autounattend.xml" pass [specialize] (writed in bold)

You can delete or add a value!

<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" />

<component name="Microsoft-Windows-Security-Licensing-SLC-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="NonSxS" xmlns:wcm="http://schemas.micro...nfig/2002/State" xmlns:xsi="http://www.w3.org/20...Schema-instance">

<SkipAutoActivation>true</SkipAutoActivation>

</component>

Edited by myselfidem
Link to comment
Share on other sites

You have used a component without value inside your "Autounattend.xml" pass [specialize] (writed in bold)

You can delete or add a value!

<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" />

<component name="Microsoft-Windows-Security-Licensing-SLC-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="NonSxS" xmlns:wcm="http://schemas.micro...nfig/2002/State" xmlns:xsi="http://www.w3.org/20...Schema-instance">

<SkipAutoActivation>true</SkipAutoActivation>

</component>

Thanks! that line is strange, but when I use the original Autounattend.xml file, there is no error. And it also contains an empty component :S

See the attached file... with that autounattend.xml everything goes fine!

But if I add this simple component:

<component name="Microsoft-Windows-Deployment" 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">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>10</Order>
<Path>%systemdrive%\InstallApps.cmd</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>

I get the error message again..

weird!

Autounattend (original - successful).xml

Autounattend (extra component - error).xml

Edited by ZileXa
Link to comment
Share on other sites

Is the easiest way to figure out errors

Uhm, "CD there" means you can access the commandline and change dir during Windows Setup after the error message?

Yes unless you crash so early nothing was expanded

When you crash leave error box up and hit Shift F10 to open cmd prompt. Depends on how many drives you have I usually find my usb jump on H: so I just type CD H: and press enter then I type dir just to make sure it is on right one and then type just Panther. I place my Autounattend.xml also on H: so I can just go there and edit my xml with dos or you can type notepad and find the xml and open it.

Easyyyy and works in VM also

Edited by maxXPsoft
Link to comment
Share on other sites

Wow that would be extremely timesaving... even editing the autounattended.xml! Thanks!

I've narrowed down the issue, if I remove the component I added, everything goes fine. So perhaps setup cannot find the batch file, I will use your method to figure it out. I'm currently bumping into other time consuming issues but thats just how it goes, trial and error.

EDIT: you are also using an USB drive. do you go into BIOS after first reboot to disable boot from USB or just pull out the stick during the reboots? Otherwise the pc will boot from USB again. I don't understand why Microsoft didn't add a "press a button to start setup.." to the boot sector. It's not very unattended now.. So that will be the final thing to create once I'm done.

Edited by ZileXa
Link to comment
Share on other sites

won't boot usb if there is no boot files on it.

When I'm booting HD is set as first but my Dell gives me F12 to select boot device. I hit dvd-rw and then anykey. my usb is already connected and Win 7 will pick it up and use xml from there

No need to remove the usb after it starts untill you hit desktop

Edited by maxXPsoft
Link to comment
Share on other sites

OK so setuperr.log shows [setupugc] hit an error [hr = ...] while running [%systemdrive\installApps.cmd]

In another log it clearly states it found the RunSynchronous command, but hits an error while running the mentioned file.

When I check the C: drive, I see there is not InstallApps.cmd! So the error makes sense :) I assume the $OEM$\$1 folder has not been copied to the hard drive yet...

So I'm back to where I was yesterday, testing out Evlo's code:

<component name="Microsoft-Windows-Deployment" 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">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Path>cmd /c for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\installApps.cmd set CDDRIVE=%%i:\</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Path>%CDDRIVE%\installApps.cmd</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>

without the "=" the command would be incorrect. Let's see how it goes.

Result: the first command ends without error but I do see in the setupact.log file:

[SETUPUGC.EXE] Finished executing [cmd /c for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\installApps.cmd set CDDRIVE=%%i:\] synchronously
[SETUPUGC.EXE] Process returned with exit code 0x1
[SETUPUGC.EXE] Hit an error (hr = 0x80070002) wile running [%CDDRIVE%\installApps.cmd]
[0x090009 PANTHR CBlackboard::Close: C:\windows\panther\commandexec\commandexec.
[SETUPUGC.EXE] SetupUGC returning with exit code [4]

So the first command finishes without error, but returns exit code 0x1. Since this is not "0" I suppose something goes wrong. I can imagine setting a local variable is not working via SetupUGC.

The second command gives an error since the file cannot be found.

Since $OEM$ folder isn't copied to the harddrive yet, this makes it quite difficult to simply run a batch file.

EDIT again:

(Maybe I should be continuing this in the Ask your Seven xml ? here topic)

--> After reading some more, I now understand I've been doing stuff wrong. Instead of using the Path variable to run a command I should be using the Commandline variable.

Also, MaxXPSoft post #102 shows me the command to set the variable differs from the command you would use inside a cmd file. So now I'm going to test this:

<component name="Microsoft-Windows-Deployment" 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">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Set CDROM Variable</Description>
<CommandLine>cmd /C FOR %%a IN (c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) DO IF EXIST %%a\Sources\Install.wim SET CDROM=%%a</CommandLine>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Install Applications</Description>
<CommandLine>cmd /C start /Wait %CDROM%\installApps.cmd<CommandLine>
</RunSynchronousCommand>
</RunSynchronous>
</component>

All the drive letters now have ":"

In post #102 it says

<CommandLine>cmd /C start /Wait %CDROM%:\Office2010\Office14.exe</CommandLine>

but I don't think ":" should be there so I removed in in my code above.

EDIT again: <CommandLine> is not a child element of RunSynchronousCommand according to the Microsoft Library!

Now setup hangs at Completing installation... although the three dots are still moving. But its been like this over an hour. Opening cmd and notepad to open the logfiles is taking ages, going very slow. But I couldn't find an error. Going to test with <Path> instead of <CommandLine>.

I feel like I am learning new stuff but not moving forward with this, any help is much appreciated.

Edited by ZileXa
Link to comment
Share on other sites

add same line at top in your batch but in a batch do not use cmd /c

Test this and you'll see in a batch on desktop

FOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\sources\install.wim SET CDROM=%%i:
Type %CDROM%\autorun.inf
pause

Link to comment
Share on other sites

I already have the same line in the batch file (without cmd /c) :) The error shows it is the batchfile that cannot be found. So the error must still be in the first RunSynchronous command where I set the %CDDRIVE% variable for the first time.

When I run the command from desktop, all goes fine.

When I type the exact same FOR command in cmd, it doesn't work, saying %%i was not expected here. If I change %%i to %i it does work. So there is a difference in how to run a command from batchfile and from commandline itself.

edit: hmm weird, still the same error. I think it is impossible to set a variable from autounattend.xml and then use this variable later in the autounattend.xml. I've seen other people doing it but no one actually reported a succes:

autounattend.xml

<?xml version="1.0" encoding="utf-8"?>
<!--This answer file generated by RT Seven Lite-->
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<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">
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>0409:00020409</InputLocale>
<UserLocale>nl-NL</UserLocale>
<UILanguage>en-US</UILanguage>
<SystemLocale>en-US</SystemLocale>
</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">
<ImageInstall>
<OSImage>
<InstallFrom>
<MetaData wcm:action="add">
<Key>/IMAGE/NAME</Key>
<value>Windows 7 ULTIMATE</value>
</MetaData>
</InstallFrom>
<WillShowUI>OnError</WillShowUI>
</OSImage>
</ImageInstall>
<UserData>
<ProductKey>
<Key>D4F6K-QK3RD-TMVMJ-BBMRX-3MBMV</Key>
<WillShowUI>OnError</WillShowUI>
</ProductKey>
<AcceptEula>true</AcceptEula>
</UserData>
</component>
</settings>
<settings pass="oobeSystem">
<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">
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UserLocale>0409:00020409</UserLocale>
</component>
<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">
<UserAccounts>
<LocalAccounts />
</UserAccounts>
<OOBE>
<NetworkLocation>Home</NetworkLocation>
<HideEULAPage>true</HideEULAPage>
<ProtectYourPC>3</ProtectYourPC>
<HideWirelessSetupInOOBE>false</HideWirelessSetupInOOBE>
<SkipMachineOOBE>false</SkipMachineOOBE>
<SkipUserOOBE>false</SkipUserOOBE>
</OOBE>
<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
<TimeZone>W. Europe Standard Time</TimeZone>
<VisualEffects>
<FontSmoothing>ClearType</FontSmoothing>
</VisualEffects>
</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" />
<component name="Microsoft-Windows-Security-Licensing-SLC-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>
<component name="Microsoft-Windows-Deployment" 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">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Set Setup Drive Variable</Description>
<Path>cmd /C FOR %i IN (c d e f g h i j k l m n o p q r s t u v w x y z) DO IF EXIST %i:\Sources\Install.wim SET SETUPDRIVE=%i:</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Install Applications</Description>
<Path>cmd /C START /WAIT %SETUPDRIVE%\installApps.cmd</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>
</unattend>

installApps.cmd (just like autounattend located in the root of my cd)

@echo off
FOR %%i IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\installApps.cmd set SETUPDRIVE=%%i:

:: System tools
:: ===============
:: Install 7zip x64
START /wait %SETUPDRIVE%\Apps\7zip-x64.msi /qb
:: Install Ccleaner
StART /wait %SETUPDRIVE%\Apps\ccsetup_slim.exe /S
:: Install Recuva
StART /wait %SETUPDRIVE%\Apps\rcsetup_slim.exe /S
:: Install Speccy
StART /wait %SETUPDRIVE%\Apps\spsetup.exe /S
:: Install Antivirus
START /wait %SETUPDRIVE%\Apps\avira_antivir_personal_en.exe
:: Install Teamviewer
:: START /wait %SETUPDRIVE%\Apps\TeamViewer_Setup.exe

:: Apply regtweaks for all users created in the future
REGEDIT /S %SETUPDRIVE%\tweaks.reg

EXIT

Wether I use %%i or %i in autounattend.xml I get the same error message from my previous post (see screenshot) it cannot find %SETUPDRIVE%\installApps.cmd.

@MaxXPSoft, do you have any idea?

Edited by ZileXa
Link to comment
Share on other sites

Actually need to get it calling the installApps.cmd first. I thought you had done from the pic above.

I mount my install.wim and add the OEM and then things get a lot easier. I add an $1\Install folder that gets dropped on the root drive which you can delete at the end also. Then in xml I call it this way

            <FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Running FirstLog.cmd</Description>
<CommandLine>cmd /C start /wait %systemdrive%\Install\FirstLog.cmd</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>

$OEM$
$$ <<- C:\Windows $$\Web\Wallpaper <<- Wallpapers here
Setup\Scripts <<- setupcomplete.cmd
System32 <<- $$\System32\OEM <<- OEM *.xrm-ms + valid Product Key
$1 <<- Drive Root
Drivers <<- where some OEM place driver files
Install <<- where I place most things and call from there. EX: %SystemRoot%\Install\Firstlog.cmd

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...