![]() |
![]() ![]() |
Apr 10 2004, 05:15 AM
Post
#1
|
|
|
Gold Member ![]() ![]() ![]() ![]() Group: Members Posts: 548 Joined: 22-December 03 Member No.: 3,201 |
ATTENTION: This is the old and outdated version
update: changed on 16.Apr.2004 10:50 MEZ changes: no more need for mtr.exe, thanks to paraglider ! Hi ! I just want to share the batch file I use to get more out of Bart's PE. Perhaps this can help some newbies (and even experienced users). What you get by following my tips: 1) No need to edit inf files by hand (inf files for hardware drivers) 2) ability to include hex(a) and hex(8) reg entries 3) If you include the BCDW-plugin for Bart'sPE: allows you to activate/deactivate BCDW without the need to change your MakeIso command all the time 4) For CygWin compatibility: Uppercase the I386 dir (see this thread) 5) Faster boot for XPE: Shortcuts are now pre-generated you still have to copy them to your RamDrive at startup with a simple xcopy command, see GenShortcuts documentation here. 6) Again for compatibility reasons: No more need to use Bart's patched version of mkisofs better use the original one instead, because Bart's patch makes all Files uppercased! The points 1) and 2) should help making plugins MUCH easier !! STEP 1: make the following file in your bartPE-folder: - "my_additional_commands.bat" The content of this file can be found below STEP2: make the following additional folders in your BartPe dir: - "PEUtils" Into this folder you have to put all the additional applications - "PEUtils\InfCache" This folder is optional, and is only needed if you are working on W2k Since InfCache does not work under Win2k, I simply compiled my drivercache at home and copied it to the subdir InfCache STEP 3: change on line in pebuilder.inf: change QUOTE exec="mkisofs.exe -iso-level 4 -volid ""BartPE"" -A PEBUILDER/MKISOFS -sysid ""Win32"" -b bootsect.bin -no-emul-boot -boot-load-size 4 -hide bootsect.bin -hide boot.catalog -o ""@IsoFile@"" ""@OutDir@""" to QUOTE exec="my_additional_commands.bat "@IsoFile@" "@OutDir@" " STEP 4: copy the pregenerated links to your RamDrive at runtime: QUOTE xcopy "%SystemDrive%\Fastlinks" "%ALLUSERSPROFILE%\startmenu\programs" /E This line has to be modified if you are using a different language. For example in german this would be: "xcopy "%SystemDrive%\Fastlinks" "%ALLUSERSPROFILE%\startmenü\programme" /E " Add this xcopy command to any of your autostart mechanisms. Thats all. Sounds like a lot of work, but you only need to do it once ! And the benefits are great ! ------------------------------------------------------------------------------ Additional Applications (to be put in the folder PEUtils): - FileCase (available here as part of the 'Win32 Console ToolBox') - InfCachebuild, either by Sherpeya (get it here) or paraglider (available here). - UpdateInfs by paraglider (available here, documentation here) - ConvReg by paraglider (available here, documentation here) - GenShortcuts by paraglider (available here, documentation here) - Mnu2Lnk.exe by cyberwolf (available here) - upatched mkisofs (available here as part of cdrtools). Please do not forget to download "cygwin1.dll" from the same site ! Please have a look at my suggestions and test them. Leave me a comment, if something does not work as intended, though everything was tested and is working here. Have fun !! cyrano P.S A big thanks goes to PARAGLIDER for his excellent tools !!!! |
|
|
|
Apr 10 2004, 05:22 AM
Post
#2
|
|
|
Gold Member ![]() ![]() ![]() ![]() Group: Members Posts: 548 Joined: 22-December 03 Member No.: 3,201 |
updated: 26.April.2004 12:50 MEZ
Attention: With SP2, some drivers in the "DRIVERS" dir need to be lower cased ! I did not find out the exact rules for that, but I found out that amdk7.sys and amdk6.sys need to be lowercase. "my_additional_commands.bat" QUOTE :: my_additional_commands.bat
@echo off SET ISOFile=%1 SET OutDir=%2 SET PEUtilsPath=%3 IF "%PEUtilsPath%"=="" SET PEUtilsPath=%~d0%~p0PEUtils :: ---------------------------------------------- :: Show the parameters... echo ISOFILE: %ISOFile% echo OUTDIR : %OutDir% echo UtilDir: %PEUtilsPath% :: ---------------------------------------------- :: STEP 1: Upper/Lower case routine... :: ---------------------------------------------- echo. echo STEP 1: Upper/Lower case routine... IF NOT EXIST "%PEUtilsPath%\filecase.exe" GOTO continue2 %PEUtilsPath%\filecase.exe /u /h /q /d %OutDir% %PEUtilsPath%\filecase.exe /u /h /q /d %OutDir%\i386" %PEUtilsPath%\filecase.exe /u /h /q /d /s %OutDir%\i386\system32" ::%PEUtilsPath%\filecase.exe /l /h /q %OutDir%\i386\system32\*.exe" ::%PEUtilsPath%\filecase.exe /u /h /q %OutDir%\i386\system32\ntkrnlmp.exe" %PEUtilsPath%\filecase.exe /u /h /q /d /s %OutDir%\i386\system32\drivers" %PEUtilsPath%\filecase.exe /l /h /q %OutDir%\i386\system32\autorun*.*" ren "%OutDir%\i386\system32" SYSTEM32 ren "%OutDir%\i386\system32\drivers" DRIVERS ::copy %~d0%~p0plugin\plugnplay\drivers\amd*.sys %OutDir%\i386\system32\drivers > NUL :continue2 :: ---------------------------------------------- :: STEP 2: change hardware-inf files, so that no files get copied or deleted: :: ---------------------------------------------- echo. echo STEP 2: Replace CopyFiles and DelFiles in all .inf files IF NOT EXIST "%PEUtilsPath%\UpdateInfs.exe" GOTO continue3 echo working in Dir: %OutDir%\i386\inf start /wait %PEUtilspath%\UpdateInfs %OutDir%\i386\inf\*.inf :continue3 :: ---------------------------------------------- :: STEP3: include hex(8) and hex(a) entries from .reg files :: ---------------------------------------------- echo. echo STEP 3: Include hex(8) and hex(a) entries from .reg files :: the next line checks for a subdir called ADD_REG in the outputdir. :: If this dir exists, then all reg files in this dir will be added to the PE-registry. IF NOT EXIST %OutDir%\ADD_REG\NUL GOTO continue4 IF NOT EXIST "%PEUtilsPath%\ConvReg.exe" GOTO continue4 echo reg files found in Dir: %OutDir%\ADD_REG echo replacing 'HKLM\SYSTEM\ControlSet001' with 'HKLM\SYS_PE\ControlSet001' start /wait %PEUtilsPath%\ConvReg.exe %OutDir%\ADD_REG\*.reg echo including all reg files in %OutDir%\ADD_REG reg.exe load HKLM\SYS_PE %OutDir%\i386\system32\setupreg.hiv > NUL if errorlevel 1 goto all_done for /R %OutDir%\ADD_REG %%v in (*.reg) Do regedit /s %%v > NUL del %OutDir%\ADD_REG\*.reg > NUL rd %OutDir%\ADD_REG > NUL if exist setupreg.hiv del setupreg.hiv > NUL reg.exe save HKLM\SYS_PE setupreg.hiv > NUL if errorlevel 1 goto all_done reg.exe unload HKLM\SYS_PE > NUL if errorlevel 1 goto all_done copy setupreg.hiv %OutDir%\i386\system32\setupreg.hiv > NUL del setupreg.hiv > NUL :continue4 :: ---------------------------------------------- :: STEP 4: Create InfCache for faster startup :: ---------------------------------------------- echo. echo STEP 4: Create InfCache for faster startup IF NOT EXIST "%PEUtilsPath%\infcachebuild.exe" GOTO continue5 echo building InfCache start /wait %PEUtilsPath%\infcachebuild.exe %OutDir% IF EXIST "%OutDir%\i386\inf\INFCACHE.1" GOTO continue5 :: Since InfCache does not work under Win2k, I simply compiled :: my drivercache at home and copied it to the subdir InfCache (Subfolder of %PEUtilsPath%) :: And if no InfCache.1 was made, then I copy the to outdir\i386\inf ;-) copy %PEUtilsPath%\InfCache\infcache.1 %OutDir%\i386\inf > NUL copy %PEUtilsPath%\InfCache\*.pnf %OutDir%\i386\inf > NUL :continue5 :: ---------------------------------------------- :: STEP5: Generate Shortcuts for XPE :: ---------------------------------------------- echo. echo STEP 5: Generate Shortcuts for XPE IF NOT EXIST "%OutDir%\I386\system32\xpeinit.exe" GOTO last_step IF NOT EXIST "%PEUtilsPath%\GenShortcuts.exe" GOTO continue5b echo XPE found - Generating Shortcuts... %PEUtilsPath%\GenShortcuts.exe %OutDir% ren "%OutDir%\documents and settings" FastLinks :continue5b copy %OutDir%\PROGRAMS\Nu2Menu\nu2menu.xml > NUL %OutDir%\i386\system32\nu2parser.exe --force> output.mnu %PEUtilsPath%\mnu2lnk.exe output.mnu=%OutDir%\FastLinks ::del output.mnu ::del nu2menu.xml ren "%OutDir%\FastLinks\PROGRAMS" NU2-Programs ren "%OutDir%\FastLinks\SYSTEM" NU2-System :last_step :: ---------------------------------------------- :: LAST STEP : Create ISO :: ---------------------------------------------- echo. echo LAST STEP: Create ISO... echo. IF NOT EXIST %PEUtilsPath%\mkisofs.exe GOTO all_done IF NOT EXIST %PEUtilsPath%\cygwin1.dll GOTO all_done set mkisofs_option=-iso-level 4 -volid ""BartPE"" -A PEBUILDER/MKISOFS -sysid ""Win32"" -no-emul-boot -boot-load-size 4 -hide boot.catalog -allow-lowercase echo using mkisofs.exe version: %PEUtilsPath%\mkisofs -version echo. echo MKISOFS-options: echo %mkisofs_option% echo. :: Get local CodePage set CodePage=HKLM\SYSTEM\CurrentControlSet\Control\Nls\CodePage FOR /F "tokens=1-2*" %%a IN ('reg query "%CodePage%" /v "OEMCP"') DO (set OEMCP=cp%%c) :: Get list of supported codepages from mkisofs.exe %PEUtilsPath%\mkisofs -output-charset -help 2>%temp%.\cp_list.txt FOR /f "delims=* skip=2" %%a IN (%temp%.\cp_list.txt) DO (if %OEMCP%==%%a SET OutputCharset=-output-charset %OEMCP%) IF "%OutputCharset%"=="" GOTO BCDW-Check echo System Codepage '%OEMCP%' is supported by mkisofs.exe echo adding Parameter '%OutputCharset%' to the MKISOFS-options SET mkisofs_option=%mkisofs_option% %OutputCharset% :BCDW-Check echo Checking if BCDW is enabled ... IF NOT EXIST "%OutDir%\BCDW\bcdwboot.bin" GOTO normal_cd echo BCDW found - Start making enhanced CD (BCDW) ... %PEUtilsPath%\mkisofs.exe %mkisofs_option% -b BCDW/bcdwboot.bin -hide BCDW/bcdwboot.bin -o "%ISOFile%" "%OutDir%" goto ISO_check :normal_cd echo no BCDW found - Start making normal CD ... %PEUtilsPath%\mkisofs %mkisofs_option% -b BOOTSECT.BIN -hide BOOTSECT.BIN -o "%ISOFile%" "%OutDir%" goto ISO_check :ISO_check If NOT EXIST %ISOFile% GOTO all_done echo ISO succesfully created echo All Steps finished :all_done SET PEUtilsPath= SET OutDir= SET ISOFile= |
|
|
|
Apr 10 2004, 09:51 AM
Post
#3
|
|
|
Silver Member ![]() ![]() ![]() Group: Members Posts: 144 Joined: 17-July 03 Member No.: 1,096 |
@cyrano
You can use Bart's version of mkisofs if you use the -allow-lowercase option with mkisofs command. Aside from this, I've never been able to use '-iso-level 4' with precompiled versions of cygwin and mkisofs found on the web. I always get an error regarding the level... |
|
|
|
Apr 10 2004, 10:08 AM
Post
#4
|
|
|
Gold Member ![]() ![]() ![]() ![]() Group: Members Posts: 548 Joined: 22-December 03 Member No.: 3,201 |
@ Ixel:
Mhmm. I never had problems with my commandline. Try it! And for the allow-lower-case: look here. Bart itself describes in this post that he patched mkisofs to perform an uppercasing always |
|
|
|
Apr 13 2004, 05:37 AM
Post
#5
|
|
|
Platinum Member ![]() ![]() ![]() ![]() ![]() Group: Moderator Posts: 3,257 Joined: 31-October 03 Member No.: 2,304 |
@cyrano
Your version works. I like '-output-charset cp%OEMCP%' best Some minor suggestion: change "echo ." to "echo."; remove space. change location of my_additional_commands.bat: pebuilder.inf: exec=".\PEUtils\my_additional_commands.cmd "@IsoFile@" "@OutDir@" " my_additional_commands.cmd: SET PEUtilsPath=%3 IF "%PEUtilsPath%"=="" SET PEUtilsPath=%~dp0. XP SP2RC1 don't boot at first: File missing: "\i386\system32\ntoskrnl.exe". Maybe this relates to my hardware or a unspeakable plugin. I added this file and uppercased it, BartPE boots now. @Ixel Cdrtools-2.01a16 supports ISO9660:1999 boot CD. Which 'mkisofs -version' did you tried? |
|
|
|
| Former_webcrawlr_post |
Apr 13 2004, 11:12 AM
Post
#6
|
|
Guests |
Works great and I get no errors. But at the end I end up with a 34k .iso file instead of a 150-200meg file. Any suggestions?
Here's the log file: Log File |
|
|
|
Apr 13 2004, 02:15 PM
Post
#7
|
|
|
Member ![]() ![]() Group: Members Posts: 37 Joined: 11-April 04 Member No.: 5,258 |
GREAT PROJECT!!!!
Suggestions: Add NU2Parser plugin to requirements AND a link to the plugin website... A note that an additional file (setx.exe) is required by the NU2Parser plugin... |
|
|
|
Apr 13 2004, 05:19 PM
Post
#8
|
|
|
Gold Member ![]() ![]() ![]() ![]() Group: Members Posts: 548 Joined: 22-December 03 Member No.: 3,201 |
hi @ all !
sorry 'bout being so unresponsefull to all your answers - but my real life is taking over at the moment. Too much work at my company But I will update my script later - I promise ! @webcrawlr: Seems mkisofs.exe is missing. in my log files, the last lines look like this: QUOTE LAST STEP:
Create ISO... . using mkisofs.exe version: mkisofs 2.01a27 (i686-pc-cygwin) MKISOFS-options: -iso-level 4 -volid ""BartPE"" -A PEBUILDER/MKISOFS -sysid ""Win32"" -no-emul-boot -boot-load-size 4 -hide boot.catalog -allow-lowercase -output-charset cp850 Checking if BCDW is enabled ... no BCDW found - Start making normal CD ... Warning: creating filesystem that does not conform to ISO-9660. Warning: Creating ISO-9660:1999 (version 2) filesystem. Warning: ISO-9660 filenames longer than 31 may cause buffer overflows in the OS. Size of boot image is 4 sectors -> No emulation 2.83% done, estimate finish Tue Apr 13 01:28:09 2004 5.66% done, estimate finish Tue Apr 13 01:28:27 2004 8.48% done, estimate finish Tue Apr 13 01:27:57 2004 11.31% done, estimate finish Tue Apr 13 01:28:09 2004 14.14% done, estimate finish Tue Apr 13 01:28:16 2004 16.97% done, estimate finish Tue Apr 13 01:28:27 2004 19.79% done, estimate finish Tue Apr 13 01:28:29 2004 22.62% done, estimate finish Tue Apr 13 01:28:31 2004 25.44% done, estimate finish Tue Apr 13 01:28:33 2004 28.28% done, estimate finish Tue Apr 13 01:28:30 2004 31.10% done, estimate finish Tue Apr 13 01:28:29 2004 33.93% done, estimate finish Tue Apr 13 01:28:27 2004 36.75% done, estimate finish Tue Apr 13 01:28:26 2004 39.58% done, estimate finish Tue Apr 13 01:28:27 2004 42.41% done, estimate finish Tue Apr 13 01:28:26 2004 45.23% done, estimate finish Tue Apr 13 01:28:27 2004 48.06% done, estimate finish Tue Apr 13 01:28:30 2004 50.89% done, estimate finish Tue Apr 13 01:28:29 2004 53.72% done, estimate finish Tue Apr 13 01:28:32 2004 56.54% done, estimate finish Tue Apr 13 01:28:32 2004 59.37% done, estimate finish Tue Apr 13 01:28:33 2004 62.19% done, estimate finish Tue Apr 13 01:28:32 2004 65.02% done, estimate finish Tue Apr 13 01:28:31 2004 67.85% done, estimate finish Tue Apr 13 01:28:31 2004 70.67% done, estimate finish Tue Apr 13 01:28:32 2004 73.50% done, estimate finish Tue Apr 13 01:28:31 2004 76.33% done, estimate finish Tue Apr 13 01:28:32 2004 79.15% done, estimate finish Tue Apr 13 01:28:29 2004 81.99% done, estimate finish Tue Apr 13 01:28:30 2004 84.81% done, estimate finish Tue Apr 13 01:28:29 2004 87.63% done, estimate finish Tue Apr 13 01:28:28 2004 90.46% done, estimate finish Tue Apr 13 01:28:28 2004 93.29% done, estimate finish Tue Apr 13 01:28:29 2004 96.12% done, estimate finish Tue Apr 13 01:28:28 2004 98.94% done, estimate finish Tue Apr 13 01:28:28 2004 Total translation table size: 2048 Total rockridge attributes bytes: 0 Total directory bytes: 315800 Path table size(bytes): 2644 Max brk space used 1ab000 176875 extents written (345 MB) ISO created All Steps finished Build process done... |
|
|
|
Apr 14 2004, 08:16 AM
Post
#9
|
|
|
Silver Member ![]() ![]() ![]() Group: Members Posts: 206 Joined: 13-January 04 Member No.: 3,538 |
i followed ur instruction but after this:
CODE LAST STEP: Create ISO... . using mkisofs.exe version: MKISOFS-options: -iso-level 4 -volid ""BartPE"" -A PEBUILDER/MKISOFS -sysid ""Win32"" -no-emul-boot -boot-load-size 4 -hide boot.catalog -allow-lowercase -output-charset cp1258 Checking if BCDW is enabled ... no BCDW found - Start making normal CD ... ISO created All Steps finished Build process done... no .iso file was created, what's wrong? |
|
|
|
Apr 14 2004, 08:46 AM
Post
#10
|
|
|
Member ![]() ![]() Group: Members Posts: 37 Joined: 11-April 04 Member No.: 5,258 |
@bachikho:
It appears as if it WAS created, however it must not be where you expected to find it.... Do a file search for it.... |
|
|
|
Apr 14 2004, 09:30 AM
Post
#11
|
|
|
Gold Member ![]() ![]() ![]() ![]() Group: Members Posts: 548 Joined: 22-December 03 Member No.: 3,201 |
QUOTE %PEUtilsPath%\mkisofs.exe look at the line above... 'mkisofs.exe' must be in the PEUtils-Folder ! It seems you guys did put it in the wrong place. Because if mkisofs.exe is found, you should have it's version written in the log file. I did put mkisofs.exe in the PEUtils folder because I wanted to keep the patched version (Barts version) on the original place. |
|
|
|
Apr 14 2004, 10:08 AM
Post
#12
|
|
|
Silver Member ![]() ![]() ![]() Group: Members Posts: 206 Joined: 13-January 04 Member No.: 3,538 |
my mkisofs.exe DID be in the PEUtils-Folder, what's wrong?
|
|
|
|
Apr 14 2004, 10:26 AM
Post
#13
|
|
|
Gold Member ![]() ![]() ![]() ![]() Group: Members Posts: 548 Joined: 22-December 03 Member No.: 3,201 |
go to a command prompt in your PEUtils dir, then type
QUOTE mkisofs -version what does this give ? |
|
|
|
| Former_webcrawlr_post |
Apr 14 2004, 10:32 AM
Post
#14
|
|
Guests |
Will I need to copy the cygwin1.dll in to the PEUtils folder as well? It seems to be asking for it if I try to run mkisofs.exe from a cmd window.
|
|
|
|
| Former_webcrawlr_post |
Apr 14 2004, 10:38 AM
Post
#15
|
|
Guests |
QUOTE (webcrawlr @ Apr 14 2004, 03:32 PM) Will I need to copy the cygwin1.dll in to the PEUtils folder as well? It seems to be asking for it if I try to run mkisofs.exe from a cmd window. I also noticed that if I copy that file in I get an error about a dll entry point. |
|
|
|
Apr 14 2004, 10:38 AM
Post
#16
|
|
|
Gold Member ![]() ![]() ![]() ![]() Group: Members Posts: 548 Joined: 22-December 03 Member No.: 3,201 |
yes, you need it.
And I think it would be better to take the corresponding cygwin.dll. That means: If you take Barts version of mkisofs, than use his version of cygwin too. |
|
|
|
| Former_webcrawlr_post |
Apr 14 2004, 10:48 AM
Post
#17
|
|
Guests |
QUOTE (cyrano @ Apr 14 2004, 03:38 PM) yes, you need it. And I think it would be better to take the corresponding cygwin.dll. That means: If you take Barts version of mkisofs, than use his version of cygwin too. Gotcha. And if I'd like to use the version of mkisofs.exe included in your link, where can I find the corresponding cygwin1.dll? |
|
|
|
| Former_webcrawlr_post |
Apr 14 2004, 10:50 AM
Post
#18
|
|
Guests |
QUOTE (webcrawlr @ Apr 14 2004, 03:48 PM) QUOTE (cyrano @ Apr 14 2004, 03:38 PM) yes, you need it. And I think it would be better to take the corresponding cygwin.dll. That means: If you take Barts version of mkisofs, than use his version of cygwin too. Gotcha. And if I'd like to use the version of mkisofs.exe included in your link, where can I find the corresponding cygwin1.dll? On the same link... LOL. The latest version is 1.5.9-1, is that correct? |
|
|
|
Apr 14 2004, 10:53 AM
Post
#19
|
|
|
Gold Member ![]() ![]() ![]() ![]() Group: Members Posts: 548 Joined: 22-December 03 Member No.: 3,201 |
yep !
Glad I could help you ! best regards cyrano |
|
|
|
Apr 14 2004, 11:30 AM
Post
#20
|
|
|
Silver Member ![]() ![]() ![]() Group: Members Posts: 206 Joined: 13-January 04 Member No.: 3,538 |
QUOTE (cyrano @ Apr 14 2004, 03:26 PM) go to a command prompt in your PEUtils dir, then type QUOTE mkisofs -version what does this give ? CODE LAST STEP:
Create ISO... . using mkisofs.exe version: mkisofs 2.01a27 (i686-pc-cygwin) MKISOFS-options: -iso-level 4 -volid ""BartPE"" -A PEBUILDER/MKISOFS -sysid ""Win32"" -no-emul-boot -boot-load-size 4 -hide boot.catalog -allow-lowercase -output-charset cp1258 Checking if BCDW is enabled ... no BCDW found - Start making normal CD ... Warning: creating filesystem that does not conform to ISO-9660. Warning: Creating ISO-9660:1999 (version 2) filesystem. Warning: ISO-9660 filenames longer than 31 may cause buffer overflows in the OS. Unknown charset Known charsets are: cp10081 cp10079 cp10029 cp10007 cp10006 cp10000 koi8-u koi8-r cp1251 cp1250 cp874 cp869 cp866 cp865 cp864 cp863 cp862 cp861 cp860 cp857 cp855 cp852 cp850 cp775 cp737 cp437 iso8859-15 iso8859-14 iso8859-9 iso8859-8 iso8859-7 iso8859-6 iso8859-5 iso8859-4 iso8859-3 iso8859-2 iso8859-1 ISO created All Steps finished Build process done... |
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 2nd September 2010 - 04:16 PM |