Anleitung zur Betriebssysteminstallation für Windows 10
OPTIMAL OS-Deploy (V5.2.0 Hilfe V1.3, 16.06.2021)
Zur Zeit in Bearbeitung

Shell Commander

Der OPTIMALShell Commander ist eine Oberfläche die eigene Kommandos über XML ausführt und sowohl beim Booten von WinPE wie auch bei der Post Installation von Rechnern verwendet wird.

Bei der Vorbereitung des WinPE Boot-Images wird der OPTIMALShell Commander automatisch in das WinPE Boot-Image übernommen.

Weiterhin wird der OPTIMALShell Commander bei den Installationsmethoden BootWinPE, BootWinPE+XP64, BootWinPE+PostXP+ImageX, BootWinPE+PostXP+Setup und BootWinPE+PostXP+Setup(Copy) verwendet.

Sobald die Installationsmethode BootWinPE enthält, wird automatisch ein Windows PE gebootet und der OPTIMALShell Commander verwendet.

Vorteile 

  • XML basiert
  • Flexibel
  • Ausführung von beliebigen Kommandos
  • Erstellung von eigenen Windows PE Boot-Kommandos
  • Aufschaltung per VNC während der Installation
  • Aufschaltung per VNC im Fehlerfall

Beispiel

Im Folgenden betrachten wir ein Beispiel zur ImageX Installation eines Rechners.

Beispiel des Shell Commanders anhand einer Image Installation

Folgende Schritte werden durch den OPTIMALShell Commander ausgeführt:

  • Initializing winPE: Windows PE wird initialisiert
  • DisableFirewall: Die Firewall des Windows PE wird abgeschaltet
  • wait for server: Die Verbindung zum Server wird geprüft
  • connect to server: Eine Verbindung zum Server wird aufgebaut
  • connect to winPE commands: Die entsprechende auszuführende XML-Datei wird geladen

Danach werden die Kommandos für die aktuelle Funktion ausgeführt (in diesem Fall eine Vista-Installation mit einem Image):

CleanBootFile: die Bootdatei wird gelöscht, sodass der Rechner beim nächsten Boot kein Kommando mehr ausführt und lokal bootet

Partitioning: der Status der Partitionierung wird an den Server übermittelt

Create Partitions: die Platte wird entsprechend den Vorgaben partitioniert

Getting configuration: Alle beim Rechner hinterlegten Konfigurationen werden übertragen

Getting setup file: die generierte unattend.xml wird auf den Rechner übertragen

Reporting Status Setup: der Status-Setup wird an den Server übermittelt

Applying OS: Das Betriebssystem wird mit Hilfe von ImageX installiert

Getting PostXP command: Die nach der Betriebssysteminstallation erforderlichen Kommandos werden übertragen

Getting OPTIMALShell: Der OPTIMALShell Commander wird installiert

Getting OPTIMALshell Login: Die Logindaten für den OPTIMALShell Commander werden übertragen

Getting OPTIMALshell commands: Die Kommandos für den OPTIMALShell Commander werden übertragen

DisableVNC: Der VNC-Server wird gestoppt

Reboot: Es erfolgt ein Reboot und die Post-Injection-Phase der Installation wird angestoßen

XML Kommando

Das entsprechende XML-Kommando wird automatisch generiert und lautet:

<?xml version="1.0" encoding='iso-8859-1'?> 
<shellcommands> 

  <shellcommand> 
     <label title="TRAIN01: ImageX 'Image Vista Service Pack 2 (Deutsch)'" description="TRAIN01: Initialisation phase 2..."> CleanBootFile </label> 
     <command> DeleteFile </command> 
     <parameter> z:\bootdisk\tftpboot\pxelinux.cfg\01-00-~2 </parameter> 
  </shellcommand> 

  <shellcommand> 
     <label> DefineServers </label> 
     <command> DefineServers </command> 
     <parameter> local | TRAIN06 | TRAIN06 </parameter> 
  </shellcommand> 

  <shellcommand> 
     <label hidden="true"> EnableVNC </label> 
     <command> EnableVnc </command> 
  </shellcommand> 

  <shellcommand> 
     <label> Partitioning </label> 
     <command> CreateFile </command> 
     <parameter> z:\install\computer\76a538ac\parting  </parameter> 
  </shellcommand> 

  <shellcommand> 
     <label> Create Partitions </label> 
     <command> Run </command> 
     <parameter> diskpart.exe /s z:\install\computer\76a538ac\diskpart.txt </parameter> 
  </shellcommand> 

  <shellcommand> 
     <label hidden="true"> Parted </label> 
     <command> CreateFile </command> 
     <parameter> z:\install\computer\76a538ac\parted  </parameter> 
  </shellcommand> 

  <shellcommand> 
     <label hidden="true"> Parted </label> 
     <command> DeleteFile </command> 
     <parameter> z:\install\computer\76a538ac\parting  </parameter> 
  </shellcommand> 

  <shellcommand> 
     <label> Getting configuration </label> 
     <command> CopyTree </command> 
     <parameter> z:\install\computer\76a538ac\config | c:\config </parameter> 
  </shellcommand> 

  <shellcommand> 
     <label> Getting setup file </label> 
     <command> Run </command> 
     <parameter> xcopy z:\install\computer\76a538ac\unattend.xml c:\  /y /q  </parameter> 
  </shellcommand> 

  <shellcommand> 
     <label> Reporting Status Setup </label> 
     <command> CreateFile </command> 
     <parameter> z:\install\computer\76a538ac\ntsetup  </parameter> 
  </shellcommand> 

  <shellcommand> 
     <label hidden="true"> Parted </label> 
     <command> DeleteFile </command> 
     <parameter> z:\install\computer\76a538ac\parted  </parameter> 
  </shellcommand> 

  <shellcommand> 
     <label description="TRAIN01: Applying image 'Vista Sp2 Deutsch\install.wim'..."> Applying OS  </label> 
     <command> ImageX </command> 
     <parameter> /apply "z:\config\os\Vista Sp2 Deutsch\install.wim" 1 c: /verify </parameter> 
  </shellcommand> 

  <shellcommand> 
     <label description="TRAIN01: Transfer PostXP installation..."> Getting PostXP command  </label> 
     <command> CopyFile </command> 
     <parameter> z:\config\unattended\PostXP.PostInstall.Setupcomplete.cmd.txt | c:\windows\Setup\scripts\Setupcomplete.cmd </parameter> 
  </shellcommand> 

  <shellcommand> 
     <label> Getting OPTIMALShell </label> 
     <command> CopyFile </command> 
     <parameter> z:\config\winpe\OPTIMALshell.exe | c:\windows\Setup\scripts\OPTIMALshell.exe </parameter> 
  </shellcommand> 

  <shellcommand> 
     <label> Getting OPTIMALshell Login </label> 
     <command> CopyFile </command> 
     <parameter> z:\config\winpe\OPTIMALshell.ini| c:\windows\Setup\scripts\OPTIMALshell.ini </parameter> 
  </shellcommand> 

  <shellcommand> 
     <label> Getting OPTIMALshell Commands </label> 
     <command> CopyFile </command> 
     <parameter> z:\install\computer\76a538ac\OPTIMALshell.xml| c:\windows\Setup\scripts\OPTIMALshell.xml </parameter> 
  </shellcommand> 

  <shellcommand> 
     <label> DisableVnc </label> 
     <command> DisableVnc </command> 
  </shellcommand> 

  <shellcommand> 
     <label> Reboot </label> 
     <command> Run </command> 
     <parameter> wpeutil reboot  </parameter> 
  </shellcommand> 

</shellcommands> 

Post-Injection

Die Post-Injection-Phase wird immer nach einer Installation ausgeführt. In der Post-Injection-Phase werden Aufräumarbeiten durchgeführt und ggf. weitere Funktionen, wie die Einbindung in die Domäne, durchgeführt.

Beispiel 

<?xml version="1.0" encoding='iso-8859-1'?>
<shellcommands>

  <shellcommand>
     <label hidden="true" title="DEMO-MAC: Postinstall 'Windows 7 RC (Deutsch)'"> EnableVNC </label>
     <command> EnableVNC </command>
  </shellcommand>
  <shellcommand>
     <label description="Cleaning up..."> Change Status to finished </label>
     <command> CreateFile </command>
     <parameter> z:\install\computer\29d09e58\finished </parameter>
  </shellcommand>

  <shellcommand>
     <label> Delete prepared status </label>
     <command> DeleteFile </command>
     <parameter> z:\install\computer\29d09e58\prepared </parameter>
  </shellcommand>

  <shellcommand>
     <label> Delete nextreboot status</label>
     <command> DeleteFile </command>
     <parameter> z:\install\computer\29d09e58\nextreboot </parameter>
  </shellcommand>

  <shellcommand>
     <label> Delete ntsetup status</label>
     <command> DeleteFile </command>
     <parameter> z:\install\computer\29d09e58\ntsetup </parameter>
  </shellcommand>


  <shellcommand>
     <label> Delete unattend.xml</label>
     <command> DeleteFile </command>
     <parameter> c:\unattend.xml </parameter>
  </shellcommand>

  <shellcommand>
     <label hidden="true"> DisableVNC </label>
     <command> DisableVNC </command>
  </shellcommand>

  <shellcommand>
     <label> Exit </label>
     <command> Exit </command>
  </shellcommand>

</shellcommands>

Befehle

Befehlsaufbau

Die Befehle für den Shellcommander sind wie folgt aufgebaut:

<?xml version="1.0" encoding='iso-8859-1'?>
<shellcommands>

  <shellcommand>
     <label [hidden="true|false"] [title="title"]> label </label>
     <command> command </command>
     [<parameter> parameter </parameter>]
  </shellcommands>

</shellcommands>

  • <?xml version="1.0" encoding='iso-8859-1'?> : Definition der XML-Version
  • <shellcommands> ... </shellcommands>: alle Shell Kommandos
  • <shellcommand> ... </shellcommand>: ein Shell Kommando
  • <label [hidden="true|false"] [title="title"]> label </label>: Das Label, das während der Ausführung angezeigt wird. Optionale Parameter sind hidden und title. Hidden kennzeichnet, ob das Label angezeigt, wird und title kennzeichnet den Titel innerhalb der Shell.
  • <command> command </command>: Das auszuführende Kommando.
  • [<parameter> parameter </parameter>]: Optional mögliche Parameter, je nach Befehl.

Folgende Befehle stehen zur Verfügung:

CopyFile

CopyFile: Kopiert eine Datei in ein anderes Zielverzeichnis. Beide Parameter werden durch ein '|' getrennt.

  <shellcommand>
     <label description="%ComputerName%: Transfer PostXP installation..."> Getting PostXP command  </label>
     <command> CopyFile </command>
     <parameter> z:\config\unattended\PostXP.PostInstall.Setupcomplete.cmd.txt | c:\windows\Setup\scripts\Setupcomplete.cmd </parameter>
  </shellcommand>

Beispiel Konfigurationsdatei übertragen

  <shellcommand>
     <label> Getting OPTIMALshell Login </label>
     <command> CopyFile </command>
     <parameter> z:\config\winpe\OPTIMALshell.ini| c:\windows\Setup\scripts\OPTIMALshell.ini </parameter>
  </shellcommand>

CopyTree

CopyTree: Kopiert ein Verzeichnis in ein anderes Zielverzeichnis. Es werden zwei Parameter benötigt, die durch ein '|' getrennt werden.

Beispiel

  <shellcommand>
     <label> Getting configuration </label>
     <command> CopyTree </command>
     <parameter> z:\install\computer\%ComputerMAC8%\config | c:\config </parameter>
  </shellcommand>

CreateFile

CreateFile: Erzeugt eine leere Datei

Beispiel Freecommander ausführen

  <shellcommand>
     <label description="%ComputerName%: Running Freecommander..."> Change Status crun </label>
     <command> CreateFile </command>
     <parameter> z:\install\computer\%ComputerMAC8%\crun  </parameter>
  </shellcommand>

Beispiel Status-Partitionierung an den Server übergeben

  <shellcommand>
     <label> Partitioning </label>
     <command> CreateFile </command>
     <parameter> z:\install\computer\%ComputerMAC8%\parting  </parameter>
  </shellcommand>

Beispiel Status partitioniert an den Server übergeben

  <shellcommand>
     <label hidden="true"> Parted </label>
     <command> CreateFile </command>
     <parameter> z:\install\computer\%ComputerMAC8%\parted  </parameter>
  </shellcommand>

DefineServers

DefineServers: Definiert die zur Verfügung stehenden Server bei der verteilten Installation. Es werden drei Parameter benötigt.

Beispiel

  <shellcommand>
     <label> DefineServers </label>
     <command> DefineServers </command>
     <parameter> %SiteName% | %SiteTftpServer% | %SiteInstallServer% </parameter>
  </shellcommand>

DeleteFile

DeleteFile: Löscht eine Datei.

Beispiel

  <shellcommand>
     <label> Change Status crun </label>
     <command> DeleteFile </command>
     <parameter> z:\install\computer\%ComputerMAC8%\crun  </parameter>
  </shellcommand>

Beispiel Status partitiniert entfernen

  <shellcommand>
     <label hidden="true"> Parted </label>
     <command> DeleteFile </command>
     <parameter> z:\install\computer\%ComputerMAC8%\parting  </parameter>
  </shellcommand>

DeleteTree

DeleteTree: Löscht ein Verzeichnis

Beispiel

  <shellcommand>
     <label> Lösche </label>
     <command> DeleteTree </command>
     <parameter> c:\config </parameter>
  </shellcommand>

DisableLog

DisableLog: Das Log wird ausgeschaltet

Beispiel

  <shellcommand>
     <label hidden="true"> DisableLog </label>
     <command> DisableLog </command>
  </shellcommand>

DisableVNC

DisableVnc: Schaltet den VNC-Server aus.

Beispiel

  <shellcommand>
     <label> DisableVnc </label>
     <command> DisableVnc </command>
  </shellcommand>

EnableDebug

EnableDebug: Schaltet den Debug Modus ein.

Beispiel

  <shellcommand>
     <label> EnableDebug </label>
     <command> EnableDebug </command>
  </shellcommand>

Screenshot

Start des ShellCommanders

Das Enable-Debug-Kommando schaltet folgende Tasten frei:

Taste Beschreibung
exit

Beendet das Windows PE Boot-Image.

CMD

Öffnet ein MS-DOS-Fenster zur näheren Analyse.

EnableVNC

EnableVnc: Schaltet den VNC-Server ein

Beispiel

  <shellcommand>
     <label> EnableVnc </label>
     <command> EnableVnc </command>
  </shellcommand>

EnableLog

EnableLog: Schaltet das Log auf dem Server ein. Das Log ist normalerweise als Standard eingeschaltet

Beispiel

  <shellcommand>
     <label hidden="true"> EnableLog </label>
     <command> EnableLog </command>
  </shellcommand>

ImageX

ImageX: ImageX wird aufgerufen und entsprechend ausgeführt. Als Parameter sind alle ImageX Kommandozeilenschalter verfügbar.

Beispiel

  <shellcommand>
     <label description="%ComputerName%: Applying image '%osfolder%\install.wim'..."> Applying OS  </label>
     <command> ImageX </command>
     <parameter> /apply "%InstallDrive%\config\os\%osfolder%\install.wim" 1 c: /verify </parameter>
  </shellcommand>

Inventory

Inventory:Erstellt eine Inventur des Rechners.

Beispiel lokale Inventur

  <shellcommand>
     <label> Inventory </label>
     <command> Inventory </command>
     <parameter> z:\install\computer\%ComputerMAC8%\inventory.xml </parameter>
  </shellcommand>

Beispiel globale Inventur

  <shellcommand>
     <label description="\customdata\inventory-global\%ComputerName%(%ComputerMAC8%)_(%Manufacturer%-%Model%-%Product%).xml"> Creating global inventory...</label>
     <command> Inventory </command>
     <parameter> z:\customdata\inventory-global\%ComputerName%(%ComputerMAC8%)_(%Manufacturer%-%Model%-%Product%).xml </parameter>
  </shellcommand>

ReplaceAll

ReplaceAll: Tauscht in einer Datei einen Text durch einen anderen aus. Es werden drei Parameter benötigt: der Dateiname, der zu suchende Text und der Ersatztext. Alle Parameter werden durch ein '|' getrennt.

Beispiel

  <shellcommand>
     <label> Replace XP64 Serial </label>
     <command> ReplaceAll </command>
     <parameter> C:\$WIN_NT$.~BT\Winnt.sif | %XP64W2K3Serial% | %XP64Serial%  </parameter>
  </shellcommand>

Run

Run: Führt ein Kommando aus.

Beispiel Diskpartition

  <shellcommand>
     <label> Create Partition </label>
     <command> Run </command>
     <parameter> diskpart.exe /s z:\install\computer\%ComputerMAC8%\diskpart.txt </parameter>
  </shellcommand>

Beispiel Freecommander

  <shellcommand>
     <label> FreeCommander </label>
     <command> Run </command>
     <parameter> z:\install\tools\freecommander\freecommander.exe </parameter>
  </shellcommand>

Beispiel Reboot

  <shellcommand>
     <label> Reboot </label>
     <command> Run </command>
     <parameter> wpeutil reboot  </parameter>
  </shellcommand>

Beispiel Xcopy

  <shellcommand>
     <label> Getting setup file </label>
     <command> Run </command>
     <parameter> xcopy z:\install\computer\%ComputerMAC8%\unattend.xml c:\  /y /q  </parameter>
  </shellcommand>

SingleStep On

SingleStep On | EnableSingleStep: Schaltet die Ausführung der Kommandos im ShellCommander in den SingleStep Mode.

Beispiel

  <shellcommand>
     <label> EnableSingleStep </label>
     <command> EnableSingleStep</command>
  </shellcommand>

EnableSingleStep startet den Single Stepper im Windows PE Boot-Image.

SingleStep für die Betriebssysteminstallation

Next: Führt den nächsten Schritt aus. Der nächste auszuführende Schritt wird im Dialog angezeigt.

EnableLog: Schaltet das Log-File ein. Das Log-File ist standardmäßig eingeschaltet.

Run CMD: Führt eine MS-DOS-Box aus und ermöglicht somit den Zugriff auf die Maschine.

Continue: Schaltet den SingleStep-Mode aus und führt alle folgenden Befehle direkt aus.

Exit: Beendet die OPTIMALShell.

Reboot: Startet die Maschine neu.

Shutdown: Fährt die Maschine runter.

Beispiel für Run CMD

Beispiel einer Kommando Shell im SingleStep Modus

SingleStep Off

SingleStep Off | DisableSingleStep: Schaltet den SingleStep wieder aus.

Beispiel

  <shellcommand>
     <label> DisableSingleStep </label>
     <command> DisableSingleStep</command>
  </shellcommand>

SingleStepVnc On

SingleStepVnc On | EnableSingleStep: Schaltet die Ausführung der Kommandos im ShellCommander in den SingleStep-Mode sobald der Vnc Server aus dem WinPE Boot-Image gestartet wurde. Weitere Informationen finden Sie auch unter dem Kommando SingleStep.

Beispiel

  <shellcommand>
     <label> EnableSingleStepVnc </label>
     <command> EnableSingleStepVnc</command>
  </shellcommand>