Monday 28 January 2019

E2B v1.A9e Beta available

I have improved the WinNTSetup and WIMBOOT support in E2B.

Download v1.A9e here.

Changes are:

  • Using the override name suffix of _.WinNTSetup.iso now also works for dual architecture install ISOs (x86+x64)
  • You can now run your own batch script for any WIMBOOTed ISO by specifying a grub4dos STARTUP variable which contains the path to your own batch file.
For instance, if you have a Win10 ISO on the E2B USB drive, you could place it in the usual \_ISO\WINDOWS\Win10 folder and give it a name of say...


Now you can select it in the Windows 10 menu as usual.

  • If you press ENTER when prompted to repair, it will boot and run WinNTSetup.
  • If you allow the repair prompt to timeout, the normal WIMBOOT Setup.exe install process will run.
  • You could also boot to it from a .mnu file in an E2B menu folder and run your own batch file after it boots to WinPE by specifying the name of the batch file in the .mnu file.

For instance, you could semi- or fully-automate WinNTSetup in your batch file, by specifying an XML file and which Edition to install, load a WinNTSetup.cfg file, etc. etc. etc.

You could also run a diskpart script from your batch file to automate the wiping, partitioning and formatting of the target drive first, before you start WinNTSetup.exe (or just hit Ctrl+Shift+D in WinNTSetup and run one of the pre-made diskpart scripts).

WinNTSetup exercise:

First update to v1.A9e

1. Copy a Windows 10 Install ISO to the \_ISO\MAINMENU folder
2. Copy the \_ISO\e2b\grub\start_WinNTSetup.bat to the \_ISO\docs\E2B Utilities\WinNTSetup folder on the E2B drive - rename it as test_WinNT.bat
3. Download WinNTSetup and extract the contents to the same \_ISO\docs\E2B Utilities\WinNTSetup folder. Unattend.XML files can be placed here too if you plan on using them.
4. Run WinNTSetup_x86.exe under Windows to automatically download some needed files.
5. Copy the WinNTSetup.mnu file to the \_ISO\MAINMENU folder (you can find it in \_ISO\docs\Sample mnu Files\Windows on E2B drive) and edit the text shown in red below. 
6. Edit the \_ISO\docs\E2B Utilities\WinNTSetup\test_WinNT.bat file as required (or replace contents with the example below).

These are the files used in the example below:
  • \_ISO\docs\E2B Utilities\WinNTSetup\test_WINNT.bat
  • \_ISO\docs\E2B Utilities\WinNTSetup\Win10ProUK_with_SDI_CHOCO.xml
  • \_ISO\docs\E2B Utilities\WinNTSetup\WinNTSetupH.ini
  • \_ISO\MAINMENU\Windows10_2018_08_03_UK_Both.iso
Now boot from the .mnu file (not the ISO file) in the Main Menu and it should automatically boot to WinNTSetup. From there you can partition the target disk (as a GPT disk if you wish) and install Windows (for UEFI if you wish).

Tip: You can type the key-chord Ctrl+Shift+D to run a diskpart script (take care!).

You can save a configuration using Ctrl+S in WinNTSetup and then specify the ini file as the configuration file in your batch file. Thus you can save and load all the tweak settings, etc. automatically.

Here is the sample WinNTSetup.mnu file:

# E2B v1.A9 or later - see
# This allows you to automatically run WinNTSetup with any WinNTSetup command line parameters you want after booting from a Windows install iso
# Copy the \_ISO\e2b\grub\start_WinNTSetup.bat to your \_ISO\docs\E2B Utilities\WinNTSetup folder on the E2B drive (or \WinNTSetup folder)
# Rename it and edit the .bat file so that the WinNTSetup line includes the command line parameters - e.g. -unattend:xxx -wimindex:xxx, etc.
# Copy your XML file to the same folder as WinNTSetup_xx.exe

# .bat file example command line (near end of test_WinNT.bat):
# "%wpath%\WinNTSetup%pp%.exe" NT6 -source:"%MYISO%" -wimindex:"2" -unattend:"Win10ProUK_with_SDI_CHOCO.xml" -sysPart:C: -tempDrive:C:
# "%wpath%\WinNTSetup%pp%.exe" NT6 -source:"%MYISO%" -wimindex:"5" -cfg:WinNTSetupH.ini

iftitle [if exist /_ISO/MAINMENU/Windows10_2018_08_03_UK_Both.iso] Windows 10 + WinNTSetup\nBoot to Windows 10 and run WinNTSetup
# Use forward slash instead of \, and we must escape (precede) any spaces using \
# Specify location of ISO (can use $HOME$/Windows10_2018_08_03_UK_Both.iso if in same folder as this file)
set ISO=/_ISO/MAINMENU/Windows10_2018_08_03_UK_Both.iso
# Specify our special batch file
set STARTUP=/_ISO/docs/E2B\ Utilities/WinNTSetup/test_WinNT.bat
#we only need to use the 'force.WinNTSetup' keyword if the name of the ISO does not end in _.WinNTSetup.iso...
QRUN.g4b force.WinNTSetup %ISO% 

and here is a test_WinNT.bat file which you can make by copying and editing the default one (\_ISO\e2b\grub\start_WinNTSetup.bat) used by E2B:

@echo off
color 1f
TITLE %~dpnx0 (E2B-WIMBOOT test_WinNT.bat)
REM prevent wpeinit from running again
ren X:\windows\system32\wpeinit.exe wpeinit.exe.old

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:\_ISO\e2b\grub\e2b.cfg set E2BDRIVE=%%I:
IF "%E2BDRIVE%"=="" (
goto :EOF

cd %E2BDRIVE%\
REM get the naame of the ISO
if exist %E2BDRIVE%\_ISO\e2b\firadisk\isoname.cmd call %E2BDRIVE%\_ISO\e2b\firadisk\isoname.cmd
set pp=_x86
if /i "%PROCESSOR_ARCHITECTURE%"=="AMD64" set pp=_x64
set wpath=%E2BDRIVE%\WinNTSetup
if not exist "%wpath%\WinNTSetup%pp%.exe" set wpath=%E2BDRIVE%\_ISO\docs\E2B Utilities\WinNTSetup
if not exist "%wpath%\WinNTSetup%pp%.exe" echo ERROR: WinNTSetup%pp%.exe not found on %E2BDRIVE% & pause
"%wpath%\WinNTSetup%pp%.exe" NT6 -source:"%MYISO%" -wimindex:"5" -cfg:"MySpecial.ini" -sysPart:D: -tempDrive:D:
start /w cmd

This batch file will select wim image number 5 and load any options from the MySpecial.ini file.

Note that you must specify the wimindex number as well as the source ISO file path even if you also specify a .cfg file.

You can specify an XML file like this:

"%wpath%\WinNTSetup%pp%.exe" NT6 -source:"%MYISO%" -wimindex:"2" -unattend:"Win10ProUK_with_SDI_CHOCO.xml" -sysPart:C: -tempDrive:C:

The WindowsPE pass section is ignored in the XML file, so if you pick say a ZZZDANGER_WipeDisk0_WindowsProUK.XML file, it will NOT wipe disk 0 or pick an Edition to install. Partitioning\formatting must be done manually and/or from the batch file + adding WinNTSetup parameters.

You can have multiple .mnu files for the same ISO and each one can run WinNTSetup to install a different configuration.

If your target system can CSM-boot, you can easily MBR-boot to the E2B menu and then install a GPT+UEFI OS using this method.

No comments:

Post a Comment