Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

My Windows 8.1 unattended install with drivers and oem activation


  • Please log in to reply
8 replies to this topic

#1
GreenEnvy

GreenEnvy

    Newbie

  • Member
  • 10 posts
  • Joined 20-November 06

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

Attached Files


Edited by GreenEnvy, 12 September 2014 - 07:19 PM.

  • NightShark likes this


How to remove advertisement from MSFN

#2
DosProbie

DosProbie

    Friend of MSFN

  • MSFN Sponsor
  • 750 posts
  • Joined 16-October 12
  • OS:Windows 8.1 x64
  • Country: Country Flag

Donator

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 Image
DISM /Mount-Wim /WimFile:C:\ISO\install.wim /index:1 /MountDir:C:\ISO\Mount
:: Enable feature
DISM /Image:C:\ISO\Mount /Enable-Feature /Featurename:NetFx3 /All /Source:C:\ISO\sxs
:: Unmount Image
DISM /Unmount-WIM /MountDir:C:\ISO\Mount /Commit
cls
echo ==================================
echo === End Of NetFx35 Integration ===
echo ==================================
echo.
pause

 



#3
GreenEnvy

GreenEnvy

    Newbie

  • Member
  • 10 posts
  • Joined 20-November 06

Thanks DosProbie, I'll give that a try.



#4
bito007

bito007
  • Member
  • 8 posts
  • Joined 28-September 14
  • OS:Windows 8.1 x64
  • Country: Country Flag

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.micro...nfig/2002/State" xmlns:xsi="http://www.w3.org/20...Schema-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



#5
bito007

bito007
  • Member
  • 8 posts
  • Joined 28-September 14
  • OS:Windows 8.1 x64
  • Country: Country Flag

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



#6
GreenEnvy

GreenEnvy

    Newbie

  • Member
  • 10 posts
  • Joined 20-November 06

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.



#7
bito007

bito007
  • Member
  • 8 posts
  • Joined 28-September 14
  • OS:Windows 8.1 x64
  • Country: Country Flag

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 &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork&quot; /v Category /t REG_DWORD /d 00000000 /f</Path>
                    <WillReboot>Never</WillReboot>
                </RunSynchronousCommand>
                <RunSynchronousCommand wcm:action="add">
                    <Path>REG ADD &quot;HKLM\System\CurrentControlSet\Services\Tcpip6\parameters&quot; /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 /rs
E:\Apps\Firefox.exe -ms
E:\Apps\Java.exe /s
msiexec /i E:\Apps\Adobe-Flash.msi /qn
net use /delete E:
net use E: \\WDS-DEp-SERV\Apps /user:Mikasa.local\Immy Ghtwhts2016
E:\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



#8
bito007

bito007
  • Member
  • 8 posts
  • Joined 28-September 14
  • OS:Windows 8.1 x64
  • Country: Country Flag

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



#9
gustavo21

gustavo21

    Newbie

  • Member
  • 29 posts
  • Joined 14-November 10
  • OS:Windows 7 x86
  • Country: Country Flag

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.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users