[Main]
Title=Driver Integration
Description=Add Drivers to WinPE
Selected=False
Level=5
Author=JFX,Kare,MaineCoon
Version=005
Date=03.09.2021
Credits=
Translation_DE=MaineCoon


[Interface]
pframe1=Drivers for 32-bit (x86):,707070,0,0,5,50,510,75
pframe2=Drivers for 64-bit (x64):,707070,0,0,5,140,510,75
pframe3=Most extensive Driver package:,707070,0,0,5,230,510,50

pcheckbox1=True,Show Progress Bar,0,0,20,295,180,18
pcheckbox2=False,Force Installation of unsigned Drivers (Win7),0,0,20,320,250,18

pTextLabel1=Driver packages have to be decompressed (included INF files)#$c subfolders are allowed,9,0,Bold,7,10,520,20

pbutton1=Open_x86,Open Folder,0,,420,85,75,20
pbutton2=Open_x64,Open Folder,0,,420,175,75,20

pfilebox1=%BaseDir%\Temp\Win8PE\Drivers_x86,#$pBaseDir#$p\Temp\Win8PE\Drivers_x86,0,FolderDir,20,85,350,20
pfilebox2=%BaseDir%\Temp\Win8PE\Drivers_x64,#$pBaseDir#$p\Temp\Win8PE\Drivers_x64,0,FolderDir,20,175,350,20

pweblabel1=http://driverpacks.net/driverpacks/latest,http://driverpacks.net/driverpacks/latest,0,Web,30,255,250,20
//
tError=ERROR
tMsg_1=Please choose a directory
tMsg_2=start add Drivers...

tMsg_201=Empty directory.#$xDriver integration not possible.#$x#$xAborting script...
tMsg_202=Error in integration of drivers.#$x#$xThis directory does not contain any 'inf file'.#$xDriver integration not possible.
TMsg05          =Please delete
TMsg06          =manually and press Ok.
TMsg13          =Get Aik Files


[Interface.07]
Description=Treiberunterstützung für WinPE
pframe1=Treiber für 32-Bit (x86):,707070,0,0,5,50,510,75
pframe2=Treiber für 64-Bit (x64):,707070,0,0,5,140,510,75
pframe3=Umfangreichstes Treiberpaket:,707070,0,0,5,230,510,50

pcheckbox1=True,Integrationsfortschritt anzeigen,0,0,20,295,180,18
pcheckbox2=True,Installation unsignierter Treiber erzwingen (Win7),0,0,20,320,250,18

ptextlabel1=Treiberpakete müssen dekomprimiert sein (inkludierte INF-Dateien)#$c Unterordner erlaubt,9,0,Bold,7,10,520,20

pbutton1=Open_x86,Ordner öffnen,0,,420,85,75,20
pbutton2=Open_x64,Ordner öffnen,0,,420,175,75,20

pfilebox1=%BaseDir%\Temp\Win8PE\Drivers_x86,#$pBaseDir#$p\Temp\Win8PE\Drivers_x86,0,FolderDir,20,85,350,20
pfilebox2=%BaseDir%\Temp\Win8PE\Drivers_x64,#$pBaseDir#$p\Temp\Win8PE\Drivers_x64,0,FolderDir,20,175,350,20

pweblabel1=http://driverpacks.net/driverpacks/latest,http://driverpacks.net/driverpacks/latest,0,Web,30,255,250,20
//
tError=FEHLER
tMsg_1=Wählen Sie bitte einen Ordner aus
tMsg_2=integriere Treiber...
tMsg_201=Dieses Verzeichnis ist leer. Treiberintegration nicht möglich.#$x#$xSkript wird abgebrochen...
tMsg_202=Fehler bei Treiber-Integration.#$x#$xDieses Verzeichnis enthält keine 'inf-Datei'.#$xTreiberintegration nicht möglich.

TMsg05          =Bitte löschen
TMsg06          =manuell und klicken Sie Ok.
TMsg13          =Lade Aik Dateien


[Open_x86]
Update,InterfaceVar
If,Not,%pFileBox1%,=,,Then
	If,Not,ExistDir,%pFileBox1%,Then,DirMake,%pFileBox1%
	Start,,%pFileBox1%
Else
	Message,%tMsg_1%,INFORMATION,4
End

[Open_x64]
Update,InterfaceVar
If,Not,%pFileBox2%,=,,Then
	If,Not,ExistDir,%pFileBox2%,Then,DirMake,%pFileBox2%
	Start,,%pFileBox2%
Else
	Message,%tMsg_1%,INFORMATION,4
End


[Process]

//==================================================
//----Variables----------
Set,%ShowHide%,Hide
Set,%Unsigned%,
//----End of variables---
//==================================================


echo,%tMsg_2%
If,%pcheckbox1%,=,True,Then,Set,%ShowHide%,Show
If,%pcheckbox2%,=,True,Then,Set,%Unsigned%,/forceUnsigned

	If,not,ExistFile,%ProjectTemp%\Dism%OS%\%HostArch%\Dism.exe,then,Run,%ScriptFile%,GetWaik

	If,%Arch%,=,x86,Then
		If,%pfilebox1%,=,,Then
			Message,%tERROR%#$x#$x%tMsg_201%,ERROR,6
			Exit
		End
		ShellExecute,%ShowHide%,%ProjectTemp%\Dism%OS%\%HostArch%\dism.exe, /image:#$q%TargetDir%#$q /Add-Driver /Driver:#$q%pfilebox1%#$q /recurse %Unsigned%
	Else
		If,%pfilebox2%,=,,Then
			Message,%tERROR%#$x#$x%tMsg_201%,ERROR,6
			Exit
		End
		ShellExecute,%ShowHide%,%ProjectTemp%\Dism%os%\%HostArch%\dism.exe, /image:#$q%TargetDir%#$q /Add-Driver /Driver:#$q%pfilebox2%#$q /recurse %Unsigned%
	End
	If,Not,%ExitCode%,=,0,Then
		Message,%tERROR%#$x#$x%tMsg_202%,ERROR,4
	End

[GetWaik]

If,ExistDir,%ProjectTemp%\WaikTools,Then,   DirRemove,  %ProjectTemp%\WaikTools,1
If,ExistDir,%ProjectTemp%\WaikTools,Then,   Message,    %TMsg05% %ProjectTemp%\WaikTools %TMsg06%
DirMake,    %ProjectTemp%\WaikTools

Echo,%TMsg13%
//ShellExecute,Show,%Tools%\GetWaikTools.exe,-win8dism -win8.1dism -silent -folder:#$q%ProjectTemp%\WaikTools#$q
ShellExecute,Show,%Tools%\GetWaikTools.exe,-win10 -win10dism -silent -folder:#$q%ProjectTemp%\WaikTools#$q
If,%ExitCode%,=,0,Then
    System,FileRedirect,Off
   // DirCopy,            %ProjectTemp%\WaikTools\ADK_4\x86\Dism,%ProjectTemp%\DismWin8\x86\
   // DirCopy,            %ProjectTemp%\WaikTools\ADK_4\amd64\Dism,%ProjectTemp%\DismWin8\x64\
   // DirCopy,            %ProjectTemp%\WaikTools\ADK_5\x86\Dism,%ProjectTemp%\DismWin81\x86\
   // DirCopy,            %ProjectTemp%\WaikTools\ADK_5\amd64\Dism,%ProjectTemp%\DismWin81\x64\

    DirCopy,            %ProjectTemp%\WaikTools\ADK_6\x86\Dism,%ProjectTemp%\DismWin8\x86\
    DirCopy,            %ProjectTemp%\WaikTools\ADK_6\amd64\Dism,%ProjectTemp%\DismWin8\x64\
    DirCopy,            %ProjectTemp%\WaikTools\ADK_6\x86\Dism,%ProjectTemp%\DismWin81\x86\
    DirCopy,            %ProjectTemp%\WaikTools\ADK_6\amd64\Dism,%ProjectTemp%\DismWin81\x64\

    DirRemove,%ProjectTemp%\WaikTools,1
    System,FileRedirect,On
Else
    If,Not,ExistFile,%ProjectTemp%\Dism%os%\%HostArch%\Dism.exe,Then
        Message,%THalt09%
        Halt,%THalt09%
    End
End


[Script-Pic]
0=9662,6132,ZLB64
1=eNrtWgdUVde2vRiNJmpE+XYUW4gEpAqhCSpioQU1oEZFUCE2UECKBSUiAoqAFRVbsMQCikEBK8QSjZVqBHtQUKJGRaJGn/PNfd2XR0xsecn774/xD2ONfe655+wz11pzlb0vCoUa/wwNFcpj04cKRTOOnSnikidFTdFO8X/sUJNSi/IepTFFg/I+pbYcxee6/2V4BZ6Giucu0KLoUbpT3CifU7pR6CGFJcWV0ul/Ees7NeyoSfmIYk5xonhRpjZq1GhjmzZtjrU2MDvXsGHDTF6L5zhTT0/vPM+DKI7/YdzvS9sKQutT7KRdA+vXr7+0WbNmWc11TfJaWLtUtOo/Hg29oqCYkAyF90oYGRk9ad++/SUDA4N7PK/o2LHjV3xu5H/Q3gK7AcWDMl1DQyNVU1Pz+5Ymdtda2A6pUneajHf7R0LhGgdFv3l4t0cY2o5cA5s5OzBmfwE8nZ1hZmBw/4MPPkht2bJlBPW4wnkm/c3Y60p7a7Rr186pra7ZvpZGfcubWY1EQ2t/KGyIt+uXUBjOgLrNl2jhthhNAzahYfgO6G67iv7fPoDb0ftwPHoTI7wnYLCNzZMmTZrspkSbmJhA2uLvtHsbijvFWUdHZ6eiYygUrWnn1uNg2C8B/Xw3YvjKMxi7rwyjTzxDn/130XbTedRblYs6SadhEpuOIRFrEDslBtlTpmNwr15POnfufIn8KTc0NPye83b4G/HX4nt+YPxtat269ZJuZmb4wjceqfvzcfw2kFkORBVWof+BmzDcfhnay79D95gUBE5fhKTwWOTOno28BQuQ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