SDI_CHOCO

E2B v1.82+, v1.84+ includes support for Win7 and choco packages which are not checksummed.
 
SDI_CHOCO
 
Introduction
 
The xxxxxxxxx_SDI_CHOCO.XML files for Windows 8 and Windows 10 Installer ISO files can automatically install drivers and applications
 
1. Snappy Driver Installer (SDI)
2. Chocolately application installer (choco)
3. WSUS Windows Offline Updates (WSUS)
 
SDI - This utility automatically finds and installs the correct driver using pre-downloaded Driverpacks
choco - This utility downloads the latest applications from the internet each time and then installs them
WSUS - This utility will install the correct Windows Updates without needing a network connection
 
Example XML files provided:
Win10_Choose_a_key_SDI_CHOCO.xml - You will be requested to choose a Product Key
Auto_WipeDisk0_Win10HomeUK_with_SDI_CHOCO.xml - Automatically wipe hard disk 0, install Windows 10 Home with UK settings
 
The SDI_CHOCO files are all kept under the \_ISO\WINDOWS\INSTALLS folder.
 
Once you have set up SDI_CHOCO, you can automatically install default drivers and any applications you choose.
If you add WSUS Offline Updater to the E2B drive, it will also install Windows Updates.
 
There is also provision to add your own drivers and applications too and have different configurations for different systems.
 
Getting Started
 
Here are the steps you need to follow in outline:
 
Preparing your E2B USB drive for SDI_CHOCO
 
1. This feature only works when using Microsoft Windows Installer ISO files.
You therefore need to have either:
A large E2B USB 'Removable' type Flash drive
OR
An E2B USB Hard Drive + a small 'Removable' type USB 'WinHelper' Flash drive
 
Copy a suitable ISO file to the E2B \_ISO\WINDOWS\WIN8 or WIN10 folder.
 
2. We must download the SDI Driverpacks.
   It is best to do this operation on the intended target Windows system or a system of the same Model\Type.
However, it can be done on an Windows computer.
 
Double-click on the \_ISO\WINDOWS\INSTALLS\SNAPPY\SDI_run.bat file to start the Snappy GUI
Accept the Firewall prompt.
Now click on the (click here to start the download) and either select all the Driverpacks, or just those for that system.
Download all the Driverpacks (do NOT click on the green Install button!)
 
3. (optional) Download and extract WSUS Offline Updater to your Windows hard disk.
   Run the UpdateGenerator.exe application and tick the updates you require.
Download the updates (this may take some time)
   Now copy the whole wsusoffline folder to the E2B USB drive \_ISO\WINDOWS\INSTALLS folder so that \_ISO\WINDOWS\INSTALLS\wsusoffline now contains the UpdateGenerator.exe application and all other files and folders.
 
4. Finally, if you want to install some applications:
 
   Copy the \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO\Sample_MyStartup.cmd file and rename it to \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO\MyStartup.cmd
   You can examine and change MyStartup.cmd if you wish.
 
Installing Windows
 
First connect an ethernet cable to the target system - internet access is required to install applications using choco.
Boot to E2B and select a Windows 8.1 or Windows 10 ISO as usual.
Now choose one of the xxxxxxx_SDI_CHOCO.XML files - e.g. Win10_Choose_a_key_SDI_CHOCO.XML.
Now choose a Product Key that matches the OS that you are going to install.
Note: If you want to try one of the AutoWipe_xxxxxx_SDI_CHOCO.XML then these are fully automatic and will immediatley wipe Hard Disk 0.
 
How it works
 
The XML file contains a 'Specialize' pass section which causes the \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO.cmd script on the E2B USB drive to run during the 'Specialize' phase.
The SDI_CHOCO.cmd script adds two files to the target hard disk:
SetupComplete.cmd - this runs after Windows Setup has finished but before a user account is created and before user logon.
Startup.cmd - this runs on first user logon.
 
As well as these two files, it also copies the contents of the SDI_CHOCO folder to C:\DRIVERS.
 
Next SDI_CHOCO.cmd runs SDI directly from the E2B USB drive and will install drivers.
Next SDI_CHOCO.cmd checks it has internet access (if installing Windows 10 - please use the latest version of TH2 - the first version of TH2 had network bugs!)
Next SDI_CHOCO.cmd will install Chocolatey (if required) and run the MySpecialize.cmd script (if present)
Next the system will reboot and complete the installation of Windows.
Next it will run the MySetupComplete.cmd sript (if present)
if autologon was enabled (or after you create a new user), the MyStartup.cmd script will run (if present).
 
You can create and edit the three controlling files MySpecialize.cmd, MySetupComplete.cmd and MyStartup.cmd.
 
SDI_CHOCO.cmd will call MySpecialize.cmd
SetupComplete.cmd will call MySetupComplete.cmd
Startup.cmd will call MyStartup.cmd
 
 
FOLDER STRUCTURE
 
\_ISO\WINDOWS\INSTALLS - contains the SDI_CHOCO sub-folders
\_ISO\WINDOWS\INSTALLS\APPS - example folder for an offline application in included
\_ISO\WINDOWS\INSTALLS\CONFIGS - contains the main script that must be specified in the XML file and kicks off the whole thing. Also contains a sub-folder which is copied across to the target hard drive.
\_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO - contains the SDI_CHOCO scripts and helper utilities - these are copied across to the target hard drive.
\_ISO\WINDOWS\INSTALLS\DRIVERS - you can keep your bespoke drivers here and copy them to the target hard disk - use sub-folders.
\_ISO\WINDOWS\INSTALLS\SNAPPY - contains the Snappy SDI files but you need to add Driverpacks
\_ISO\WINDOWS\INSTALLS\wsusoffline - add WSUS files here if you want to install offline Windows Updates
 
 
 
 
Lenovo IdeaPad 300 example 
 
How to install bespoke drivers
 
Lenovo provide Windows 10 downloads for the IdeaPad 300 notebook in the form of executables.
These must first be extracted as follows:
1. Double-click the .exe file to run it
2. Click Next\OK to extract the files to the C:\DRIVERS folder - I suggest you rename the folder name that it chooses and remove any spaces.
3. Do NOT proceed to install the drivers - untick the box and click Finish.
 
Do this for all the drivers.
 
Now copy all the sub-folders that are in C:\DRIVERS to \_ISO\WINDOWS\INSTALLS\DRIVERS\IDPAD300\W10_8_64
 
Now prepare a .cmd script that will install each driver \_ISO\WINDOWS\INSTALLS\DRIVERS\IDPAD300\W10_8_64\ID300_DRIV_INST.cmd
 
The trick is in finding the correct switches to make the drivers install silently!
 
Here is an example folder file structure for Windows 8 and Windows 10 64-bit drivers for the IdeaPad 300:
\_ISO\WINDOWS\INSTALLS\DRIVERS\IDPAD300\W10_8_64\ID300_DRIV_INST.cmd
\_ISO\WINDOWS\INSTALLS\DRIVERS\IDPAD300\W10_8_64\CHIPSET
\_ISO\WINDOWS\INSTALLS\DRIVERS\IDPAD300\W10_8_64\VGA
etc.
 
Now edit the MySpecialize.cmd to copy the whole folder from the USB drive to the target hard disk and then run the ID300_DRIV_INST.cmd script.
 
Create a NoSDI.tag file to prevent the Snappy SDI from installing the wrong drivers.
 
How to install bespoke apps
 
You can download application install files from npackd.appspot.com, choose a version and copy them to the E2B USB drive \_ISO\WINDOWS\INSTALLS\APPS folder.
 
You can then either install them directly from the USB drive, or copy the .exe or .msi files to the C:\DRIVERS folder, and install them from the hard disk. 
To install them silently, use this syntax (examples for 7z and Foxit Reader):
 
start /wait msiexec /qb- /i C:\DRIVERS\7z1602.msi
start /wait FoxitReader734_enu_Setup_Prom.exe /silen

Introduction

Once you have set up the E2B USB drive for 'SDI_CHOCO', you will be able to pick any Windows 7, 8.1 or 10 install ISO and install Windows + drivers + applications + Windows Updates (Win 8.1/10 only) automatically. You do not need to alter the standard Microsoft ISO files, so you can just use a different version of an ISO (e.g. a new Win 10 version) and you won't need to change anything!
 

1. Snappy Driver Installer (SDI)
2. Chocolately application installer (choco)
3. (optional) WSUS Windows Offline Updates (WSUS) (Win 8.1 and 10 only)

  • SDI - This utility automatically finds and installs the correct drivers using pre-downloaded Driverpacks
  • choco - This utility downloads the latest applications from the internet each time and then installs them
  • WSUS - This utility will install the correct Windows Updates without needing a network connection

The SDI_CHOCO files are all kept under the \_ISO\WINDOWS\INSTALLS folder...

Once you have set up SDI_CHOCO, you can automatically install default drivers and any applications you choose.

If you add WSUS Offline Updater to the E2B drive, it will also install Windows Updates.

There is also provision to add your own drivers and applications too and have different configurations for different systems.

The *_SDI_CHOCO.XML files included for Windows 8 and Windows 10 Installer ISO files can automatically install drivers and applications, e.g.

  • NO KEY (choose a version to install) with SDI_CHOCO.xml - You will be requested to choose a Product Key (manual installation) -  driver+apps+updates are automated.
  • ZZDANGER_Auto_WipeDisk0_Win10HomeUK_with_SDI_CHOCO.xml - Automatically wipes hard disk 0, install Windows 10 Home with UK settings +drivers+apps+updates - completely hands-free!
You can make your own XML files without needing all the Microsoft bloatware SDK, just use WAFG+XMLtoE2B - see here.
 
Note: You can run 'Snappy' SDI directly from the E2B drive on any Windows system. This might be useful if you just want to update the drivers on an existing Windows system.
 
 

.TAG files

You can  create these files (any size or content) in the CONFIGS\XXXX folder (e.g. \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO\):
 
  • NoInternet.TAG - Internet connectivity will not be checked, msoobe will not be called during Specialize
  • NoChoco.TAG - choco will not be installed
  • NoSDI.TAG - The SDI driver installer will not run (useful if you install your own drivers)
  • NoWSUS.TAG - WSUS Offline Updater will not run

Note: Because Chocolatey is installed onto the target system, you can install more applications after the installation has finished, by simply typing (for example) 'cinst skype' from an admin command prompt or type 'choco list' to list all apps available or 'choco list note' to list all applications containing 'note'.

For Windows 7, Chocolatey will automatically install .Net 4 - this takes quite a while (10-20 minutes).

 

Getting Started

Here are the steps you need to prepare the E2B drive for SDI, choco and WSUS:

Prepare your E2B USB drive for SDI_CHOCO

1. This feature only works when using Microsoft Windows Installer ISO or .imgPTN files.

You therefore need to have either:

  • A large E2B USB 'Removable' type Flash drive + ISO files

OR

OR

  • An E2B USB drive with .imgPTN files (see end of this page)
     

Note: You cannot test this using a virtual machine + ISO files, because Windows needs to detect a Removable USB drive and all USB drives will appear as 'fixed disks' under a VM. Also, most VMs will set the E2B USB drive as the first (boot) disk!

Copy a suitable Windows 8.1 or 10 ISO file to the E2B \_ISO\WINDOWS\WIN8 or WIN10 folder, if not using .imgPTN files.
Note: There are internet connectivity bugs in the first release of Windows 10 TH2 and Anniversary ISOs.

If you now try one of the SDI_CHOCO XML files, it will work, but it will not yet install any extra drivers or applications or updates...

 

2. (optional) We must first download the SDI Driverpacks (max 13GB) onto the E2B drive, if you want to install missing, newer or 'better matched' drivers.

   It is best to do this operation using the intended target Windows system or a system of the same Model\Type.

However, it can be done on any Windows computer.

  1. Double-click on the \_ISO\WINDOWS\INSTALLS\SNAPPY\SDI_run.bat file to start the Snappy GUI
  2. Accept the Windows Firewall prompt.
  3. Now click on (click here to start the download) and either select all the Driverpacks, or just those for that system.
  4. Download all the Driverpacks (do NOT click on the green Install button!) - this may take a while!
If you wish, you can download the latest full SDI version with all drivers here and then copy the files to the E2B USB drive.

Once finished, I suggest you make a copy, in case you lose your E2B drive, to save having to download the driverpacks again.

Note: You should download and update to the latest version of SDI ('application') and the latest Index. You can delete older versions of SDI_??????.exe and just leave the latest version (one 32-bit and one 64-bit - e.g. SDI_R494.exe and SDI_x64_R494.exe).

3. (optional) WSUS Offline Updates

  1. Download and extract WSUS Offline Updater to your Windows hard disk.
  2.    Run the UpdateGenerator.exe application and tick the updates you require (see below).
  3. Download the updates (this may take some time)
  4.    Now copy the whole wsusoffline folder to the E2B USB drive \_ISO\WINDOWS\INSTALLS folder so that \_ISO\WINDOWS\INSTALLS\wsusoffline now contains the UpdateGenerator.exe application and all other files and folders.

Note: You will need to 'freshen' the updates once a week to keep them up to date.
 

4. (optional) Finally, you may want to install some applications:

  1.    Copy the \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO\Sample_MyStartup.cmd file and rename it to \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO\MyStartup.cmd

You can examine and change MyStartup.cmd if you wish.
Note that an internet connection is required for choco downloads.

You can use your own XML file if you wish (see here).

 

Checklist

  • Add MySpecialize.cmd?
  • Add MySetupcomplete.cmd?
  • Add MyStartup.cmd
  • Create .TAG files if required

Do not edit any of the existing files because they will be overwritten when you update your E2B drive with a newer version of E2B.

Installing Windows

  1. First connect an ethernet cable to the target system - internet access is required to install applications using choco.
    Note: For Windows 10 you will be prompted to set up WiFi if no ethernet\internet is available.
  2. Boot to E2B and select a Windows 8.1 or Windows 10 ISO as usual.
  3. Now choose one of the xxxxxxx_SDI_CHOCO.XML files - e.g. Windows 10 Home with SDI_CHOCO.xml (or a 'choose a key' with SDI_CHOCO and then choose a product Key).

Note: If you want to try one of the AutoWipe_xxxxxx_SDI_CHOCO.XML then these are fully automatic and will immediately wipe Hard Disk 0. Do not test it using Virtual Box if the USB drive is HDD0!

Tip: Copy any of the XML files that you don't want to a JUNK folder on the E2B drive to remove them from the list.

 

How SDI_CHOCO works

The XML file contains a 'Specialize' pass section which causes the \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO.cmd script on the E2B USB drive to run during the 'Specialize' phase.

The SDI_CHOCO.cmd script copies files from the SDI_CHOCO folder and adds two files to the target hard disk:

  • SetupComplete.cmd - this runs after Windows Setup has finished but before a user account is created and before user logon.
  • Startup.cmd - this runs on first user logon.

As well as these two files, it also copies the entire contents of the SDI_CHOCO folder to C:\DRIVERS. If wsusoffline is present, this folder is also copied to the C:\DRIVERS folder.

Next (after a reboot) SDI_CHOCO.cmd runs SDI directly from the E2B USB drive and will install drivers.

Next SDI_CHOCO.cmd checks it has internet access (if installing Windows 10 - please use the latest version of TH2 - the first version of TH2 had network bugs!)

Next SDI_CHOCO.cmd will install Chocolatey (if required) and run the MySpecialize.cmd script (if present)

Next the system will reboot and complete the installation of Windows.

Next it will run SetupComplete.cmd which will call the MySetupComplete.cmd script (if present)

If autologon was enabled (or after you create a new user), the Startup.cmd file will run and call MyStartup.cmd script will run (if present).

You can create and edit the three controlling files MySpecialize.cmd, MySetupComplete.cmd and MyStartup.cmd - use the example Sample_Myxxxxxx.cmd files as templates.

Order of execution

  1. SDI_CHOCO.cmd  (contents of .\CONFIGS\SDI_CHOCO\* copied to C:\DRIVERS)
  2. Call C:\DRIVERS\MySpecialize.cmd (USB drive can be removed)
  3. Reboot
  4. C:\DRIVERS\SetupComplete.cmd will call C:\DRIVERS\MySetupComplete.cmd
  5. User account(s) created
  6. OOBE starts
  7. C:\DRIVERS\Startup.cmd (wsusoffline is run if present) then will call C:\DRIVERS\MyStartup.cmd

.tag files

Also, these .tag files can be added for more control:

  • \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO\NoWSUS.tag - suppresses Windows offline updates
  • \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO\Nochoco.tag - suppresses choco installs
  • \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO\NoSDI.tag - suppresses the SDI driver installer
  • \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO\NoInternet.tag - do not launch MSOOBE to allow user to connect to WiFi if no WAN available

The \_ISO\WINDOWS\INSTALLS folder structure

  • \_ISO\WINDOWS\INSTALLS - contains the SDI_CHOCO sub-folders
  • \_ISO\WINDOWS\INSTALLS\APPS - example folder for an offline application is included
  • \_ISO\WINDOWS\INSTALLS\CONFIGS - contains the main scripts that must be specified in the XML file and kicks off the whole thing. Also contains a sub-folder which is copied across to the target hard drive.
  • \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO - contains the SDI_CHOCO scripts and helper utilities - these are copied across to the target hard drive.
  • \_ISO\WINDOWS\INSTALLS\DRIVERS - you can keep your bespoke drivers here and copy them to the target hard disk - use sub-folders.
  • \_ISO\WINDOWS\INSTALLS\SNAPPY - contains the Snappy SDI files but you need to add Driverpacks first
  • \_ISO\WINDOWS\INSTALLS\wsusoffline - add WSUS files here if you want to install offline Windows Updates

 

Auto-activation

If the system has already been registered with Microsoft and activated, you can use the autoactivate.cmd script to automatically activate it again (requires internet access).

You must download the get_win8key.exe file and add it to the \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO folder.

:: Activate if get_win8key.exe has been added
:: get_win8key.exe can be downloaded from   github.com/christian-korneck/get_win8key#files  
:: Right-click - Properties - UnBlock  after downloading the file
:: Must be run as Admin
if exist %systemdrive%\DRIVERS\get_win8key.exe call %systemdrive%\DRIVERS\autoactivate.cmd
 
The system BIOS\Firmware should already contain a Win8 or Win10 embedded OEM key.
 

How to install bespoke drivers (example for Lenovo)

Lenovo provide Windows 10 downloads for the IdeaPad 300 notebook in the form of executables.

1. These must first be extracted as follows:

  1. Double-click the .exe file to run it
  2. Click Next\OK to extract the files to the C:\DRIVERS folder - I suggest you rename the folder name and remove any spaces.
  3. Do NOT proceed to install the drivers - untick the box and click Finish.

Do this for each of the drivers/applications.

2. Now copy all the sub-folders that are in C:\DRIVERS to \_ISO\WINDOWS\INSTALLS\DRIVERS\IDPAD300\W10_8_64

3. Now prepare a .cmd script that will install each driver \_ISO\WINDOWS\INSTALLS\DRIVERS\IDPAD300\W10_8_64\ID300_DRIV_INST.cmd

The difficult bit is in finding the correct switches to make the drivers install silently!

Here is an example folder file structure for Windows 8 and Windows 10 64-bit drivers for the IdeaPad 300:

\_ISO\WINDOWS\INSTALLS\DRIVERS\IDPAD300\W10_8_64\ID300_DRIV_INST.cmd
\_ISO\WINDOWS\INSTALLS\DRIVERS\IDPAD300\W10_8_64\CHIPSET
\_ISO\WINDOWS\INSTALLS\DRIVERS\IDPAD300\W10_8_64\VGA

etc.

Here is an example ID300_DRIV_INST.cmd file:

pushd "%~dp0"
dir
:: Possible switches -s or /SILENT /NORESTART or  /S /v/qn  or /qn /norestart  or -s -sms ???
start /wait dotnetfx35.exe /q /norestart
start /wait .\Power\POWER_ACPI_acpidriver.exe /SILENT /norestart
start /wait .\chipset\setupchipset.exe -s -norestart
start /wait .\IME\MEISetup.exe -s
start /wait .\RealtekLAN\setup.exe -s
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\iastora\Parameters\Device /v Controller0Phy1ANEnable /t REG_DWORD /d 0 /f
reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\iastora\Parameters\Device /v Controller0Phy1ANEnable | find /i "0x0"
start /wait .\RealtekCardRdr\setup.exe -s
start /wait .\ConexantAudio\setup.exe -s
start /wait .\VGA\Setup.exe -s
timeout 5
start /wait .\camera\Alcor_2.44.50.23\setup -s
start /wait .\camera\Realtek_6.3.9600.11105_WHQL\setup -s
start /wait .\LenovoUtility\setup.exe /SILENT
start /wait .\LenovoOptimizer\pt_install_msi.exe /Q /SILENT
start /wait .\SysIntFoundation\SystemInterfaceFoundation.exe /SILENT /norestart
start /wait _Solution_centre_updates_lscsetup_x64_33003.exe /s /v/qn
start /wait .\TPAD\install.exe /S
:: tpad doesn't wait - so delay
timeout 20
echo Finished!

 

Note: The 'reg add' lines are taken from one of the IdeaPad 'tweak' driver downloads and were added into the .cmd file.

4. Now edit the MySpecialize.cmd file so that it copies the whole folder from the USB drive to the target hard disk and then run the ID300_DRIV_INST.cmd script.

This example allows us to remove the USB drive as soon as the drivers have been copied to C:\DRIVERS

MySpecialize.cmd

:: Environment variables that are already available:
:: %USB% is the USB drive - e.g. D:
:: %BIT% will either be x86 or amd64
:: %WINVER% will be 7 or 8 or 10
:: %CONFIGDIR% will be %USB%\_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO
:: %log% will be the log file
:: %errlog% will be a log file to record errors
:: %systemdrive%\DRIVERS folder will hold all files that were in %USB%\_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO
 
:: Download and install some choco applications - it is best to install choco apps using Startup.cmd
:: Some choco apps installed at this stage of Setup may not register correctly
 
:: activate Windows if possible using BIOS OEM key
call C:\DRIVERS\autoactivate.cmd
 
if exist %systemdrive%\DRIVERS\NoChoco.TAG start /wait %systemdrive%\DRIVERS\nircmd speak text "WARNING: The file No Choco dot tag was found - choco installs will NOT work"
 
choco install 7zip.install -r -y >> %log%
 
:: Copy bespoke drivers for IdeaPad 300
xcopy /herky %USB%\_ISO\WINDOWS\INSTALLS\DRIVERS\IDPAD300\W8_10_64\*.* %systemdrive%\DRIVERS\IDPAD300\W8_10_64\
 
:: We can remove the USB drive now before we install the drivers
:: This script is now running directly from C:\DRIVERS - use 'exit' so it does not return to the USB drive cmd file
echo.
echo YOU CAN REMOVE THE E2B USB DRIVE IF [CAPS LOCK] OR [SCROLL LOCK] LED IS LIT...
echo.
start /wait %systemdrive%\DRIVERS\nircmd.exe speak text "You can remove the USB drive now"
:: Turn on CAPSLOCK to indicate safe to remove E2B
start /wait %systemdrive%\DRIVERS\nircmd sendkeypress capslock scroll
timeout 5
 
:: Now install drivers from the C: drive
echo %date% %time% Installing drivers >> %log%
call %systemdrive%\DRIVERS\IDPAD300\W8_10_64\ID300_DRIV_INST.cmd
start /wait %systemdrive%\DRIVERS\nircmd.exe speak text "Driver install completed"
 
:: Do NOT return back to the end of SD_CHOCO.cmd because it is running from the USB drive which is now gone!
exit
 

5. Create a \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO\NoSDI.tag file to prevent the Snappy SDI from installing the generic drivers. It can be an empty file.

See my blog for more details.

Also note: The MySpecialize.cmd file contains the following lines:

:: activate Windows if possible using BIOS OEM key
call C:\DRIVERS\autoactivate.cmd
:: Remove this line if you want to install bespoke drivers (example below)
goto :eof

:: Install bespoke driver
:: Copy bespoke drivers for IdeaPad 300
xcopy /herky %USB%\_ISO\WINDOWS\INSTALLS\DRIVERS\IDPAD300\W8_10_64\*.* %systemdrive%\DRIVERS\IDPAD300\W8_10_64\

:: We can remove the USB drive now before we install the drivers
...more here

The lines in red should be deleted (goto :eof means 'go to the end of the file' so any lines following it will never be executed) and you should change the 'xcopy' line below it as required for your drivers.

 

How to install bespoke apps offline

Choco (Chocolatey) requires an internet connection. However, you can install applications without requiring an internet connection by adding the packages to your E2B drive first.

You can download application install files from   npackd.appspot.com. Choose the versions you want and copy them to the E2B USB drive \_ISO\WINDOWS\INSTALLS\APPS folder (use sub-folders for each one).

Copy the .exe or .msi files to the C:\DRIVERS\ folder (add xcopy lines to MySpecialize.cmd), and then install them from C:\DRIVERS on the hard disk (add lines to MyStartup.cmd). 

To install them silently, use this syntax (example for Foxit Reader):

MySpecialize.cmd

:: Copy bespoke apps
xcopy /herky %USB%\_ISO\WINDOWS\INSTALLS\APPS\FOXIT\*.* %systemdrive%\DRIVERS\APPS\FOXIT\
:: place .cmd file C:\DRIVERS\APPS folder so it will auto-run
xcopy %USB%\_ISO\WINDOWS\INSTALLS\APPS\FOXIT\Foxauto.cmd %systemdrive%\DRIVERS\APPS\

 

MyStartup.cmd (only required if no .cmd is copied to C:\DRIVERS\APPS folder)

start /wait C:\DRIVERS\APPS\FOXIT\FoxitReader734_enu_Setup_Prom.exe /silent
 

The advantage of installing apps directly, is that internet access is not required and you can disable choco (using NoChoco.tag). The installation is thus completely offline.

Note: StartUp.cmd already contains the lines:

:: ----- BESPOKE APP INSTALL ---
:: Install any apps we have added - run all .cmd files in DRIVERS\APPS folder...
FOR %%I IN (%systemdrive%\DRIVERS\APPS\*.cmd) DO CALL :loopbody %%I

This means that any *.cmd files that you copy to the C:\DRIVERS\APPS folder should automatically run. You can examine the .log files in C:\temp to see if it was called.
 

You may also wish to use NiNite to install applications. If you use the Pro version you can use the /Silent switch to install apps silently and /freeze for offline installs.

 

Adding multiple versions of SDI_CHOCO for different systems

Let us suppose you want to install Windows 10 to three different systems (say a Dell PC, a Lenovo notebook and an HP notebook).

Also, you want to install two different sets of software (say one for Software Development and one for general use).

This means you will need to create six different copies of the SDI_CHOCO folder and create six XML files.

Example: Dell_XPS27_Dev

1. Copy the \_ISO\WINDOWS\INSTALL\CONFIGS\SDI_CHOCO\SDI_CHOC.cmd file and rename it to Dell_XPS27_Dev.cmd

2. Copy the \_ISO\WINDOWS\INSTALL\CONFIGS\SDI_CHOCO folder and rename it to Dell_XPS27_Dev

3. Edit the \_ISO\WINDOWS\INSTALL\CONFIGS\Dell_XPS27_Dev.cmd file and change the line:

set CONFIGDIR=%USB%\_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO
to
set CONFIGDIR=%USB%\_ISO\WINDOWS\INSTALLS\CONFIGS\Dell_XPS27_Dev

 

4. Make a new XML file for your system or find an existing SDI_CHOCO.xml file

Make sure it has a RunSynchronous section for the Specialize pass which runs your CONFIGS\xxxx.cmd file (look at one of the existing xxxxSDI_CHOCO.XML files for reference).

Note: If there are already RunSynchronous entries, make sure you change the x Order number!

Make sure you change "SDI_CHOCO.cmd" to "Dell_XPS27_Dev.cmd"  (four places).

 

5. Now you can edit the Myxxxx.cmd files to install applications or drivers (use the Sample_Myxxxxx.cmd files as templates).

 

Using SDI_CHOCO with .imgPTN files (for UEFI booting)

 
It is possible to use the same SDI_CHOCO installation process using a .imgPTN file, however it is more complicated to set up.
 
You will need the latest MPI Tool Kit which contains the \e2b\Stage1.cmd and Stage2.cmd files.
 
IMPORTANT: Note that the XML file needs to be named \Unattend.XML if it does NOT contain a WindowsPE configuration pass, or \AutoUnattend.xml if it does contain a WindowsPE pass (more info here).
.imgPTN files can be copied to any of the primary menu folders (e.g. \_ISO\MAINMENU or \_ISO\WINDOWS\WIN10 or \_ISO\WINDOWS\WIN8 or \_ISO\WIN, etc.)
 
WARNING: If you use an XML file which automatically wipes the target hard disk, then as soon as you UEFI-boot from the .imgPTN file, Windows Setup will wipe the target hard disk WITHOUT ANY WARNING. For this reason, I suggest you name the .imgPTN something like  DANGER_AUTOWIPE_Windows10x64_SDI_CHOCO.imgPTN to remind you!
REMEMBER: Never leave the E2B USB drive with the .imgPTN file 'switched in' - if you stick the USB drive into your office PC and boot from it, then it will immediately wipe your office PC hard disk!
 

Removable E2B USB drive

If your E2B USB drive is a removable drive, the process is as follows:
 
1. Make your .imgPTN file from an ISO (e.g. Windows 10 Aniversary) - use the MPI_FAT32 shortcut if you want UEFI-booting to work
2. Switch to the .imgPTN image (e.g. using \_ISO\Switch_E2B.exe)
3. Ensure the \e2b\Stage1.cmd and \e2b\Stage2.cmd files are present
4. Copy the XML file as \Unattend.xml or \AutoUnattend.xml to the root of the partition (it should run \e2b\Stage1.cmd). An example XML file for an MBR (not UEFI) install which auto-formats drive 0 is included in the e2b folder; you can copy this and rename it as \AutoUnattend.xml to use with the 'English' USA ISO version or Win10.
5. (optional) Create a \e2b\MyConfig.cmd file and add a 'set CONFIG=' line as the name of your main configuration file - e.g. if you want it to run \_ISO\WINDOWS\INSTALLS\CONFIGS\IdeaPad300.cmd, then use:

set CONFIG=IdeaPad300.cmd
If you don't create a MyConfig.cmd file, SDI_CHOCO.cmd will be used.
6. Ensure that RMPartUSB.exe and FindCSMandRestoreE2B.cmd are present in the \e2b folder. Ensure that \WINHELPER.USB does NOT exist.

Required files:
\Unattend.xml
\e2b\Stage1.cmd
\e2b\Stage2.cmd
\e2b\FindCSMandRestoreE2B.cmd
\e2b\RMPartUSB.exe
\e2b\MyConfig.cmd  (optional)

IMPORTANT: Note that the XML file needs to be named \Unattend.XML if it does NOT contain a WindowsPE configuration pass, or \AutoUnattend.xml if it does contain a WindowsPE pass.
 

Fixed-disk E2B USB drive

If your E2B USB drive is a Fixed-disk drive (e.g. USB HDD), then you will need to mount the \sources\boot.wim file and add the same files into the root of the boot.wim image. 
 
WinNTSetup: If you use WinNTSetup.exe to install Windows, then you will not have to modify the boot.wim.
  1. Boot to WinPE (x86 or x64SysWow) can be MBR boot or UEFI-boot from .imgPTN file
  2. Run e2b\FindCSMandRestoreE2B.cmd if .imgPTN booting
  3. Run WinNTSetup.exe from E2B partition, partition target hard disk, select SDI_CHOCO XML file and click WinNTSetup Start button
See here for more details.
 
For details on how to mount the boot.wim file see here.
 
Note (MPI v0.068+): If you wish, you can instead connect a small Removable 'WinHelper' flash drive as well as the Fixed-disk E2B drive and place the XML file in the root of the .imgPTN partition. The file must be called \AutoUnattend.XML (or \Unattend.XML - see box above). It will be copied to the WinHelper USB drive when you boot to the CSM menu. The WinHelper flash drive must contain the 100K dummy XML files.
If you are UEFI-booting, you must either boot to the CSM menu first (not in a VM), or ensure that you manually copy the \AutoUnattend.xml file to the WINHELPER flash drive just before you boot via UEFI.
Using this method, you do not need to edit the boot.wim file.
 
1. Make your .imgPTN file from an ISO (e.g. Windows 10 Aniversary) - use the MPI_FAT32 shortcut if you want UEFI-booting to work
2. Switch to the .imgPTN image (e.g. using \_ISO\Switch_E2B.exe)
3. Mount the correct boot.wim image (e.g. as C:\mount1)
4. Copy the e2b folder from the USB drive to the root of the image folder (e.g. C:\mount1\e2b\*)
5. Copy the XML file as \Unattend.xml to the root of the image folder (or \AutoUnattend.xml - see box)
6. (optional) Create a \e2b\MyConfig.cmd file and add a 'set CONFIG=' line as the name of your main configuration file - e.g. if you want it to run \_ISO\WINDOWS\INSTALLS\CONFIGS\IdeaPad300.cmd, then use:
set CONFIG=IdeaPad300.cmd
If you don't create a MyConfig.cmd file, SDI_CHOCO.cmd will be used.
 

Required files (when boot.wim is mounted under Windows):
C:\mount1\Unattend.xml (or \AutoUnattend.xml)
C:\mount1\e2b\Stage1.cmd
C:\mount1\e2b\Stage2.cmd
C:\mount1\e2b\FindCSMandRestoreE2B.cmd
C:\mount1\e2b\RMPartUSB.exe
C:\mount1\e2b\MyConfig.cmd  (optional)

Note: The Unattend.XML file must contain a Specialize RunSynchronous section that looks for and runs \Stage1.cmd and not the SDI_CHOCO.cmd file (see included example in the MPI .\csm\e2b folder).

IMPORTANT: Note that the XML file needs to be named \Unattend.XML if it does NOT contain a WindowsPE configuration pass, or \AutoUnattend.xml if it does contain a WindowsPE pass.
 

How it works

When the E2B drive boots, the original E2B partition is hidden. Windows can only see the .imgPTN partition.

  1. Stage1.cmd first copies Stage2.cmd and some other files to the target hard drive (C:\DRIVERS).
  2. It then runs Stage2.cmd. Stage2.cmd runs from the hard drive and calls FindCSMandRestoreE2B.cmd which switches back the E2B drive to 'E2B Mode' - this makes the \_ISO\WINDOWS\INSTALLS folder accessible.
  3. Stage2.cmd then locates the E2B USB drive and calls the required configuration file - e.g. \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO.cmd.
  4. From then on, the process is the same as if you installed from an ISO file.

Note that the next time you boot to E2B from the USB drive, it will be in 'E2B Menu mode' and not 'CSM Menu mode'.

The 'no internet' problem

The first release of Win10 TH2 did not correctly set up the network interface when it reached the Specialize phase during Windows Setup. Microsoft fixed this in later versions of TH2.

Windows 8.1 did not have this issue.

Microsoft have also repeated the same mistake(!) in the first release of the Anniversary version of Win10!

SDI_CHOCO attempts to get round this by running msoobe for ten seconds and then killing msoobe. This seems to fix the problem.

If there is still no internet connectivity and you are installing Win10, SDI_CHOCO will launch msoobe again which allows you to set up a WiFi connection. Once you have done this, use ALT-TAB to switch back to SDI_CHOCO and press ENTER to continue. SDI_CHOCO will then terminate msoobe.

If you only install apps using choco using MyStartup.cmd, you may be able to avoid this issue because the internet connection may be working by then!

Tip: Add the file NoInternet.TAG to the \_ISO\WINDOWS\INSTALLS\CONFIGS\SDI_CHOCO folder to stop SDI_CHOCO from checking for internet access and launching msoobe.

Logging

Log files will be present in the C:\Temp folder. Some errors may be logged in separate *_ERRORS.log files.

C:\Temp\SDI_CHOCO.log
C:\Temp\setupcomplete.log
C:\Temp\startup.log

If the main SDI_CHOCO.cmd file was run (or whatever you have in the XML file) the file C:\WINDOWS\DONE_SDI.tag will be present. If that file is not present, then the XML entry was not executed.

Tip: If some of the .log files seem to be missing some lines and start with text generated by lines of code that you have written, check for syntax bugs in your code where you have written > %log% instead of >> %log% !!!

 

Debugging and Troubleshooting

if you place the command 'echo on' at the beginning of a file, it will allow you to see what happens when your MySpecialize.cmd and MyStartUp.cmd.

Also, remove any >> %log% text from your MySpecialize.cmd and MyStartUp.cmd files if you want to see any output from the commands.

For instance, if you have a line of code which does not seem to work, such as:

xcopy /herky %USB%\_ISO\WINDOWS\INSTALLS\DRIVERS\IDPAD300\W8_10_64\*.* %systemdrive%\DRIVERS\IDPAD300\W8_10_64\

and there are no files being copied to the C:\DRIVERS\IDPAD300\W8_10_64\ folder, change the lines to:
 
echo on
echo About to run xcopy
pause
xcopy /herky %USB%\_ISO\WINDOWS\INSTALLS\DRIVERS\IDPAD300\W8_10_64\*.* %systemdrive%\DRIVERS\IDPAD300\W8_10_64\

echo xcopy has run
pause
echo off

and start an installation. You should find that when the script file is run, it will stop at 'About to run xcopy', then press ENTER and it should copy the files over using xcopy and then stop again with the message 'xcopy has run'. This will allow you to see if the xcopy worked or reported an error. Finally, press ENTER again and the installation will continue.

When it is all working, you can remove the extra lines.

The script files, SDI_CHOCO.cmd and startup.cmd both start with the line 'echo off'. This stops all the commands from being displayed in the console. If you wish, you can change 'echo off' to 'echo on' at the start of these files, so that you can see all the commands being executed. You can also place 'pause' lines anywhere you like in your Myxxxxx.cmd files, so you can pause the script and see what is going on.

Remember that if you update E2B to a newer version, the original E2B files (e.g. SDI_CHOCO.cmd and StartUp.cmd, etc.) will be overwritten with the newer version. However, any Myxxxxxx.cmd files will not be changed.





More Info