# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-script_name="$(basename $0)"
+script_name="$(basename "$0")"
PREFIX_REG="::"
WIMLIB_VERSION=@VERSION@
imagex=@IMAGEX_PROGNAME@
-A, --waik-dir=DIR Get the boot files and boot.wim from the ISO of the
Windows Automated Installation Kit mounted on DIR
instead of from the Windows 7 or Windows 8 DVD.
+ This also works if the mounted ISO is for the
+ WAIK supplement rather than the WAIK itself.
-s, --start-script=FILE Add FILE to the root directory of Windows PE image
and adjust \Windows\System32\winpeshl.ini to
execute FILE when Windows PE starts up.
- -w, --wim=WIM Use WIM as the boot.wim file. Defaults to
- sources/boot.wim in the Windows DVD directory, or
- F1_WINPE.WIM from the WAIK if --waik-dir is
- specified.
+ -w, --wim=WIM Use WIM as the boot.wim file. This defaults to the
+ appropriate WIM file from the Windows DVD, WAIK,
+ or WAIK supplement.
-O, --overlay=DIR Adds all the files in DIR to the Windows PE image.
-t, --tmp-dir=DIR Use DIR as the temporary base of the ISO filesystem.
Defaults to making one using "mktemp -d".
fi
fi
- if [ -n "$waik_dir" ]; then
+ if [ -n "$waik_dir" ] && [ -f "$waik_dir"/wAIK${arch}.msi ]; then
if ! type -P cabextract &> /dev/null ; then
cat << EOF
ERROR: The boot files in the Windows Automated Installation Kit (WAIK) are
# Get boot files from the WAIK.
stat_busy "Copying primary boot files from the Windows Automated Installation Kit ($waik_dir, $arch)"
- if [ -f "$waik_dir"/WAIK${arch}.msi ]; then
+ if [ -f "$waik_dir"/wAIK${arch}.msi ]; then
if [ $make = iso ]; then
cabextract "$waik_dir"/wAIK${arch}.msi -F F_WINPE_${arch}_etfsboot.com -p \
> "$tmp_dir"/etfsboot.com || stat_fail
> "$boot_wim" 2>/dev/null || stat_fail
# WAIK supplement has different layout
else
- stat_busy "Copying boot.wim from ${arch,,}/winpe.wim"
+ stat_busy "Copying boot.wim from \"${waik_dir}/${arch,,}/winpe.wim\""
cp "$waik_dir"/${arch,,}/winpe.wim "$boot_wim" || stat_fail
chmod +w "$boot_wim"
fi
if [ -n "$start_script" ]; then
stat_busy "Setting \"$start_script\" as the script to be executed when Windows PE boots"
- cp "$start_script" "$tmp_dir/$start_script"
+ start_script_base="$(basename "$start_script")"
cat > "$tmp_dir/__mkwinpeimg.winpeshl.ini" <<- EOF
[LaunchApps]
- %SYSTEMDRIVE%\\$start_script
+ %SYSTEMDRIVE%\\$start_script_base
EOF
cat 1>&3 <<- EOF
- add '$tmp_dir/$start_script' '/$start_script'
+ add '$start_script' '/$start_script_base'
delete --force /Windows/System32/winpeshl.ini
add '$tmp_dir/__mkwinpeimg.winpeshl.ini' /Windows/System32/winpeshl.ini
EOF