-
Notifications
You must be signed in to change notification settings - Fork 3
/
cctk_x86_64_WinPE_3.bat
165 lines (135 loc) · 6.92 KB
/
cctk_x86_64_WinPE_3.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
@echo off
:: ***************************************************************************
:: * WARRANTY DISCLAIMER
:: ***************************************************************************
:: * THIS SCRIPT IS BEING PROVIDED TO YOU "AS IS". DELL DISCLAIMS ANY
:: * AND ALL WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, WITH RESPECT TO THE
:: * SCRIPT, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
:: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND ANY WARRANTY
:: * OF NON-INFRINGEMENT. YOU WILL USE THIS SCRIPT AT YOUR OWN RISK.
:: * DELL SHALL NOT BE LIABLE TO YOU FOR ANY DIRECT OR INDIRECT DAMAGES
:: * INCURRED IN USING THE SCRIPT. IN NO EVENT SHALL DELL OR ITS
:: * SUPPLIERS BE RESPONSIBLE FOR ANY DIRECT OR INDIRECT DAMAGES WHATSOEVER
:: * (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, LOSS OF USE,
:: * LOSS OF DATA, BUSINESS INTERRUPTION, OR OTHER PECUNIARY LOSS, NOR FOR
:: * PUNITIVE, INCIDENTAL, CONSEQUENTIAL, OR SPECIAL DAMAGES OF ANY KIND,
:: * UNDER ANY PART OF THIS AGREEMENT, EVEN IF ADVISED OR AWARE OF THE
:: * POSSIBILITY OF SUCH DAMAGES).
:: ***************************************************************************
:: ***************************************************************************
REM Name: cctk_x86_64_winpe_3.bat
REM
REM Purpose:
REM This script installs Dell drivers into a base Windows PE 3.0 image offline.
REM
REM Arguments:
REM %1 Path to local directory for Windows PE 3.0 image to create
REM %2 Path to extracted Command Configure toolkit
:: ***************************************************************************
if "%1%" == "" goto usage
if "%2%" == "" goto usage
@echo -------------------------------------
@echo Setup a WinPE 3.0 build environment
@echo -------------------------------------
Set AIKTOOLS="C:\Program files\Windows AIK\Tools"
::Set AIKTOOLS=C:\winsevaik\Tools
@echo ----------------------------------------
@echo (cctk_x86_64_winpe.bat)-Check the Paths
@echo ----------------------------------------
if not exist %2% (
echo CCTKPATH %2% does not exist. Exiting.....
goto done
)
if not exist %AIKTOOLS% (
echo %AIKTOOLS% does not exist.
echo please set the right path for the variable AIKTOOLS before running this script
echo if its a long path please make sure its specified in quotes
echo for eg: Set AIKTOOLS="C:\Program files\Windows AIK\Tools"
goto done
)
Set WINPEPATH=%1%
Set CCTKPATH=%2%
::rd /s/q %WINPEPATH%
if not exist %WINPEPATH% call %AIKTOOLS%\PETools\copype.cmd amd64 %WINPEPATH%
%AIKTOOLS%\x86\imagex /apply %WINPEPATH%\WinPE.wim 1 %WINPEPATH%\mount
@echo ------------------------------------
@echo Add additional customizations
@echo ------------------------------------
%AIKTOOLS%\Servicing\dism.exe /image=%WINPEPATH%\mount /Add-Package /PackagePath:%AIKTOOLS%\PETools\amd64\WinPE_FPs\winpe-fontsupport-ja-jp.cab
%AIKTOOLS%\Servicing\dism.exe /image=%WINPEPATH%\mount /Add-Package /PackagePath:%AIKTOOLS%\PETools\amd64\WinPE_FPs\winpe-fontsupport-zh-cn.cab
%AIKTOOLS%\Servicing\dism.exe /image=%WINPEPATH%\mount /Add-Package /PackagePath:%AIKTOOLS%\PETools\amd64\WinPE_FPs\winpe-wmi.cab
%AIKTOOLS%\Servicing\dism.exe /image=%WINPEPATH%\mount /Add-Package /PackagePath:%AIKTOOLS%\PETools\amd64\WinPE_FPs\winpe-scripting.cab
%AIKTOOLS%\Servicing\dism.exe /image=%WINPEPATH%\mount /Add-Package /PackagePath:%AIKTOOLS%\PETools\amd64\WinPE_FPs\winpe-wds-tools.cab
@echo --------------------------------------------------------------
@echo ~~5 -Copy HAPI and TOOLKIT Files to the mounted image 6
@echo --------------------------------------------------------------
::copy /Y %CCTKPATH%\*.dll %WINPEPATH%\mount\Command_Configure\X86_64\HAPI
::xcopy %CCTKPATH%\HAPI\*.* %WINPEPATH%\mount\Command_Configure\X86_64\HAPI /S /E /i /Y
xcopy %CCTKPATH%\X86_64\HAPI\*.* %WINPEPATH%\mount\Command_Configure\X86_64\HAPI /S /E /i /Y
xcopy %CCTKPATH%\X86_64\*.* %WINPEPATH%\mount\Command_Configure\X86_64 /S /E /i /Y
rem copy /Y %CCTKPATH%\Readme.txt %WINPEPATH%\mount\Command_Configure\X86_64
@echo ------------------------
@echo Add the Services
@echo ------------------------
echo echo Starting WMI Services >> %WINPEPATH%\mount\windows\system32\STARTNET.CMD
echo net start winmgmt >> %WINPEPATH%\mount\windows\system32\STARTNET.CMD
echo echo ******************** >> %WINPEPATH%\mount\windows\system32\STARTNET.CMD
echo echo Installing HAPI >> %WINPEPATH%\mount\windows\system32\STARTNET.CMD
echo X:\Command_Configure\X86_64\HAPI\hapint -i -k C-C-T-K -p X:\Command_Configure\X86_64\HAPI\ >> %WINPEPATH%\mount\windows\system32\STARTNET.CMD
echo echo Successfully Installed the HAPI Drivers >> %WINPEPATH%\mount\windows\system32\STARTNET.CMD
echo echo *********************>> %WINPEPATH%\mount\windows\system32\STARTNET.CMD
@echo --------------------------------------
@echo Prepare the image for deployment
@echo --------------------------------------
if not exist %WINPEPATH%\WIM\ (
md %WINPEPATH%\WIM\
)
%AIKTOOLS%\X86\imagex /BOOT /COMPRESS maximum /CAPTURE %WINPEPATH%\mount\ %WINPEPATH%\WIM\boot.wim "Command Configure WinPE 3 Image"
@echo ---------------------------------------------
@echo Commit the customization to base image
@echo ---------------------------------------------
REM move %WINPEPATH%\ISO\sources\boot.wim %WINPEPATH%\boot-base.wim
copy %WINPEPATH%\wim\boot.wim %WINPEPATH%\wim\cctk_x86_64_pe3.wim
move /Y %WINPEPATH%\wim\boot.wim %WINPEPATH%\ISO\sources\boot.wim
%AIKTOOLS%\x86\oscdimg -n -b%WINPEPATH%\etfsboot.com %WINPEPATH%\ISO %WINPEPATH%\WIM\Command_Configure_x86_64_3.iso
goto done
:usage
echo.
echo cctk_x86_64_winpe_3.bat
echo.
echo Copyright 2009 - 2017 Dell Inc. All rights reserved.
echo.
echo Usage : cctk_x86_64_winpe_3.bat WINPEPATH CCTKPATH
echo.
echo Where:
echo WINPEPATH path where the Windows PE 3.0 contents should create
echo CCTKPATH path where Command Configure is installed
echo.
echo ***********************************************************************
echo.
echo Please make sure WINPEPATH should be a new folder everytime when run
echo this script.
echo .
echo Please use short path for both parameters, to use long path
echo please hardcode this value in to the batch file
echo.
echo ***********************************************************************
echo.
echo Example: cctk_x86_64_WinPE_3.bat C:\winsevpe_x64 C:\Progra~2\Dell\Comman~1\
echo This installs the HAPI (Instrumentation)
echo drivers found in the C:\Progra~2\Dell\Comman~1\X86_64\HAPI folder to the base
echo Windows PE image in C:\winsevpe_x64.
echo.
echo NOTE: If any of these drivers are already present in the Windows PE Image,
echo then this script overwrites them.
echo.
echo.
goto done
:done
@echo -------------------------------
@echo (cctk_x86_64_winpe.bat)-DONE.
@echo -------------------------------
set WINPEPATH=
set CCTKPATH=
set AIKTOOLS=
echo.