@echo off title %~nx0 pushd %~dp0 set down_dir=.\download_files REM check wget.exe if exist wget.exe set wgetexe=ok if exist .\wget\wget.exe set wgetexe=ok if exist .\UnxUtils\usr\local\wbin\wget.exe set wgetexe=ok REM check unzip.exe if exist unzip.exe set unzipexe=ok if exist .\unzipxN\unzip.exe set unzipexe=ok if exist .\UnxUtils\usr\local\wbin\unzip.exe set unzipexe=ok REM check tar.exe if exist tar.exe set tarexe=ok if exist .\texinst\tar.exe set tarexe=ok REM check bzip2.exe if exist bzip2.exe set bzipexe=ok if exist .\texinst\bzip2.exe set bzipexe=ok REM ##################################### REM ### FILE CHECK REM ##################################### set FILE_gpxe=gpxe-0.9.5-gpxe.lkrn set FILE_fcimage=fc5fd.tar.bz2 set FILE_fdboot=fdboot.img set FILE_balder=balder10.img set FILE_LINLD=LINLD.COM set FILE_memtest=memtest86+-2.01.zip set FILE_conf=fdboot_liveusb3_files.zip set FILE_grub=grub4dos-0.4.4.zip REM set FILE_= set URL_fcimage=http://static.thisiscool.com/gnustuff/fc5fd.tar.bz2 set URL_fdboot=http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/fdboot.img set URL_balder=http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/unofficial/balder/balder10.img set URL_linld=http://busybox.net/~vda/linld/LINLD.COM set URL_memtest=http://www.memtest.org/download/2.01/memtest86+-2.01.zip set URL_conf=https://eu7w9wsmf6a74xyjdfzl3q-on.drv.tw/archives/fdboot_liveusb3_files.zip set URL_grub=http://download.gna.org/grub4dos/grub4dos-0.4.4.zip REM set URL_= REM set URL_= REM ## gpxe-git-gpxe.lkrn ## if exist %down_dir%\%FILE_gpxe% set gpxe=ok REM ## Fedora-install fdimages ## if exist %down_dir%\%FILE_fcimage% set fcimage=%down_dir%\%FILE_fcimage% if exist %down_dir%\FC5-FloppyInstall-1.img ( set fcimage=ok) REM ## FreeDOS fdboot.img ## if exist %down_dir%\%FILE_fdboot% set fdboot=ok REM ## FreeDOS Balder image ## if exist %down_dir%\%FILE_balder% set balder=ok REM ## LINLD.COM ## if exist %down_dir%\%FILE_LINLD% set linld=ok REM ## memtest86+ ## if exist %down_dir%\%FILE_memtest% set memtest=%down_dir%\%FILE_memtest% if exist %down_dir%\memtest86+-2.01.bin ( set memtest=ok) REM ## config file ## if exist %down_dir%\%FILE_conf% set conf=%down_dir%\%FILE_conf% if exist %down_dir%\fdboot_liveusb3_files\ set conf=ok REM ## grub4dos ## if exist %down_dir%\%FILE_grub% set grub=%down_dir%\%FILE_grub% if exist .\grub4dos\grub.exe set grub=ok if exist %down_dir%\grub.exe set grub=ok if exist %down_dir%\grub4dos-0.4.4\grub.exe set grub=ok if exist grub.exe set grub=ok echo: echo ************************************************************** echo * * echo * === Fdos_SCL ファイルのダウンロードと展開を始めます === * echo * * echo * === wget.exe が必要です! === * echo * === unzip.exe が必要です! === * echo * === tar.exe, bzip2.exe が必要です! === * echo * * echo * === ダウンロード済・展開済みならスキップします === * echo * * echo * 下記ファイルをダウンロードします * if "%fcimage%"=="" ( echo *** * Fedora-install fdimages ***) if "%fdboot%"=="" ( echo *** * FreeDOS fdboot.img ***) if "%balder%"=="" ( echo *** * FreeDOS Balder image ***) if "%linld%"=="" ( echo *** * LINLD.COM ***) if "%memtest%"=="" ( echo *** * memtest86+ ***) if "%conf%"=="" ( echo *** * config file ^(fdboot_liveusb3_files.zip^) ***) if "%grub%"=="" ( echo *** * grub4dos ^(grub for dos 0.4.4 grub.exe^) ***) echo * * echo ************************************************************** echo: echo 続行しますか? 中断は xボタン or Ctrl-C echo: echo *** 何かキーを押すと続行します *** pause >nul echo: :CHECK_gp if not "%gpxe%"=="" GOTO CHECK_DL cls echo: echo ************************************************************** echo: echo * gPXE カーネルは [ gpxe-0.9.5-gpxe.lkrn ] 手動でダウンロード * echo: echo 1. Choose NIC/ROM type: echo * gpxe:all-drivers を選択 echo: echo 2. Choose ROM output format: echo * LILO/GRUB/SYSLINUX loadable Linux kernel format (.lkrn) を選択 echo * [Get Image] をポチっと echo: echo [download_files]へコピー echo: echo: echo *** ブラウザでページを開きますか? *** echo *** 後で[download_files]へコピーでもいいです *** echo: echo *** 未入力だとスキップします *** echo: echo ************************************************************** echo: set /p choice= [y,N] : echo: if /i "%choice%"=="y" start /min http://rom-o-matic.net/gpxe/gpxe-0.9.5/contrib/rom-o-matic/ if "%choice%"=="" GOTO CHECK_DL echo: echo *** 何かキーを押すと続行します *** echo: pause >nul :CHECK_DL if "%fcimage%"=="" GOTO DOWNLOAD if "%fdboot%"=="" GOTO DOWNLOAD if "%balder%"=="" GOTO DOWNLOAD if "%linld%"=="" GOTO DOWNLOAD if "%memtest%"=="" GOTO DOWNLOAD if "%conf%"=="" GOTO DOWNLOAD if "%grub%"=="" GOTO DOWNLOAD GOTO CHECK_EX REM ##################################### REM ### DOWNLOAD REM ##################################### :DOWNLOAD if "%wgetexe%"=="" GOTO NOWGET set path=.\wget;%path% cls echo: echo ************************************************************** echo: echo *** ダウンロードを開始します *** echo: echo 続行しますか? 中断は xボタン or Ctrl-C echo: echo *** 何かキーを押すと続行します *** echo: echo ************************************************************** pause >nul echo: echo: :DL_FCIMA echo *** # Fedora-install fdimages をダウンロードします *** echo: if not "%fcimage%"=="" GOTO DL_FDBOO wget -nc -P %down_dir% --passive-ftp %URL_fcimage% if "%errorlevel%"=="0" set fcimage=%down_dir%\%FILE_fcimage% echo: :DL_FDBOO echo *** # FreeDOS fdboot.img をダウンロードします *** echo: if not "%fdboot%"=="" GOTO DL_BALDE wget -nc -P %down_dir% %URL_fdboot% if "%errorlevel%"=="0" set fdboot=ok echo: :DL_BALDE echo *** # FreeDOS Balder image をダウンロードします *** echo: if not "%balder%"=="" GOTO DL_LINLD wget -nc -P %down_dir% %URL_balder% if "%errorlevel%"=="0" set balder=ok echo: :DL_LINLD echo *** # LINLD.COM をダウンロードします *** echo: if not "%linld%"=="" GOTO DL_MEMTE wget -nc -P %down_dir% %URL_linld% if "%errorlevel%"=="0" set linld=ok echo: :DL_MEMTE echo *** # memtest86+ をダウンロードします *** echo: if not "%memtest%"=="" GOTO DL_CONF wget -nc -P %down_dir% %URL_memtest% if "%errorlevel%"=="0" set memtest=%down_dir%\%FILE_memtest% echo: :DL_CONF echo *** # config file をダウンロードします *** echo: if not "%conf%"=="" GOTO DL_GRUB wget -nc -P %down_dir% %URL_conf% if "%errorlevel%"=="0" set conf=%down_dir%\%FILE_conf% echo: :DL_GRUB echo *** # grub4dos をダウンロードします *** echo: if not "%grub%"=="" GOTO CHECK_EX wget -nc -P %down_dir% %URL_grub% if "%errorlevel%"=="0" set grub=%down_dir%\%FILE_grub% echo: echo: :CHECK_EX if "%fcimage%"=="%down_dir%\%FILE_fcimage%" GOTO EXTRACT if "%memtest%"=="%down_dir%\%FILE_memtest%" GOTO EXTRACT if "%conf%"=="%down_dir%\%FILE_conf%" GOTO EXTRACT if "%grub%"=="%down_dir%\%FILE_grub%" GOTO EXTRACT GOTO DONE_EX REM ##################################### REM ### EXTRACT REM ##################################### :EXTRACT if "%unzipexe%"=="" GOTO NOUNZIP if "%tarexe%"=="" GOTO NOTAR if "%bzipexe%"=="" GOTO NOBZIP2 echo: echo *** ファイルを展開します *** echo: set path=%cd%\unzipxN;%cd%\texinst;%path% :EX_FCIMA REM ====================================== FC5-*-1.img echo: if not "%fcimage%"=="%down_dir%\%FILE_fcimage%" GOTO EX_MEMTE tar jxvf "%down_dir%\%FILE_fcimage%" -C %down_dir% "FC5-FloppyInstall-1.img" REM bzip2 -dk "%down_dir%\%FILE_fcimage%" REM tar xvf "%down_dir%\fc5fd.tar" -C "%down_dir%" "FC5-FloppyInstall-1.img" echo: if "%errorlevel%"=="0" echo * FC5-FloppyInstall-1.img OK echo: REM del "%down_dir%\fc5fd.tar" 2>nul :EX_MEMTE REM ====================================== memtest86+ echo: if not "%memtest%"=="%down_dir%\%FILE_memtest%" GOTO EX_CONF unzip.exe "%memtest%" -d %down_dir% echo: if "%errorlevel%"=="0" echo * memtest86+-2.01.bin OK echo: :EX_CONF REM ====================================== fdboot_liveusb3_files echo: if not "%conf%"=="%down_dir%\%FILE_conf%" GOTO EX_GRUB unzip.exe "%conf%" -d %down_dir% echo: if "%errorlevel%"=="0" echo * fdboot_liveusb3_files OK echo: :EX_GRUB REM ====================================== grub4dos if not "%grub%"=="%down_dir%\%FILE_grub%" GOTO DONE_EX unzip.exe "%grub%" -d .\ echo: if "%errorlevel%"=="0" echo * grub4dos-0.4.4 OK echo: :DONE_EX echo: echo ************************************************************** echo ダウンロードした書庫ファイルはすべて展開済みです echo: echo ダウンロードした元の書庫ファイルを削除しますか? echo (書庫ファイル以外は削除しません) echo: echo Y(y) : 確認しながら削除 echo A(a) : すべて削除(前回分も含め) echo : 削除しないなら、そのまま Enter で echo: echo ************************************************************** echo: set /p select= [y,a,N]: echo: if /i "%select%"=="y" GOTO DEL_SEL if /i "%select%"=="a" GOTO DEL_ALL GOTO MESSAGE :DEL_SEL del /p %down_dir%\%FILE_fcimage% del /p %down_dir%\%FILE_memtest% del /p %down_dir%\%FILE_conf% del /p %down_dir%\%FILE_grub% GOTO MESSAGE :DEL_ALL del %down_dir%\%FILE_fcimage% 2>nul del %down_dir%\%FILE_memtest% 2>nul del %down_dir%\%FILE_conf% 2>nul del %down_dir%\%FILE_grub% 2>nul GOTO MESSAGE REM ##################################### REM ### ERROR NOFILES REM ##################################### :NOWGET echo: echo !!! wget.exe がありません !!! echo: GOTO NOUNZIP :NOUNZIP if "%unzipexe%"=="ok" GOTO NOTAR echo: echo !!! unzip.exe がありません !!! echo: GOTO NOTAR :NOTAR if "%tarexe%"=="ok" GOTO NOBZIP2 echo: echo !!! tar.exe がありません !!! echo: GOTO NOBZIP2 :NOBZIP2 if "%bzipexe%"=="ok" GOTO NOFILES echo: echo !!! bzip2.exe がありません !!! echo: GOTO NOFILES :NOFILES echo: echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! echo: echo !!! ファイルが足りないのて中断しますです... !!! echo: echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! echo: GOTO END REM ##################################### REM ### FINISH REM ##################################### :DONE echo: echo ============================================================== echo: echo すべて展開済みです echo: echo ============================================================== echo: GOTO END :MESSAGE echo: echo ============================================================== echo: echo 終了しましたが.... エラーがなかったか?確認してください。 echo: echo ============================================================== echo: GOTO END :END echo: echo *** 何かキーを押すと閉じます *** pause >nul