Jump to content

My Windows 8.1 unattended install with drivers and oem activation


Recommended Posts

Hi all,

I've found this site very helpful over the years when working with WinXP and Win7 unattended installs. I use these at work vs imaging per model as it's easier to maintain 1 copy and I feel the installs are "cleaner" as well.

 

I thought I'd post the files I am using for doing unattended Win8.1 Pro installs. All our laptops at work have either win8 pro or Win8.1 pro licenses. I was annoyed how you couldn't install Win8.1 directly on a Win8 licensed machine so I wrote a way around it. I hope nothing here is against any forum rules, I apologize if it is.

 

First is the autounattend.xml file, It has some basic stuff in it like credentials for connecting to our PXE server (can also use for USB installs with a couple tweaks). Nothing special in here. I don't use the runsynchronous commands for doing app installs, I prefer setupcomplete instead as it runs as system.

 

Setupcomplete.cmd simply maps a network drive and runs a batch file from the mapped drive. This way I don't need to make chnages to my image, just changes on that network share.

 

I have all my apps with commandline switches for silent installs going in this batch file.

 

For drivers, I can never get the nonWinPE offline pass drivers working, so I instead wrote a VBscript that gets a list of any "unknown devices" post install, then searches on my file share for any matching drivers, and adds them to Windows. It then removes the unknown devices and rescans for new hardware, which now gets them with their drivers.  I just finished writing this in the span of an hour today and haven't added error checking to it yet, but it works. It relies partly on a devcon.exe file that is part of a Windows kit but can exist just as a standalone file.

 

Lastly as you can see in the autoattend file, I use a generic placeholder Win8.1 Pro key. When Setupcomplete runs my batch file, it includes code that runs an EXE which gets the OEM key from the computers BIOS, then switches Windows over to use that key, and activates. I'm hoping this doesn't anger Microsoft, it does take the activation fine. I did it this way so I don't need a separate image for my original Win8 machines.

 

If anyone thinks I'm doing anything stupid please let me know. This seems to work well so far, I'm deploying 20 machines with it next week.

 

Files are renamed to .txt so I could upload, but the finddrivers is .vbs, installwin8apps is a .bat and setupcomplete is .cmd

InstallWin8apps2.txt

SetupComplete.txt

finddrivers.txt

Autounattend2.xml

Edited by GreenEnvy
Link to comment
Share on other sites


Nice Job, one suggestion I would consider instead of doing a post install of NetFX3 everytime is just intergrate it into your image file
which would be a lot more efficient and faster. Fyi, This is how I add it to my image file.

@echo off@setlocal enableextensions:: Netfx35.cmd - ~DosProbie - 08.2014:: Slipstream ".NET Framework 3.5 " features to your Windows 8.1 Install.wim Image File.::=============================================================================================:: Instructions On Installing:::  1) Create a folder in the root of your systemdrive ie: "C:\ISO"::  2) Then create 2 subfolders in "C:\ISO" called "Sxs" and another subfolder called "Mount"::  3) Extract the Netfx35 sxs contents from your dvd sources sxs to "C:\ISO\Sxs"::  4) Now Copy your "Install.Wim" file and "Netfx35.cmd" also into "C:\ISO"::  5) Now run the below Netfx35.cmd script (runas administrator)::=============================================================================================:: Mount ImageDISM /Mount-Wim /WimFile:C:\ISO\install.wim /index:1 /MountDir:C:\ISO\Mount:: Enable featureDISM /Image:C:\ISO\Mount /Enable-Feature /Featurename:NetFx3 /All /Source:C:\ISO\sxs:: Unmount ImageDISM /Unmount-WIM /MountDir:C:\ISO\Mount /Commitclsecho ==================================echo === End Of NetFx35 Integration ===echo ==================================echo.pause

 

Link to comment
Share on other sites

  • 3 weeks later...

Hi GreenEvny,

 

First of all, thanks for posting such a great post, which somewhat helped me in my Windows 8.1 unattended installation. Though, I'm little bit confused over some parameters inside your unattended xm file regarding Apps installation from the network share.

 

At the bottom of your unattended xml file, you have the following:

 

<component name="Microsoft-Windows-PnpCustomizationsNonWinPE" 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">
            <DriverPaths>
                <PathAndCredentials wcm:action="add" wcm:keyValue="3345678">
                    <Credentials>
                        <Domain>MyCompany</Domain>
                        <Password>banana</Password>
                        <Username>pxeuser</Username>
                    </Credentials>
                    <Path>\\10.2.0.30\Apps\Drivers</Path>
                </PathAndCredentials>
            </DriverPaths>
        </component>

 

What I'm confused about is the path? It's pointing to your server and then up to the drivers folder where I believe your have "InstallWin8apps.bat". Then in your Setupcomplete.cmd, you added the following:

 

net use z: \\srv-updates\apps /user:mycompany\pxeuser bannana
z:\InstallWin8apps.bat

 

My question is why your network drive is not mapped up to \\srv-updates\Apps\Drivers as opposed to net use z:\\srv-updates\apps due to the reason that you mentioned this in your path "<Path>\\10.2.0.30\Apps\Drivers</Path>". Isn't your mapped folder on the network suppose to be same as you mentioned in the Path location?

 

I've got a same setup as yours and I need to have my client pulled the apps from the network share during unattended installation like you did, but I'm confused about all that. Could you please shed some light on this particular settings in details for me to implement it. Just so you know, I myself was using Synchronouscommands settings one by one in my unattended file to execute the apps from the server which makes it little bit disorganized. I like the way you did, but please explain me little so I can understand these things before implementing myself.

 

Hope to hear from you.

 

Thanks

Link to comment
Share on other sites

Guys,

 

Can someone please reply on my post above with little explanation how the apps are pulled in during unattend installation from the network share via SetupComplete.cmd or whatever is mentioned up there? It's just that I've a same setup and the only thing is missing in my unattend installation is the ability to install apps or drivers from the network share.

 

I'll appreciate if someone can walk me through this process.

 

Thanks

 

Mian

Link to comment
Share on other sites

Hi bito,

how it works is in your image source, so whether this is a CD, USB stick, or PXE install, you need to make sure under the sources folder, there is a $OEM$ folder, inside that an $$ folder, inside that a Setup Folder, inside that a Scripts folder.

In the Scripts folder you make a file called Setupcomplete.cmd

You can put any commands you like it in, and Windows will run them.

This happens after Windows is installed but before the first time a user logs in, so it runs as SYSTEM.

 

For me, I setup my drive map, then run the various installers I want, all with silent switches so I don't need to do anything.

 

One thing I've heard but haven't tested fully, is if you are using an OEM key for Windows installation (so for Win8 it's getting it from the BIOS or you've manually entered an OEM key), then setupcomplete is ignored.

Link to comment
Share on other sites

Hi GreenEnvy,

 

Thanks for replying back. I'm sorry but I'm still confused over what you explained regarding scripts folder. Are you talking about those folders on my network share which happens to be my only Domain controller with DNS, WDS, DHCP and AD roles.

 

I just checked inside my E drive which is a partitioned drive, this is where I've RemoteInstall, DeploymentShare and Distribution Folders along with other folders.

 

Under DeploymentShare, I found "$OEM$" folder which is empty and "Scripts" folder which has some scripts in it.

Under Distribution, I found "$OEM$ Folders" which is empty and there is no script folder there.

 

I can't find the long path to the scripts folder you mentioned above. I hope you weren't telling me that scripts folder path on the client that is going to be my Windows 8 machine.

 

Also, please check my unattend xml, SetupComplete and Apps files to make sure that there is not mistake in them. Anything you feel like needs to be changed in any of these files, please make suggestions.

 

Have you been able to find a solution to get drivers inside your unattended installation? I know you were having problems with them as you said they never work for you.

 

As far as the keys goes, I'm using KVS Default key from MSDN site for Windows 8.1 Pro. Hope that won't cause any setupcomplete issue.

 

One last thing, I've used net use E as a drive to map instead of Z since I've got my Apps inside E drive on my server. Not sure if it has to be same drive letter as where you got your apps or scripts or it could be any other drive letter to map. If you could shed some light on it too.

 

Thanks in advance. Sorry for the long write up, but I searched a lot and found what I was looking for here since I've almost got a same setup as yours. Please do reply back with the answers.

?xml version="1.0" encoding="utf-8"?><unattend xmlns="urn:schemas-microsoft-com:unattend">    <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">            <ComputerName>WIN-8-DEPL</ComputerName>            <ProductKey>MHF9N-XY6XB-WVXMC-BTDCT-MKKG7</ProductKey>            <RegisteredOrganization>Microsoft</RegisteredOrganization>            <RegisteredOwner>AutoBVT</RegisteredOwner>            <ShowWindowsLive>false</ShowWindowsLive>            <TimeZone>eastern standard time</TimeZone>            <CopyProfile>true</CopyProfile>            <BluetoothTaskbarIconEnabled>false</BluetoothTaskbarIconEnabled>        </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>                    <Path>net user administrator /active:no</Path>                    <Description>Enabling Built in Administrator Account</Description>                    <WillReboot>Never</WillReboot>                </RunSynchronousCommand>                <RunSynchronousCommand wcm:action="add">                    <Description>DisableNetworkLocationPrompt</Description>                    <Order>2</Order>                    <Path>REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 00000000 /f</Path>                    <WillReboot>Never</WillReboot>                </RunSynchronousCommand>                <RunSynchronousCommand wcm:action="add">                    <Path>REG ADD "HKLM\System\CurrentControlSet\Services\Tcpip6\parameters" /v DisabledComponents /t REG_DWORD /d 0xFF /f</Path>                    <Order>4</Order>                    <Description>Diasbling IPV6</Description>                    <WillReboot>Never</WillReboot>                </RunSynchronousCommand>                <RunSynchronousCommand wcm:action="add">                    <Credentials>                        <Domain>Mikasa.local</Domain>                        <Password>Administrator</Password>                        <Username>Ghtwhts2015</Username>                    </Credentials>                    <Path>\\WDS-DEP-SERV\E\Distribution\Drivers\setup64.exe /s </Path>                    <Description>Vmware Tool Installation</Description>                    <Order>3</Order>                    <WillReboot>Always</WillReboot>                </RunSynchronousCommand>            </RunSynchronous>        </component>        <component name="Microsoft-Windows-IE-InternetExplorer" 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">            <SearchScopes>                <Scope wcm:action="add">                    <ScopeDefault>true</ScopeDefault>                    <ScopeDisplayName>Google</ScopeDisplayName>                    <ScopeKey>Google</ScopeKey>                    <SuggestionsURL>http://www.google.com/search?q={search Terms}</SuggestionsURL>                    <ShowSearchSuggestions>true</ShowSearchSuggestions>                    <ShowTopResult>true</ShowTopResult>                </Scope>            </SearchScopes>            <DisableAccelerators>true</DisableAccelerators>            <DisableFirstRunWizard>true</DisableFirstRunWizard>            <Home_Page>www.marca.com</Home_Page>            <BlockPopups>yes</BlockPopups>        </component>        <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" 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">            <fDenyTSConnections>false</fDenyTSConnections>        </component>        <component name="Networking-MPSSVC-Svc" 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">            <FirewallGroups>                <FirewallGroup wcm:action="add" wcm:keyValue="Remote Desktop">                    <Active>true</Active>                    <Group>Remote Desktop</Group>                    <Profile>all</Profile>                </FirewallGroup>            </FirewallGroups>        </component>        <component name="Microsoft-Windows-TerminalServices-RDP-WinStationExtensions" 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">            <UserAuthentication>0</UserAuthentication>            <SecurityLayer>1</SecurityLayer>        </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>        <component name="Microsoft-Windows-TCPIP" 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">            <Interfaces>                <Interface wcm:action="add">                    <Identifier>00-50-56-30-85-87</Identifier>                    <Ipv4Settings>                        <DhcpEnabled>false</DhcpEnabled>                        <Metric>10</Metric>                        <RouterDiscoveryEnabled>false</RouterDiscoveryEnabled>                    </Ipv4Settings>                    <UnicastIpAddresses>                        <IpAddress wcm:action="add" wcm:keyValue="1">172.16.5.21/24</IpAddress>                    </UnicastIpAddresses>                    <Routes>                        <Route wcm:action="add">                            <Identifier>0</Identifier>                            <Prefix>0.0.0.0/0</Prefix>                            <Metric>10</Metric>                            <NextHopAddress>172.16.5.1</NextHopAddress>                        </Route>                    </Routes>                </Interface>            </Interfaces>        </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">            <AutoLogon>                <Password>                    <Value>RwBoAHQAdwBoAHQAcwAyADAAMQA2AFAAYQBzAHMAdwBvAHIAZAA=</Value>                    <PlainText>false</PlainText>                </Password>                <Enabled>true</Enabled>                <LogonCount>10</LogonCount>                <Username>DarkKnight</Username>                <Domain></Domain>            </AutoLogon>            <OOBE>                <HideEULAPage>true</HideEULAPage>                <NetworkLocation>Home</NetworkLocation>                <ProtectYourPC>1</ProtectYourPC>                <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>                <HideWirelessSetupInOOBE>false</HideWirelessSetupInOOBE>            </OOBE>            <UserAccounts>                <AdministratorPassword>                    <Value>RwBoAHQAdwBoAHQAcwAyADAAMQA2AEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABhAHMAcwB3AG8AcgBkAA==</Value>                    <PlainText>false</PlainText>                </AdministratorPassword>                <LocalAccounts>                    <LocalAccount wcm:action="add">                        <Password>                            <Value>RwBoAHQAdwBoAHQAcwAyADAAMQA2AFAAYQBzAHMAdwBvAHIAZAA=</Value>                            <PlainText>false</PlainText>                        </Password>                        <Description>Admin User Account</Description>                        <DisplayName>Omar</DisplayName>                        <Group>Administrators</Group>                        <Name>Omar</Name>                    </LocalAccount>                </LocalAccounts>            </UserAccounts>            <RegisteredOrganization>Mikasa</RegisteredOrganization>            <RegisteredOwner>Mikasa</RegisteredOwner>            <ShowWindowsLive>false</ShowWindowsLive>            <TimeZone>eastern standard time</TimeZone>        </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>en-US</InputLocale>            <SystemLocale>en-US</SystemLocale>            <UILanguage>en-US</UILanguage>            <UserLocale>en-US</UserLocale>            <UILanguageFallback></UILanguageFallback>        </component>    </settings>    <settings pass="generalize">        <component name="Microsoft-Windows-Security-SPP" 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">            <SkipRearm>1</SkipRearm>        </component>    </settings>    <settings pass="offlineServicing">        <component name="Microsoft-Windows-LUA-Settings" 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">            <EnableLUA>false</EnableLUA>        </component>    </settings>    <cpi:offlineImage cpi:source="wim:e:/windows-os-images/win8.1x86ent-wimfiles/install.wim#Windows 8.1 Enterprise" xmlns:cpi="urn:schemas-microsoft-com:cpi" /></unattend>
msiexec /i E:\Apps\7z920-x64.msi /q INSTALLDIR="%ProgramFiles%\7-Zip"E:\Apps\Adobe-Reader.exe /sPB /rsE:\Apps\Firefox.exe -msE:\Apps\Java.exe /smsiexec /i E:\Apps\Adobe-Flash.msi /qnnet use /delete E:
net use E: \\WDS-DEp-SERV\Apps /user:Mikasa.local\Immy Ghtwhts2016E:\Apps\Apps.bat

I've got my unattend answer file at the top, then my Apps.bat file and at the bottom I've got SetupComplete.cmd

Link to comment
Share on other sites

Hi GreenEnvy,

 

Can you please help me out? I followed the same procedure as you have to have the apps installed during the unattended install. The only thing I did is added a FirstLogonCommands under OOBE pass and point the path to my network share where setupcompletec.cmd and Apps.batch script is located.

 

I tried this and it threw up error message as you can above. Then I changed the commandline from "cmd /C start /wait E:\RemoteInstall\Images\Windows8\install\$OEM$\$$\Setup\Scripts\SetupComplete.cmd" to this \\WDS-DEP-SERV\E\RemoteInstall\Images\Windows8\install\$OEM$\$$\Setup\Scripts\SetupComplete.cmd but it didn't not even run.

 

Do I have to pass any command parameters anywhere inside my unattend XML file, so the client can pull the script and run it from the network share during unattend install. I'm really having a hard time with this. Could you please shed some light? How do you have it in your unattend xml file?

 

Hope to hear from you soon!

 

 

<FirstLogonCommands>

  <SynchronousCommand wcm:action="add">

<CommandLine>cmd /C start /wait E:\RemoteInstall\Images\Windows8\install\$OEM$\$$\Setup\Scripts\SetupComplete.cmd</CommandLine>

<Description>Various Apps Installation</Description>

<Order>1</Order> <

RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>

</FirstLogonCommands

Link to comment
Share on other sites

  • 1 month later...

It´s nice. I have somthing like that, but i use a external drive because its faster than network. I use Wandrv to install drivers and WPI to install apps. This apps are in the external drive to easy update.

 

I have installed in the image some apps like: Winrar, Ccleaner, NetFX, Office 2013 because that way i reduce the install time. I prefer to update the image once a month than loose half hour in each install. 

 

Other apps that are updated many times a month i install it through WPI.

 

 

My Windows 8.1 64 bits image have a size of 7GB and the complete installation is done in 40 minutes.

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