Jump to content

FirstLogonCommands point to %CDRoot% in AutoUnattend.xml?


Recommended Posts

I had been creating various Unattended and Slipstreamed Windows installation discs for Windows XP, but I haven't had that much success doing so in Vista and Windows 7.

Anyways, I had inserted <FirstLogonCommands> into my AutoUnattend.XML file and placed it within the root of my Windows 7 installation disc. However, it doesn't appear that the AutoUnattend.XML is accessed during the installtion.

Basically, what I'm trying to do is install some applications silently after Windows 7 has installed, but unlike what I had been doing for Windows XP, I don't want these files to be copied onto the hard drive during the installation, but run from the disc instead.

I've tried doing the following... without success:

Within AutoUnattend.XML, under <settings pass="oobeSystem"> just before </component>


<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<CommandLine>%CDRoot%\applications\GUIRunOnce.cmd</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>

The GUIRunOnce.cmd contains the following code:


CLS
@ECHO OFF

TITLE WINDOWS 7 APPLICATION INSTALLATION

REM --------------------------------------------------------
REM APPLICATIONS

ECHO Installing Microsoft Office 2010
ECHO.
START /WAIT %CDRoot%\applications\office\setup.exe
START /WAIT %CDRoot%\applications\office\officemenu_45.exe /silent
copy "%CDRoot%\applications\office\MSO_Launcher.exe" "C:\Users\Public"
WScript.exe "%CDRoot%\applications\PinToTaskbar.vbs" "C:\Users\Public\MSO_Launcher.exe"

ECHO Installing WinRAR 3.90
ECHO.
IF EXIST "C:\Program Files (x86)" START /WAIT %CDRoot%\applications\utilities\winrar-x64-390en.exe /s
IF NOT EXIST "C:\Program Files (x86)" START /WAIT %CDRoot%\applications\utilities\winrar-x86-390en.exe /s

EXIT

I'm not quite sure why GUIRunOnce.cmd doesn't load after Windows 7 installs. If I double-click it manually, the programs install just fine.

On a side note: I had used Windows AIK to merge the .WIM of an x64 installation disc into that of an x86 installation disc to create an AIO disk. And then I copied the AutoUnattend.XML file into this disc's root... is that what I'm doing wrong? I didn't notice a WINNT.SIF/answer file to have it access the AutoUnattend.XML... but from what I've been reading Windows 7 automatically looks for this file within the root of the installation DVD as well as any flash drives plugged in.

If someone can please point me in the right direction, that would be much appreciated.

Edited by Coluwyvurne
Link to comment
Share on other sites


instead of me typing I'll quote a recent addition

You will run this first <FirstLogonCommands>

Or you can use old trick (this is from old xp unattended guide here)

put CDRoot.txt on root of your installation medium

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:\CDRoot.txt SET CDRoot=%%i:

then you get root of media in %CDRoot% in batch script run anytime after installation

Link to comment
Share on other sites

Thanks for the reply maxXPsoft

So would my <FirstLogonCommands> look something like this?


<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>10</Order>
<CommandLine>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:\CDRoot.txt SET CDRoot=%%i:</CommandLine>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>20</Order>
<CommandLine>%CDRoot%\applications\GUIRunOnce.cmd</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>

Also, just another thing... is it possible to only have the <FirstLogonCommands>, the header, footer and other necessary code in the AutoUnattend.XML?

Basically, I want to be able to 'attend' to the installation (eg. choose the edition to install from the AIO disc, input a COA, name, region/time, etc manually during each installation), but I want MS Office and a select few other applications to automatically install silently following the Windows installation.

Thanks

Edited by Coluwyvurne
Link to comment
Share on other sites

You will need a cmd /c in front of the FOR %%i.

basically yes what you add will be used as it reads it each pass.

I put mine on a usb stick and I can change as needed if error

Edited by maxXPsoft
Link to comment
Share on other sites

@ECHO OFF
SET str_AllDriveLettersList=C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:
FOR %%I IN (%str_AllDriveLettersList%) DO (
DIR %%I >NUL 2>NUL && IF EXIST "%%I\bootmgr" (SETX OSInstDrv "%%I" /M)
)
DEL /F "%~f0"

1. Save it as "SetOsInstMedia.cmd"

2. Place the script under "vista/win7 install media root:\sources\$OEM$\$$\System32\"

3. Using WAIK, Insert a "RunSynchronousCommand" in specialize configuration pass to run the script once. (after that, it will delete itself)

4. After backward configuration pass("audituser" or "oobesystem"), you can use the %OSInstDrv% variable in your command to point to win7/vista install media drive.

Note: It's "SETX", not just "SET"

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...