@echo off
REM /// Begining of the lhdsetup.bat                              ///
REM ///                                                           ///
REM /// Modified to extract inst-img from root -- wfeldt@suse.de  ///
REM /// --------------------------------------------------------  ///
REM /// And modified again to not only store uncompressed root    ///
REM /// filesystem to %dirpath%\suse\setup\inst-img but also      ///
REM /// to copy compressed filesystem to                          ///
REM /// %dirpath%\suse\images\root -- gelnerr@suse.cz             ///
REM /// --------------------------------------------------------  ///
REM /// To work correctly with long filenames, this script        ///
REM /// employs LFN Tools by Ortwin Glueck                        ///
REM /// (http://odi.webjump.com) --  gelnerr@suse.cz              ///
REM /// --------------------------------------------------------  ///

cls

:main
echo.
echo Initialising...
echo.
echo    ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo    º                                                º
echo    º  Linux from Hard Disk SETUP v1.2               º
echo    º                                                º
echo    º  For SuSE Linux 7.1                            º
echo    º                                                º
echo    º                       (c) Cyril Soldani, 1999  º
echo    º                       (c) SuSE CR, 2001        º
echo    º                                                º
echo    ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼
echo.
echo This program set up the needed files for installing Linux or adding
echo packages to an existing version when CD-ROM is unaccessible from Linux.
echo It is designed for SuSE Linux 7.1.
echo This program comes with absolutely no warranty.
echo.

if "%1"=="" echo No directory specified, using default c:\linux.
if "%1"=="" set dirpath=c:\linux
if not "%1"=="" echo Installing in the directory %1.
if not "%1"=="" set dirpath=%1
if "%2"=="" echo No CD-ROM drive letter specified, using default d:
if "%2"=="" set cdrom=d:
if not "%2"=="" echo CD-ROM is drive letter %2 
if not "%2"=="" set cdrom=%2:
if "%3"=="" echo No kernel specified, using default k_i386.
if "%3"=="" set kernel=k_i386
if not "%3"=="" echo The kernel %3 will be used.
if not "%3"=="" set kernel=%3

set lfnpath=%cdrom%\dosutils\lfn

echo.
choice /C:yn /N Do you want to proceed ? (y,n) 
if errorlevel 2 goto abort
if errorlevel 1 goto main_menu
goto exit

:main_menu
cls
echo.
echo    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo    ³ A. Install from scratch  ³
echo    ³ B. Add packages          ³
echo    ³ C. Clean previous files  ³
echo    ³ D. Display help          ³
echo    ³ E. Boot SuSE Linux       ³
echo    ³ F. Quit Linux HD SETUP   ³
echo    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
choice /C:abcdef /N What do you want to do ? 
if errorlevel 6 goto quit
if errorlevel 5 goto boot
if errorlevel 4 goto help
if errorlevel 3 goto clean
if errorlevel 2 goto CD1
if errorlevel 1 goto install1
goto exit

:install1
cls
echo.
echo DU files are not really necessary. They will help you later to know how
echo much space you have left and how much space is occupied.  This could be
echo handy. However, DU files take quite much space.
echo.
choice /C:yn /N Do you want to install DU files ? (y,n) 
if errorlevel 2 goto no_du
if errorlevel 1 goto du
goto exit

:du
set du=yes
goto install2

:no_du
set du=no

:install2
echo Building directory structure...
echo Creating %dirpath%...
%lfnpath%\lmd "%dirpath%"
echo Creating %dirpath%\suse...
%lfnpath%\lmd "%dirpath%\suse"
echo Creating %dirpath%\suse\setup...
%lfnpath%\lmd "%dirpath%\suse\setup"
echo Creating %dirpath%\suse\setup\descr...
%lfnpath%\lmd "%dirpath%\suse\setup\descr"
if %du%==yes echo Creating %dirpath%\suse\setup\du...
if %du%==yes %lfnpath%\lmd "%dirpath%\suse\setup\du"
echo Creating %dirpath%\suse\images...
%lfnpath%\lmd "%dirpath%\suse\images"
echo Creating %dirpath%\suse\a1...
%lfnpath%\lmd "%dirpath%\suse\a1"
echo.
echo Directories created.
echo.
echo Please insert SuSE Linux CD 1 in %cdrom%
REM echo.
pause
echo lhdsetup will now copy requested files.
echo Copying setup files...
%lfnpath%\lcopy "%cdrom%\suse\setup\loadlin.exe" "%dirpath%\suse\setup" /V
echo Copying images files...
%lfnpath%\lcopy "%cdrom%\suse\images\initdisk.gz" "%dirpath%\suse\images" /V
%lfnpath%\lcopy "%cdrom%\suse\images\root" "%dirpath%\suse\images" /V
%lfnpath%\lcopy "%cdrom%\suse\images\%kernel%" "%dirpath%\suse\images" /V
echo Uncompressing image file (this may take very long time)...
%cdrom%\dosutils\gzip\gzip -dc %dirpath%\suse\images\root >%dirpath%\suse\setup\inst-img
echo Copying setup\descr files...
%lfnpath%\lcopy "%cdrom%\suse\setup\descr\*" "%dirpath%\suse\setup\descr" /V
if %du%==yes echo Copying setup\du files...
if %du%==yes %lfnpath%\lcopy "%cdrom%\suse\setup\du\*" "%dirpath%\suse\setup\du" /V
echo Copying a1 files...
%lfnpath%\lcopy "%cdrom%\suse\a1\*" "%dirpath%\suse\a1" /V
echo.
echo Install files copied.
echo.
pause
goto main_menu

:CD1
cls
echo.
echo    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ CD 1 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo    ³ A. a1                I. k2de2              Q. x1           ³
echo    ³ B. ap1               J. n1                 R. x3d1         ³
echo    ³ C. d1                K. perl1              S. xap1         ³
echo    ³ D. doc1              L. sec1               T. xdev1        ³
echo    ³ E. e1                M. snd1               U. xsrv1        ³
echo    ³ F. fun1              N. spl1               V. xwm1         ³
echo    ³ G. gra1              O. tcl1               W. yast1        ³
echo    ³ H. k2de1             P. tex1                               ³
echo    ³                                                            ³
echo    ³                                                            ³
echo    ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
echo    ³ 1. *** Other CDs ***                                       ³
echo    ³ 2. *** Main menu ***                                       ³
echo    ³ 3. *** Description of the sections ***                     ³
echo    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
choice /C:abcdefghijklmnopqrstuvw123 /N Your choice ? 
if errorlevel 26 goto descr1
if errorlevel 25 goto main_menu
if errorlevel 24 goto CD2
if errorlevel 23 goto yast1
if errorlevel 22 goto xwm1
if errorlevel 21 goto xsrv1
if errorlevel 20 goto xdev1
if errorlevel 19 goto xap1
if errorlevel 18 goto x3d1 
if errorlevel 17 goto x1 
if errorlevel 16 goto tex1
if errorlevel 15 goto tcl1
if errorlevel 14 goto spl1
if errorlevel 13 goto snd1
if errorlevel 12 goto sec1
if errorlevel 11 goto perl1
if errorlevel 10 goto n1
if errorlevel 9 goto k2de2
if errorlevel 8 goto k2de1
if errorlevel 7 goto gra1
if errorlevel 6 goto fun1
if errorlevel 5 goto e1
if errorlevel 4 goto doc1
if errorlevel 3 goto d1
if errorlevel 2 goto ap1
if errorlevel 1 goto a1
goto exit

:descr1
set cd=CD1
goto description

:a1
set pack=a1
set cd=CD1
goto add

:ap1
set pack=ap1
set cd=CD1
goto add

:d1 
set pack=d1
set cd=CD1
goto add

:doc1
set pack=doc1
set cd=CD1
goto add

:e1
set pack=e1
set cd=CD1
goto add

:fun1
set pack=fun1
set cd=CD1
goto add

:gra1
set pack=gra1
set cd=CD1
goto add

:k2de1
set pack=k2de1
set cd=CD1
goto add

:k2de2
set pack=k2de2
set cd=CD1
goto add

:n1  
set pack=n1
set cd=CD1
goto add

:perl1
set pack=perl1
set cd=CD1
goto add

:sec1
set pack=sec1
set cd=CD1
goto add

:snd1
set pack=snd1
set cd=CD1
goto add

:spl1
set pack=spl1
set cd=CD1
goto add

:tcl1 
set pack=tcl1
set cd=CD1
goto add

:tex1
set pack=tex1
set cd=CD1
goto add

:x1
set pack=x1
set cd=CD1
goto add

:x3d1
set pack=x3d1
set cd=CD1
goto add

:xap1
set pack=xap1
set cd=CD1
goto add

:xdev1
set pack=xdev1
set cd=CD1
goto add

:xsrv1
set pack=xsrv1
set cd=CD1
goto add

:xwm1
set pack=xwm1
set cd=CD1
goto add

:yast1
set pack=yast1
set cd=CD1
goto add

:CD2
cls
echo.
echo    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ CD 2 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo    ³ A. a2                I. kde4               Q. spl2         ³
echo    ³ B. ap2               J. kpa1               R. x2           ³
echo    ³ C. ap3               K. n2                 S. x3           ³
echo    ³ D. e2                L. n3                 T. xsrv2        ³
echo    ³ E. k2de3             M. pay1               U. xsrv3        ³
echo    ³ F. k2de4             N. perl2              V. xv1          ³
echo    ³ G. kde1              O. sec2               W. xwm2         ³
echo    ³ H. kde2              P. sgm1               X. yast2        ³
echo    ³                                                            ³
echo    ³                                                            ³
echo    ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
echo    ³ 1. *** Other CDs ***                                       ³
echo    ³ 2. *** Main menu ***                                       ³
echo    ³ 3. *** Description of the sections ***                     ³
echo    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
choice /C:abcdefghijklmnopqrstuvwx123 /N Your choice ? 
if errorlevel 27 goto descr2
if errorlevel 26 goto main_menu
if errorlevel 25 goto CD3
if errorlevel 24 goto yast2
if errorlevel 23 goto xwm2
if errorlevel 22 goto xv1  
if errorlevel 21 goto xsrv3
if errorlevel 20 goto xsrv2
if errorlevel 19 goto x3  
if errorlevel 18 goto x2   
if errorlevel 17 goto spl2
if errorlevel 16 goto sgm1
if errorlevel 15 goto sec2 
if errorlevel 14 goto perl2
if errorlevel 13 goto pay1
if errorlevel 12 goto n3  
if errorlevel 11 goto n2   
if errorlevel 10 goto kpa1
if errorlevel 9 goto kde4 
if errorlevel 8 goto kde2 
if errorlevel 7 goto kde1
if errorlevel 6 goto k2de4
if errorlevel 5 goto k2de3
if errorlevel 4 goto e2  
if errorlevel 3 goto ap3
if errorlevel 2 goto ap2
if errorlevel 1 goto a2

goto exit 

:descr2
set cd=CD2
goto description

:a2
set pack=a2
set cd=CD2
goto add

:ap2 
set pack=ap2
set cd=CD2
goto add

:ap3 
set pack=ap3
set cd=CD2
goto add

:e2  
set pack=e2
set cd=CD2
goto add

:k2de3
set pack=k2de3
set cd=CD2
goto add

:k2de4
set pack=k2de4
set cd=CD2
goto add

:kde1
set pack=kde1
set cd=CD2
goto add

:kde2
set pack=kde2
set cd=CD2
goto add

:kde4
set pack=kde4
set cd=CD2
goto add

:kpa1
set pack=kpa1
set cd=CD2
goto add

:n2  
set pack=n2
set cd=CD2
goto add

:n3   
set pack=n3
set cd=CD2
goto add

:pay1
set pack=pay1
set cd=CD2
goto add

:perl2
set pack=perl2
set cd=CD2
goto add

:sec2 
set pack=sec2
set cd=CD2
goto add

:sgm1 
set pack=sgm1
set cd=CD2
goto add

:spl2 
set pack=spl2
set cd=CD2
goto add

:x2   
set pack=x2
set cd=CD2
goto add

:x3   
set pack=x3
set cd=CD2
goto add

:xsrv2
set pack=xsrv2
set cd=CD2
goto add

:xsrv3
set pack=xsrv3
set cd=CD2
goto add

:xv1  
set pack=xv1
set cd=CD2
goto add

:xwm2 
set pack=xwm2
set cd=CD2
goto add

:yast2
set pack=yast2
set cd=CD2
goto add

:CD3
:CD4

cls
echo.
echo    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ CD 3 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo    ³ A. fun2              D. tex2               F. xap2         ³
echo    ³ B. gra2              E. x3d2               G. xdev2        ³
echo    ³ C. snd2                                                    ³
echo    ³                                                            ³
echo    ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ CD 4 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
echo    ³ H. beo1              L. emu1               P. gnm4         ³
echo    ³ I. d2                M. gnm1               Q. ham1         ³
echo    ³ J. d3                N. gnm2               R. tcl2         ³
echo    ³ K. d4                O. gnm3                               ³
echo    ³                                                            ³
echo    ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
echo    ³ 1. *** Other CDs ***                                       ³
echo    ³ 2. *** Main menu ***                                       ³
echo    ³ 3. *** Description of the sections ***                     ³
echo    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
choice /C:abcdefghijklmnopqr123 /N Your choice ? 

if errorlevel 21 goto descr3
if errorlevel 20 goto main_menu
if errorlevel 19 goto CD5
if errorlevel 18 goto tcl2 
if errorlevel 17 goto ham1
if errorlevel 16 goto gnm4
if errorlevel 15 goto gnm3 
if errorlevel 14 goto gnm2 
if errorlevel 13 goto gnm1
if errorlevel 12 goto emu1
if errorlevel 11 goto d4   
if errorlevel 10 goto d3  
if errorlevel 9 goto d2   
if errorlevel 8 goto beo1 
if errorlevel 7 goto xdev2
if errorlevel 6 goto xap2 
if errorlevel 5 goto x3d2 
if errorlevel 4 goto tex2
if errorlevel 3 goto snd2
if errorlevel 2 goto gra2
if errorlevel 1 goto fun2

goto exit 

:descr3
set cd=CD3
goto description

:fun2
set pack=fun2
set cd=CD3
goto add

:gra2
set pack=gra2
set cd=CD3
goto add

:snd2
set pack=snd2
set cd=CD3
goto add

:tex2
set pack=tex2
set cd=CD3
goto add

:x3d2
set pack=x3d2 
set cd=CD3
goto add

:xap2
set pack=xap2 
set cd=CD3
goto add

:xdev2
set pack=xdev2
set cd=CD3
goto add

:beo1 
set pack=beo1 
set cd=CD4
goto add

:d2  
set pack=d2
set cd=CD4
goto add

:d3  
set pack=d3  
set cd=CD4
goto add

:d4  
set pack=d4  
set cd=CD4
goto add

:emu1
set pack=emu1
set cd=CD4
goto add

:gnm1
set pack=gnm1
set cd=CD4
goto add

:gnm2
set pack=gnm2
set cd=CD4
goto add

:gnm3
set pack=gnm3
set cd=CD4
goto add

:gnm4
set pack=gnm4
set cd=CD4
goto add

:ham1
set pack=ham1
set cd=CD4
goto add

:tcl2
set pack=tcl2
set cd=CD4
goto add

goto exit

:CD5
:CD6
:CD7

cls
echo.
echo    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ CD 5 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo    ³ A. doc2              D. pay3               F. pay5         ³
echo    ³ B. doc3              E. pay4               G. zq1          ³
echo    ³ C. pay2                                                    ³
echo    ³                                                            ³
echo    ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ CD 6 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
echo    ³ H. zq2                                                     ³
echo    ³                                                            ³
echo    ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ CD 7 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
echo    ³ I. zq3                                                     ³
echo    ³                                                            ³
echo    ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
echo    ³                                                            ³
echo    ³ 1. *** Main menu ***                                       ³
echo    ³ 2. *** Description of the sections ***                     ³
echo    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
choice /C:abcdefghi12 /N Your choice ? 

if errorlevel 11 goto descr5
if errorlevel 10 goto main_menu
if errorlevel 9 goto zq3  
if errorlevel 8 goto zq2  
if errorlevel 7 goto zq1
if errorlevel 6 goto pay5 
if errorlevel 5 goto pay4 
if errorlevel 4 goto pay3
if errorlevel 3 goto pay2
if errorlevel 2 goto doc3
if errorlevel 1 goto doc2

goto exit 

:descr5
set cd=CD5
goto description

:doc2
set pack=fun2
set cd=CD5
goto add

:doc3
set pack=gra2
set cd=CD5
goto add

:pay2
set pack=snd2
set cd=CD5
goto add

:pay3
set pack=tex2
set cd=CD5
goto add

:pay4
set pack=x3d2
set cd=CD5
goto add

:pay5
set pack=xap2
set cd=CD5
goto add

:zq1
set pack=xdev2
set cd=CD5
goto add

:zq2
set pack=zq2
set cd=CD6
goto add

:zq3
set pack=zq3
set cd=CD7
goto add

goto exit

:add
echo.
echo lhdsetup will now create the %pack% directory.
echo Creating %dirpath%\suse\%pack%
%lfnpath%\lmd "%dirpath%\suse\%pack%"
echo.
echo lhdsetup will now install %pack% files.
echo.
echo Insert SuSE Linux %cd% in %cdrom%
echo.
pause
echo Copying %pack% files...
%lfnpath%\lcopy "%cdrom%\suse\%pack%\*" "%dirpath%\suse\%pack%" /V
echo.
echo %pack% files copied.
echo.
pause
goto %cd%

:description
cls
echo.
echo a     Linux Base System (You need it!) 
echo ap    Programs that don't need X
echo beo   Extreme Linux (Beowulf)
echo d     Development (C, C++, Lisp, etc.)
echo doc   Documentation
echo e     Emacs
echo emu   Emulators
echo fun   Games and more
echo gnm   GNOME - GNU Network Object Model Environment
echo gra   All about graphics
echo k2de  KDE2 - K Desktop Environment (version 2)
echo kde   K Desktop Environment
echo kpa   KDE applications
echo n     Network-Support (TCP/IP, UUCP, Mail, News)
echo pay   Commercial Software
echo perl  Perl modules
echo sec   Security related software
echo snd   Sound related stuff 
echo spl   Spell checking utilities and databases  
echo.
pause
cls
echo.
echo tex   TeX/LaTeX and applications
echo x     Base X Window System - XFree86\tm 
echo x3d   3D stuff for X11 and console     
echo xap   X Applications    
echo xdev  Development under X11
echo xsrv  Several X Servers (XFree86\tm)
echo xv    XView (OpenLook, Applications)
echo xwm   Window Manager and Desktop   
echo yast  YaST Components             
echo zq    Source packages 
echo.
pause
goto %cd%

:clean
cls
echo.
echo    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo    ³ A. Clean packages files                                           ³
echo    ³ B. Full cleaning, erase all files (you'll need to re-run install  ³
echo    ³     in order to add packages)                                     ³
echo    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
choice /C:ab /N What do you want to do ? 
if errorlevel 2 goto clean_full
if errorlevel 1 goto clean_pack
goto exit

:clean_pack
echo.
echo lhdsetup will now clean packages files...
if exist %dirpath%\suse\a2\*.* echo Cleaning a2 files...
if exist %dirpath%\suse\a2\*.* %lfnpath%\ldel /c "%dirpath%\suse\a2\*"
if exist %dirpath%\suse\ap1\*.* echo Cleaning ap1 files...
if exist %dirpath%\suse\ap1\*.* %lfnpath%\ldel /c "%dirpath%\suse\ap1\*"
if exist %dirpath%\suse\ap2\*.* echo Cleaning ap2 files...
if exist %dirpath%\suse\ap2\*.* %lfnpath%\ldel /c "%dirpath%\suse\ap2\*"
if exist %dirpath%\suse\ap3\*.* echo Cleaning ap3 files...
if exist %dirpath%\suse\ap3\*.* %lfnpath%\ldel /c "%dirpath%\suse\ap3\*"
if exist %dirpath%\suse\d1\*.* echo Cleaning d1 files...
if exist %dirpath%\suse\d1\*.* %lfnpath%\ldel /c "%dirpath%\suse\d1\*"
if exist %dirpath%\suse\d2\*.* echo Cleaning d2 files...
if exist %dirpath%\suse\d2\*.* %lfnpath%\ldel /c "%dirpath%\suse\d2\*"
if exist %dirpath%\suse\d3\*.* echo Cleaning d3 files...
if exist %dirpath%\suse\d3\*.* %lfnpath%\ldel /c "%dirpath%\suse\d3\*"
if exist %dirpath%\suse\d4\*.* echo Cleaning d4 files...
if exist %dirpath%\suse\d4\*.* %lfnpath%\ldel /c "%dirpath%\suse\d4\*"
if exist %dirpath%\suse\e1\*.* echo Cleaning e1 files...
if exist %dirpath%\suse\e1\*.* %lfnpath%\ldel /c "%dirpath%\suse\e1\*"
if exist %dirpath%\suse\e2\*.* echo Cleaning e2 files...
if exist %dirpath%\suse\e2\*.* %lfnpath%\ldel /c "%dirpath%\suse\e2\*"
if exist %dirpath%\suse\n1\*.* echo Cleaning n1 files...
if exist %dirpath%\suse\n1\*.* %lfnpath%\ldel /c "%dirpath%\suse\n1\*"
if exist %dirpath%\suse\n2\*.* echo Cleaning n2 files...
if exist %dirpath%\suse\n2\*.* %lfnpath%\ldel /c "%dirpath%\suse\n2\*"
if exist %dirpath%\suse\n3\*.* echo Cleaning n3 files...
if exist %dirpath%\suse\n3\*.* %lfnpath%\ldel /c "%dirpath%\suse\n3\*"
if exist %dirpath%\suse\sec1\*.* echo Cleaning sec1 files...
if exist %dirpath%\suse\sec1\*.* %lfnpath%\ldel /c "%dirpath%\suse\sec1\*"
if exist %dirpath%\suse\sec2\*.* echo Cleaning sec2 files...
if exist %dirpath%\suse\sec2\*.* %lfnpath%\ldel /c "%dirpath%\suse\sec2\*"
if exist %dirpath%\suse\tcl1\*.* echo Cleaning tcl1 files...
if exist %dirpath%\suse\tcl1\*.* %lfnpath%\ldel /c "%dirpath%\suse\tcl1\*"
if exist %dirpath%\suse\tcl2\*.* echo Cleaning tcl2 files...
if exist %dirpath%\suse\tcl2\*.* %lfnpath%\ldel /c "%dirpath%\suse\tcl2\*"
if exist %dirpath%\suse\x1\*.* echo Cleaning x1 files...
if exist %dirpath%\suse\x1\*.* %lfnpath%\ldel /c "%dirpath%\suse\x1\*"
if exist %dirpath%\suse\x2\*.* echo Cleaning x2 files...
if exist %dirpath%\suse\x2\*.* %lfnpath%\ldel /c "%dirpath%\suse\x2\*"
if exist %dirpath%\suse\x3\*.* echo Cleaning x3 files...
if exist %dirpath%\suse\x3\*.* %lfnpath%\ldel /c "%dirpath%\suse\x3\*"
if exist %dirpath%\suse\xsrv1\*.* echo Cleaning xsrv1 files...
if exist %dirpath%\suse\xsrv1\*.* %lfnpath%\ldel /c "%dirpath%\suse\xsrv1\*"
if exist %dirpath%\suse\xsrv2\*.* echo Cleaning xsrv2 files...
if exist %dirpath%\suse\xsrv2\*.* %lfnpath%\ldel /c "%dirpath%\suse\xsrv2\*"
if exist %dirpath%\suse\xsrv3\*.* echo Cleaning xsrv3 files...
if exist %dirpath%\suse\xsrv3\*.* %lfnpath%\ldel /c "%dirpath%\suse\xsrv3\*"
if exist %dirpath%\suse\xv1\*.* echo Cleaning xv1 files...
if exist %dirpath%\suse\xv1\*.* %lfnpath%\ldel /c "%dirpath%\suse\xv1\*"
if exist %dirpath%\suse\doc1\*.* echo Cleaning doc1 files...
if exist %dirpath%\suse\doc1\*.* %lfnpath%\ldel /c "%dirpath%\suse\doc1\*"
if exist %dirpath%\suse\doc2\*.* echo Cleaning doc2 files...
if exist %dirpath%\suse\doc2\*.* %lfnpath%\ldel /c "%dirpath%\suse\doc2\*"
if exist %dirpath%\suse\doc3\*.* echo Cleaning doc3 files...
if exist %dirpath%\suse\doc3\*.* %lfnpath%\ldel /c "%dirpath%\suse\doc3\*"
if exist %dirpath%\suse\gnm1\*.* echo Cleaning gnm1 files...
if exist %dirpath%\suse\gnm1\*.* %lfnpath%\ldel /c "%dirpath%\suse\gnm1\*"
if exist %dirpath%\suse\gnm2\*.* echo Cleaning gnm2 files...
if exist %dirpath%\suse\gnm2\*.* %lfnpath%\ldel /c "%dirpath%\suse\gnm2\*"
if exist %dirpath%\suse\gnm3\*.* echo Cleaning gnm3 files...
if exist %dirpath%\suse\gnm3\*.* %lfnpath%\ldel /c "%dirpath%\suse\gnm3\*"
if exist %dirpath%\suse\gnm4\*.* echo Cleaning gnm4 files...
if exist %dirpath%\suse\gnm4\*.* %lfnpath%\ldel /c "%dirpath%\suse\gnm4\*"
if exist %dirpath%\suse\gra1\*.* echo Cleaning gra1 files...
if exist %dirpath%\suse\gra1\*.* %lfnpath%\ldel /c "%dirpath%\suse\gra1\*"
if exist %dirpath%\suse\gra2\*.* echo Cleaning gra2 files...
if exist %dirpath%\suse\gra2\*.* %lfnpath%\ldel /c "%dirpath%\suse\gra2\*"
if exist %dirpath%\suse\kde1\*.* echo Cleaning kde1 files...
if exist %dirpath%\suse\kde1\*.* %lfnpath%\ldel /c "%dirpath%\suse\kde1\*"
if exist %dirpath%\suse\kde2\*.* echo Cleaning kde2 files...
if exist %dirpath%\suse\kde2\*.* %lfnpath%\ldel /c "%dirpath%\suse\kde2\*"
if exist %dirpath%\suse\kde4\*.* echo Cleaning kde4 files...
if exist %dirpath%\suse\kde4\*.* %lfnpath%\ldel /c "%dirpath%\suse\kde4\*"
if exist %dirpath%\suse\kpa1\*.* echo Cleaning kpa1 files...
if exist %dirpath%\suse\kpa1\*.* %lfnpath%\ldel /c "%dirpath%\suse\kpa1\*"
if exist %dirpath%\suse\sgm1\*.* echo Cleaning sgm1 files...
if exist %dirpath%\suse\sgm1\*.* %lfnpath%\ldel /c "%dirpath%\suse\sgm1\*"
if exist %dirpath%\suse\xdev1\*.* echo Cleaning xdev1 files...
if exist %dirpath%\suse\xdev1\*.* %lfnpath%\ldel /c "%dirpath%\suse\xdev1\*"
if exist %dirpath%\suse\xdev2\*.* echo Cleaning xdev2 files...
if exist %dirpath%\suse\xdev2\*.* %lfnpath%\ldel /c "%dirpath%\suse\xdev2\*"
if exist %dirpath%\suse\xwm1\*.* echo Cleaning xwm1 files...
if exist %dirpath%\suse\xwm1\*.* %lfnpath%\ldel /c "%dirpath%\suse\xwm1\*"
if exist %dirpath%\suse\xwm2\*.* echo Cleaning xwm2 files...
if exist %dirpath%\suse\xwm2\*.* %lfnpath%\ldel /c "%dirpath%\suse\xwm2\*"
if exist %dirpath%\suse\beo1\*.* echo Cleaning beo1 files...
if exist %dirpath%\suse\beo1\*.* %lfnpath%\ldel /c "%dirpath%\suse\beo1\*"
if exist %dirpath%\suse\ham1\*.* echo Cleaning ham1 files...
if exist %dirpath%\suse\ham1\*.* %lfnpath%\ldel /c "%dirpath%\suse\ham1\*"
if exist %dirpath%\suse\pay1\*.* echo Cleaning pay1 files...
if exist %dirpath%\suse\pay1\*.* %lfnpath%\ldel /c "%dirpath%\suse\pay1\*"
if exist %dirpath%\suse\pay2\*.* echo Cleaning pay2 files...
if exist %dirpath%\suse\pay2\*.* %lfnpath%\ldel /c "%dirpath%\suse\pay2\*"
if exist %dirpath%\suse\pay3\*.* echo Cleaning pay3 files...
if exist %dirpath%\suse\pay3\*.* %lfnpath%\ldel /c "%dirpath%\suse\pay3\*"
if exist %dirpath%\suse\pay4\*.* echo Cleaning pay4 files...
if exist %dirpath%\suse\pay4\*.* %lfnpath%\ldel /c "%dirpath%\suse\pay4\*"
if exist %dirpath%\suse\pay5\*.* echo Cleaning pay5 files...
if exist %dirpath%\suse\pay5\*.* %lfnpath%\ldel /c "%dirpath%\suse\pay5\*"
if exist %dirpath%\suse\xap1\*.* echo Cleaning xap1 files...
if exist %dirpath%\suse\xap1\*.* %lfnpath%\ldel /c "%dirpath%\suse\xap1\*"
if exist %dirpath%\suse\xap2\*.* echo Cleaning xap2 files...
if exist %dirpath%\suse\xap2\*.* %lfnpath%\ldel /c "%dirpath%\suse\xap2\*"
if exist %dirpath%\suse\emu1\*.* echo Cleaning emu1 files...
if exist %dirpath%\suse\emu1\*.* %lfnpath%\ldel /c "%dirpath%\suse\emu1\*"
if exist %dirpath%\suse\fun1\*.* echo Cleaning fun1 files...
if exist %dirpath%\suse\fun1\*.* %lfnpath%\ldel /c "%dirpath%\suse\fun1\*"
if exist %dirpath%\suse\fun2\*.* echo Cleaning fun2 files...
if exist %dirpath%\suse\fun2\*.* %lfnpath%\ldel /c "%dirpath%\suse\fun2\*"
if exist %dirpath%\suse\snd1\*.* echo Cleaning snd1 files...
if exist %dirpath%\suse\snd1\*.* %lfnpath%\ldel /c "%dirpath%\suse\snd1\*"
if exist %dirpath%\suse\snd2\*.* echo Cleaning snd2 files...
if exist %dirpath%\suse\snd2\*.* %lfnpath%\ldel /c "%dirpath%\suse\snd2\*"
if exist %dirpath%\suse\spl1\*.* echo Cleaning spl1 files...
if exist %dirpath%\suse\spl1\*.* %lfnpath%\ldel /c "%dirpath%\suse\spl1\*"
if exist %dirpath%\suse\spl2\*.* echo Cleaning spl2 files...
if exist %dirpath%\suse\spl2\*.* %lfnpath%\ldel /c "%dirpath%\suse\spl2\*"
if exist %dirpath%\suse\tex1\*.* echo Cleaning tex1 files...
if exist %dirpath%\suse\tex1\*.* %lfnpath%\ldel /c "%dirpath%\suse\tex1\*"
if exist %dirpath%\suse\tex2\*.* echo Cleaning tex2 files...
if exist %dirpath%\suse\tex2\*.* %lfnpath%\ldel /c "%dirpath%\suse\tex2\*"
if exist %dirpath%\suse\x3d1\*.* echo Cleaning x3d1 files...
if exist %dirpath%\suse\x3d1\*.* %lfnpath%\ldel /c "%dirpath%\suse\x3d1\*"
if exist %dirpath%\suse\x3d2\*.* echo Cleaning x3d2 files...
if exist %dirpath%\suse\x3d2\*.* %lfnpath%\ldel /c "%dirpath%\suse\x3d2\*"
if exist %dirpath%\suse\zq1\*.* echo Cleaning zq1 files...
if exist %dirpath%\suse\zq1\*.* %lfnpath%\ldel /c "%dirpath%\suse\zq1\*"
if exist %dirpath%\suse\zq2\*.* echo Cleaning zq2 files...
if exist %dirpath%\suse\zq2\*.* %lfnpath%\ldel /c "%dirpath%\suse\zq2\*"
if exist %dirpath%\suse\zq3\*.* echo Cleaning zq3 files...
if exist %dirpath%\suse\zq3\*.* %lfnpath%\ldel /c "%dirpath%\suse\zq3\*"
if exist %dirpath%\suse\perl1\*.* echo Cleaning perl1 files...
if exist %dirpath%\suse\perl1\*.* %lfnpath%\ldel /c "%dirpath%\suse\perl1\*"
if exist %dirpath%\suse\perl2\*.* echo Cleaning perl2 files...
if exist %dirpath%\suse\perl2\*.* %lfnpath%\ldel /c "%dirpath%\suse\perl2\*"
if exist %dirpath%\suse\k2de1\*.* echo Cleaning k2de1 files...
if exist %dirpath%\suse\k2de1\*.* %lfnpath%\ldel /c "%dirpath%\suse\k2de1\*"
if exist %dirpath%\suse\k2de2\*.* echo Cleaning k2de2 files...
if exist %dirpath%\suse\k2de2\*.* %lfnpath%\ldel /c "%dirpath%\suse\k2de2\*"
if exist %dirpath%\suse\k2de3\*.* echo Cleaning k2de3 files...
if exist %dirpath%\suse\k2de3\*.* %lfnpath%\ldel /c "%dirpath%\suse\k2de3\*"
if exist %dirpath%\suse\k2de4\*.* echo Cleaning k2de4 files...
if exist %dirpath%\suse\k2de4\*.* %lfnpath%\ldel /c "%dirpath%\suse\k2de4\*"
if exist %dirpath%\suse\yast1\*.* echo Cleaning yast1 files...
if exist %dirpath%\suse\yast1\*.* %lfnpath%\ldel /c "%dirpath%\suse\yast1\*"
if exist %dirpath%\suse\yast2\*.* echo Cleaning yast2 files...
if exist %dirpath%\suse\yast2\*.* %lfnpath%\ldel /c "%dirpath%\suse\yast2\*"
echo.
echo Previous packages files cleaned.
echo.
pause
goto main_menu

:clean_full
echo.
echo lhdsetup wil now erase %dirpath%
deltree "%dirpath%"
echo.
echo All files have been removed from disk (if you didn't cancelled).
echo.
pause
goto main_menu

:help
echo.
echo Usage:
echo lhdsetup [directory (must be in root)] [CD-ROM drive letter] [kernel]
echo e.g. lhdsetup c:\tmp e k_i386
echo.
echo Respect carefully the syntax as given in the example. Do not use
echo long directory name for instalation directory (ie. no more than
echo 8+3 charaters).
echo.
echo The files created in the installation directory may have filenames
echo longer than 8+3 characters. Such files should not be manipulated with
echo the DOS tools unable to work with long filenames otherwise the names
echo will get corrupted!
echo To work with the files safely, use for example the LFN Tools in the
echo directory %lfnpath%.
goto end

:boot
echo.
if not exist "%dirpath%\suse\setup\loadlin.exe" echo %dirpath%\suse\setup\loadlin.exe missing. Make install first.
if not exist "%dirpath%\suse\setup\loadlin.exe" echo.
if not exist "%dirpath%\suse\setup\loadlin.exe" pause
if not exist "%dirpath%\suse\setup\loadlin.exe" goto main_menu
if not exist "%dirpath%\suse\images\initdisk.gz" echo %dirpath%\suse\images\initdisk.gz missing. Make first install.
if not exist "%dirpath%\suse\setup\loadlin.exe" echo.
if not exist %dirpath%\suse\setup\loadlin.exe pause
if not exist %dirpath%\suse\setup\loadlin.exe goto main_menu
:loadlin
%dirpath%\suse\setup\loadlin.exe %dirpath%\suse\images\%kernel% root=200 rw 2 initrd=%dirpath%\suse\images\initdisk.gz

:quit
echo.
echo Exiting...
goto end

:exit
echo.
echo Abnormal termination

:abort
echo.
echo Aborting...

:end
echo.
echo Cyril Soldani, "C_Soldani@yahoo.com"
echo SuSE CR, "feedback@suse.cz"
echo.
REM /// End of lhdsetup.bat ///
