Jump to content











Photo
- - - - -

IF EXIST or FIND with folder names instead of file names?


  • Please log in to reply
56 replies to this topic

#1 tefole

tefole

    Member

  • Members
  • 49 posts
  • Location:Heidelberg
  •  
    Germany

Posted 13 December 2011 - 07:28 PM

I was just wondering, if i am doing something wrong or if the commands if exist and find are really not working with folder names?

background:
With the great effort of Steve6375 and Chenall, now we are able to make dynamically titles (iftitle).
I want to hide the submenu entry in the main.kst completely, if the a specific directory isnt on the root.
Below i am gonna post the mentioned part of the menu files, and how i solved this issue with the dummy files.
I would prefer to do that without this annoying dummy files.


[menu.lst]



iftitle [find --set-root /boot/Images/Live/dummy] Live Systems

configfile /boot/grub/menu_live.lst



iftitle [find --set-root /boot/Images/AntiVir/dummy] AntiVirus / RescueSystems

configfile /boot/grub/menu_AntiVir.lst



iftitle [find --set-root /boot/Images/Tools/dummy] Tools

configfile /boot/grub/menu_tools.lst



title Windows Installation

configfile /boot/grub/menu_win.lst



[menu_live.lst]

iftitle [find --set-root /boot/Images/Live/kolibri.iso] KolibriOS 0.7.7.0

find --set-root /boot/Images/Live/kolibri.iso

map /boot/Images/Live/kolibri.iso (0xff) || map --mem /boot/Images/Live/kolibri.iso (0xff)

map --hook

chainloader (0xff)


#2 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 13 December 2011 - 07:32 PM

find --set-root does not work in that it does not set the root. Just use find (file) and then use find --set-root (file) in the command list.
Can you post the menu that does not work...

#3 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 13 December 2011 - 07:43 PM

OK - I just tried it and it does not work unless you rename the menu file and remove the underscore! I have reported the issue.

#4 tefole

tefole

    Member

  • Members
  • 49 posts
  • Location:Heidelberg
  •  
    Germany

Posted 13 December 2011 - 08:33 PM

You again steve :)
Let me try to clarify if we are really talking about the same thing.

Actually everything is working fine. Honestly i had no problems with the underscore.
Probably you found another bug; good for us :)

Whats working:

iftitle [find --set-root /boot/Images/Live/dummy] Live Systems

configfile /boot/grub/menu_live.lstWhats not working:

Whats not working:

iftitle [find --set-root /boot/Images/Live/] Live Systems

configfile /boot/grub/menu_live.lst

the Difference:
The working example is with a file name, the non-working is with a folder name.
I tried this as well with iftitle[if exist ....]. Same result.
It seems, that u are not able to look for a folder with find or if exist.

workaround:
i put in every folder a 0-byte dummyfile and used this as a trigger

#5 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 13 December 2011 - 09:26 PM

The commands look for a file. A folder is not a file. I don't understand why you would want to look for a folder and then load a menu from a different folder anyway...???

#6 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 13 December 2011 - 10:44 PM

tefole

Could you explain, what exact functionality was added to Grub4DOS? From your 1-st post it looks like one may have several Menu.lst files, and choose one of them depending on whether a dummy file is present in the folder with that Menu file. I don't get it, how its more convenient? One would have to write a dummy file - instead its faster to drop required Menu.lst file to root...

I was thinking, dynamic titles would work for a different purpose ( or may be several different scenarios):

- if a file (like ISO) is not found, its title won't be shown in on-screen Menu
OR
- if a certain Menu.lst (like Menu_Tools.lst) is not present in root or Menu folder, its entries won't be shown in common (for several Menu.lst files) on-screen Menu

#7 tefole

tefole

    Member

  • Members
  • 49 posts
  • Location:Heidelberg
  •  
    Germany

Posted 14 December 2011 - 04:49 AM

The commands look for a file. A folder is not a file. I don't understand why you would want to look for a folder and then load a menu from a different folder anyway...???

Right, that's an answer. File or If exist are only working with files.

Sometimes a collegue ask me for an livesystem bootable from flashdisk.
He dont needs all the other stuff and probably he dont have the licences for that.
In this case, i would just copy all the essential files + the one folder /boot/Images/Live
In the main menu, no other menu wont showed up.
Or if a friend needs a flashdisk for reinstall win7 on his netbook.
Same procedure like above, just copying of /root/Images/Win7 folder.
No editing of any *.lst files. Sounds strange, but saves times and avoids mistakes.
As professional PLC engineer, i am beautification maniac :)

@Sambul,
Your thinking and understanding of dynamical titles are clear.
In sounds easier to consider and copy the right submenu.lst on each copy thread than overheading folders with dummy files, BUT:
If i dont, it would mean at least an additional step on each copy process ("hmm, what i copied right now to flashdisk, which submenu.lst i nead??")
With my dummyfiles-method, i have the same basic files (grubfiles, win7_bcd's, etc..) on every flashdisk. The only difference are amount
of folder under /boot/Images/ and probably the amount of ISOs in this folders (e.g. /boot/Images/Tools).
I could just copy the submenu.lst files to the corresponding places (e.g. menu_tools.lst to /root/Images/Tools), but thats against my beautication ideals :)
Maybe its confusing, maybe i am cheating myself, but i am still thinking that its still making my life easier ;)

#8 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 14 December 2011 - 10:15 AM

If he doesn't add the licence then why do you give him the files?

tip: if you add

write 0x8274 0x2001

to the start of your menu.lst file, then the latest chenall version of grub4dos will autonumber the menu entries for you!

Various options are:
#autonumber boot entries with a space

write 0x8274 0x2001



#autonumber boot entries with a hyphen

write 0x8274 0x2d01



# autonumber all entries (even non-bootable ones)

write 0x8274 0x20ff


#9 chenall

chenall

    Member

  • Members
  • 60 posts
  •  
    China

Posted 14 December 2011 - 12:35 PM

You again steve :)
Let me try to clarify if we are really talking about the same thing.

Actually everything is working fine. Honestly i had no problems with the underscore.
Probably you found another bug; good for us :)

Whats working:


iftitle [find --set-root /boot/Images/Live/dummy] Live Systems

configfile /boot/grub/menu_live.lstWhats not working:

Whats not working:

iftitle [find --set-root /boot/Images/Live/] Live Systems

configfile /boot/grub/menu_live.lst

the Difference:
The working example is with a file name, the non-working is with a folder name.
I tried this as well with iftitle[if exist ....]. Same result.
It seems, that u are not able to look for a folder with find or if exist.

workaround:
i put in every folder a 0-byte dummyfile and used this as a trigger


Can use like this.
iftitle [find --set-root --devices=h /bootmgr && call set bootmgr=%@root^%] load BOOTMGR of Windows VISTA/WIN7/WIN2008 on %bootmgr%

chainloader %bootmgr%/bootmgr
  • laddanator likes this

#10 chenall

chenall

    Member

  • Members
  • 60 posts
  •  
    China

Posted 14 December 2011 - 12:38 PM

@tefole
try use "ls"

iftitle [ls /boot/Images/Live] LiveSystems

#11 tefole

tefole

    Member

  • Members
  • 49 posts
  • Location:Heidelberg
  •  
    Germany

Posted 14 December 2011 - 02:55 PM

try use "ls"

Thanks for that great idea. Working like a charm. Finally i can get rid of my dummy dummyfiles. :)

tip: if you add

write 0x8274 0x2001

Even as a frequently visitor of chenall's blog (thanks to translator@google) i never heard about that.
Thanks for the hint. Dont hestitate to share all of them :)

If he doesn't add the licence then why do you give him the files?

This quesiton isnt fair dude. I never said that. Why do you think, it was worth to spent all the time (especially/mainly yours) into iftitle?
Its not only because of the different sizes of the flashdisks. Its a great addition and amazing tool, to save time.
Are you not sharing your work with your friends?

Not everybody, has every license for all this stuff. You guys helping me to avoid get headaches from nasty friends.
Even the not so smart ones, had figured out, how to use livexp, xp installation (+driverpack&up2date), tools like redobackup and so on.
Same thing for the win7 group.
I mean, its clear that not everyone have not every license. Thatswhy i consider this by copying the right files/folders to the target disk.
And again: we can just keep our all our *.lst files untouched and just consider the right files, respective the right folders.
Thats pretty easy and avoid mistakes.

Edited by tefole, 14 December 2011 - 03:02 PM.


#12 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 14 December 2011 - 03:04 PM

Now with all suggestions processed, can you give a clear code example of using this feature, and explaining what it can be used for? :thumbsup:

#13 tefole

tefole

    Member

  • Members
  • 49 posts
  • Location:Heidelberg
  •  
    Germany

Posted 16 December 2011 - 04:52 AM

Sure. I updated and tested the last two days my menu-files.
Usually I prepare my target flashdisk/harddisk per fbinst.
You can put all the grub/boot-files onto the hidden primary partition of fbinst. They wont shown on the flashdisk.
On the root of the flashdisk there is just one folder and 3 files.


I am saying it again, as efficiency and beautifaction maniac, your suggestions will be appreciated :)

menu.lst



###credits goes to boot-land.net & msfn

###I wish a long life to chenall, tinybit, jaclaz, nino, diddy, bean, cdob,

###					  wonko, steve & all the other non-mentioned guys



#find --set-root ../../40YA

gfxmenu /boot/grub/40ya_gfx

#splashimage /boot/grub/bg.gz

foreground = ffffff

background = DF8418



timeout 99

default 5



###if the regarding folder is not on the root, disable menu

iftitle [ls /boot/Images/AntiVir] AntiVirus / RescueSystems

configfile /boot/grub/menu_AntiVir.lst



###if none of the both folders WinXP or Win7 are present, disable menu

iftitle [ls /boot/Images/WinXP || ls /boot/Images/Win7] Windows Installation

configfile /boot/grub/menu_win.lst



iftitle [ls /boot/Images/Live] Live Systems

configfile /boot/grub/menu_live.lst



iftitle [ls /boot/Images/Tools] Tools

configfile /boot/grub/menu_tools.lst



###placeholder

title

root



title Boot from Harddisk

checkrange 0x80 read 0x8280 && map () (hd1)

checkrange 0x80 read 0x8280 && map (hd1) ()

checkrange 0x80 read 0x8280 && map --hook

rootnoverify (hd0,0)

chainloader +1 || chainloader /ntldr



title Command Line

commandline



title ShutDown\n ShutDown System

halt



title Reboot\n Reboot

reboot

menu_antivir



#gfxmenu /boot/grub/40ya_gfx



iftitle [if exist /boot/Images/AntiVir/MSSS_Media32.iso && set MSSS32=/boot/Images/AntiVir/MSSS_Media32.iso] Microsoft AV Sweeper for 32-bit Windows\n%MSSS32%

find --set-root %MSSS32%

map %MSSS32% (0xff) || map --mem %MSSS32% (0xff)

map --hook

chainloader (0xff)



iftitle [if exist /boot/Images/AntiVir/MSSS_Media64.iso && set MSSS64=/boot/Images/AntiVir/MSSS_Media64.iso] Microsoft AV Sweeper for 64-bit Windows\n%MSSS64%

find --set-root %MSSS64%

map %MSSS64% (0xff) || map --mem %MSSS64% (0xff)

map --hook

chainloader (0xff)



iftitle [if exist /boot/Images/AntiVir/AVG.iso && set AVGISO=/boot/Images/AntiVir/AVG.iso] AVG Rescue CD v9 29.04.2010\n%AVGISO%

find --set-root %AVGISO%

map %AVGISO% (hd32)

map --hook

root (hd32)

chainloader (hd32)



iftitle [if exist --set-root /boot/Images/AntiVir/avast_bartCD_2009.iso.gz && set AVAST=/boot/Images/AntiVir/avast_bartCD_2009.iso.gz] Avast BartCD v2009\n%AVAST%

map %AVAST% (0xff) || map --mem %AVAST% (0xff)

map --hook

root (0xff)

chainloader (0xff)



iftitle [if exist /boot/Images/AntiVir/Avira.iso.gz && set AVIRA=/boot/Images/AntiVir/Avira.iso.gz] Avira\n%AVIRA%

find --set-root --ignore-floppies %AVIRA%

map --mem %AVIRA% (hd32)

map --hook

root (hd32)

kernel /vmlinuz vga=791 initrd=initrd.gz ramdisk_size=99889 root=/dev/ram0 rw console=/dev/vc/4

initrd /initrd.gz



iftitle [if exist /boot/Images/AntiVir/Eset.iso && set ESET=/boot/Images/AntiVir/Eset.iso] ESET NOD32 SysRescue (4.0.474) German\n%ESET%

map %ESET% (hd32)

map --hook

chainloader (hd32)/BOOTMGR

rootnoverify (hd32)



iftitle [if exist /rescue/rescueusb.iso && set KAV=/rescue/rescueusb.iso] KAV Rescue 2011\n%KAV%

find --set-root --ignore-floppies %KAV%

map %KAV% (0xff) || map --mem %KAV% (0xff)

map --hook

root (0xff)

chainloader (0xff)



title Main Menu

configfile /boot/grub/menu.lst

menu_live.lst



#gfxmenu /boot/grub/40ya_gfx



iftitle [if exist /boot/Images/Live/cc7pe.wim] Win7 cc7PE

###Map w7boot into Mem for LivePatching

map --mem /w7boot (rd)

### Patch CRC Check w7boot

write --offset=0xE28 (rd)+1 \xEB\x08

### write unicode \boot\

write --offset=0x54B5C (rd)+1 \\\x00b\x00o\x00o\x00t\x00\\\x00c\x00c\x007\x00

chainloader (rd)+1

root ()



iftitle [if exist /boot/Images/Live/Ubuntu_i386.iso && set Ubuntu=/boot/Images/Live/Ubuntu_i386.iso] Ubuntu 11.10 Desktop \n%Ubuntu%

find --set-root %Ubuntu%

map %Ubuntu% (hd32)

map --hook

root (hd32)

kernel /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=%Ubuntu% quiet splash --

initrd /casper/initrd.lz



iftitle [if exist /boot/Images/Live/kolibri.iso && set Kolibri=/boot/Images/Live/kolibri.iso] KolibriOS 0.7.7.0\n%Kolibri%

find --set-root %Kolibri%

map %Kolibri% (0xff) || map --mem %Kolibri% (0xff)

map --hook

chainloader (0xff)



title Main Menu

configfile /boot/grub/menu.lst

menu_win.lst
#gfxmenu /boot/grub/40ya_gfx



iftitle [ls /boot/Images/Win7] Windows 7 Installation

configfile /boot/grub/menu_win7.lst



iftitle [ls /boot/Images/WinXP] Windows XP Installation

configfile /boot/grub/menu_xp.lst



title Main Menu

configfile /boot/grub/menu.lst

menu_winxp.lst
#gfxmenu /boot/grub/40ya_gfx



#########################################################################

iftitle [if exist /boot/Images/WinXP/XP_ALL_Ger.iso && set XPALLGER=/boot/Images/WinXP/XP_ALL_Ger.iso] WinXP ProSP3 Ger Up2Date & nlited + Drive\n%XPALLGER%

set Fira=/boot/Images/Floppy/FiraFloppy.IMA.gz

map --mem %Fira% (fd0)

map --mem %Fira% (fd1)

map --mem %XPALLGER% (0xFF)

checkrange 0x80 read 0x8280 && map (hd0) (hd1)

checkrange 0x80 read 0x8280 && map (hd1) (hd0)

###if start from HDD-device, than remaping hd0<->hd1

map --hook

write --offset=0 (fd0)/setup/ISOimage.ini \\boot\\Images\\WinXP\\XP_ALL_Ger.iso\n;\n;\n;

write --offset=0 (fd1)/setup/ISOimage.ini \\boot\\Images\\WinXP\\XP_ALL_Ger.iso\n;\n;\n;

write --offset=1782 (fd0)/TXTSETUP.OEM dll = setup, fixBoot.USB\r\n;

write --offset=1782 (fd1)/TXTSETUP.OEM dll = setup, fixBoot.USB\r\n;

###Copy Winnt.sif

dd if=(0xFF)/OS/XPLD/I386/WINNT.SIF of=(fd0)/WINNT.SIF

dd if=(0xFF)/OS/XPLD/I386/WINNT.SIF of=(fd1)/WINNT.SIF

###Begin HexEditing (Map SetupLDR.bin to Ramdrive)

map --mem (0xFF)/XPLD/setupldr.bin (rd)

cat --locate=i386 --replace=XPLD (rd)+1

rootnoverify (0xff)

chainloader (rd)+1



#########################################################################

iftitle [if exist /boot/Images/WinXP/XP_ALL_Ger.iso && set XPALLGER=/boot/Images/WinXP/XP_ALL_Ger.iso] WinXP ProSP3 Ger Up2Date & nlited \n%XPALLGER%

set Fira=/boot/Images/Floppy/FiraFloppy.IMA.gz

map --mem %Fira% (fd0)

map --mem %Fira% (fd1)

map --mem %XPALLGER% (0xFF)

checkrange 0x80 read 0x8280 && map (hd0) (hd1)

checkrange 0x80 read 0x8280 && map (hd1) (hd0)

###if start from HDD-device, than remaping hd0<->hd1

map --hook

write --offset=0 (fd0)/setup/ISOimage.ini \\boot\\Images\\WinXP\\XP_ALL_Ger.iso\n;\n;\n;

write --offset=0 (fd1)/setup/ISOimage.ini \\boot\\Images\\WinXP\\XP_ALL_Ger.iso\n;\n;\n;

write --offset=1782 (fd0)/TXTSETUP.OEM dll = setup, fixBoot.USB\r\n;

write --offset=1782 (fd1)/TXTSETUP.OEM dll = setup, fixBoot.USB\r\n;

###Copy Winnt.sif

dd if=(0xFF)/OS/XPLU/I386/WINNT.SIF of=(fd0)/WINNT.SIF

dd if=(0xFF)/OS/XPLU/I386/WINNT.SIF of=(fd1)/WINNT.SIF

###Begin HexEditing (Map SetupLDR.bin to Ramdrive)

map --mem (0xFF)/XPST/setupldr.BIN (rd)

cat --locate=i386 --replace=XPLU (rd)+1

rootnoverify (0xff)

chainloader (rd)+1



#########################################################################

iftitle [if exist /boot/Images/WinXP/XP_Ultra_Ger.iso && set XPULTGER=/boot/Images/WinXP/XP_Ultra_Ger.iso] WinXP ProSP3 Ger Up2Date & nlited/LowRAM + Driver \n%XPULTGER%

set Fira=/boot/Images/Floppy/FiraFloppy.IMA.gz

map --mem %Fira% (fd0)

map --mem %Fira% (fd1)

map --mem %XPULTGER% (0xFE)

checkrange 0x80 read 0x8280 && map (hd0) (hd1)

checkrange 0x80 read 0x8280 && map (hd1) (hd0)

# if start from HDD-device, than remaping hd0<->hd1

map --hook

write --offset=0 (fd0)/setup/ISOimage.ini \\boot\\Images\\WinXP\\XP_Ultra_Ger.iso\n;\n;\n;

write --offset=0 (fd1)/setup/ISOimage.ini \\boot\\Images\\WinXP\\XP_Ultra_Ger.iso\n;\n;\n;

write --offset=1782 (fd0)/TXTSETUP.OEM dll = setup, fixBoot.USB\r\n;

write --offset=1782 (fd1)/TXTSETUP.OEM dll = setup, fixBoot.USB\r\n;

# Copy Winnt.sif

dd if=(0xFE)/I386/WINNT.SIF of=(fd0)/WINNT.SIF

dd if=(0xFE)/I386/WINNT.SIF of=(fd1)/WINNT.SIF

map --unmap=0xFE

#configfile (0xFE)/I386/RAMBOOT.LST

chainloader (0xFE)/I386/SETUPLDR.BIN



#########################################################################

iftitle [if exist /boot/Images/WinXP/XP_ALL_Ger.iso && set XPALLGER=/boot/Images/WinXP/XP_ALL_Ger.iso] WinXP Pro SP3 Standard \n%XPALLGER%

set Fira=/boot/Images/Floppy/FiraFloppy.IMA.gz

map --mem %Fira% (fd0)

map --mem %Fira% (fd1)

map --mem %XPALLGER% (0xFF)

checkrange 0x80 read 0x8280 && map (hd0) (hd1)

checkrange 0x80 read 0x8280 && map (hd1) (hd0)

###if start from HDD-device, than remaping hd0<->hd1

map --hook

write --offset=0 (fd0)/setup/ISOimage.ini \\boot\\Images\\WinXP\\XP_ALL_Ger.iso\n;\n;\n;

write --offset=0 (fd1)/setup/ISOimage.ini \\boot\\Images\\WinXP\\XP_ALL_Ger.iso\n;\n;\n;

write --offset=1782 (fd0)/TXTSETUP.OEM dll = setup, fixBoot.USB\r\n;

write --offset=1782 (fd1)/TXTSETUP.OEM dll = setup, fixBoot.USB\r\n;

###Copy Winnt.sif

dd if=(0xFF)/OS/XPST/I386/WINNT.SIF of=(fd0)/WINNT.SIF

dd if=(0xFF)/OS/XPST/I386/WINNT.SIF of=(fd1)/WINNT.SIF

###Begin HexEditing (Map SetupLDR.bin to Ramdrive)

map --mem (0xFF)/XPST/setupldr.BIN (rd)

cat --locate=i386 --replace=XPST (rd)+1

rootnoverify (0xff)

chainloader (rd)+1







#########################################################################

#########################################################################







iftitle [if exist /boot/Images/WinXP/XP_ALL_En.iso && set XPALLEN=/boot/Images/WinXP/XP_ALL_En.iso] WinXP ProSP3 Up2Date ENG & nlited + Driver \n%XPALLEN%

set Fira=/boot/Images/Floppy/FiraFloppy.IMA.gz

map --mem %Fira% (fd0)

map --mem %Fira% (fd1)

map --mem %XPALLEN% (0xFF)

checkrange 0x80 read 0x8280 && map (hd0) (hd1)

checkrange 0x80 read 0x8280 && map (hd1) (hd0)

###if start from HDD-device, than remaping hd0<->hd1

map --hook

write --offset=0 (fd0)/setup/ISOimage.ini \\boot\\Images\\WinXP\\XP_ALL_En.iso\n;\n;\n;

write --offset=0 (fd1)/setup/ISOimage.ini \\boot\\Images\\WinXP\\XP_ALL_En.iso\n;\n;\n;

write --offset=1782 (fd0)/TXTSETUP.OEM dll = setup, fixBoot.USB\r\n;

write --offset=1782 (fd1)/TXTSETUP.OEM dll = setup, fixBoot.USB\r\n;

###Copy Winnt.sif

dd if=(0xFF)/OS/XPED/I386/WINNT.SIF of=(fd0)/WINNT.SIF

dd if=(0xFF)/OS/XPED/I386/WINNT.SIF of=(fd1)/WINNT.SIF

###Begin HexEditing (Map SetupLDR.bin to Ramdrive)

map --mem (0xFF)/XPED/SETUPLDR.BIN (rd)

cat --locate=i386 --replace=XPED (rd)+1

rootnoverify (0xff)

chainloader (rd)+1



#########################################################################

iftitle [if exist /boot/Images/WinXP/XP_ALL_En.iso && set XPALLEN=/boot/Images/WinXP/XP_ALL_En.iso] WinXP ProSP3 Up2Date ENG & nlited \n%XPALLEN%

set Fira=/boot/Images/Floppy/FiraFloppy.IMA.gz

map --mem %Fira% (fd0)

map --mem %Fira% (fd1)

map --mem %XPALLEN% (0xFF)

checkrange 0x80 read 0x8280 && map (hd0) (hd1)

checkrange 0x80 read 0x8280 && map (hd1) (hd0)

###if start from HDD-device, than remaping hd0<->hd1

map --hook

write --offset=0 (fd0)/setup/ISOimage.ini \\boot\\Images\\WinXP\\XP_ALL_En.iso\n;\n;\n;

write --offset=0 (fd1)/setup/ISOimage.ini \\boot\\Images\\WinXP\\XP_ALL_En.iso\n;\n;\n;

write --offset=1782 (fd0)/TXTSETUP.OEM dll = setup, fixBoot.USB\r\n;

write --offset=1782 (fd1)/TXTSETUP.OEM dll = setup, fixBoot.USB\r\n;

###Copy Winnt.sif

dd if=(0xFF)/OS/XPEN/I386/WINNT.SIF of=(fd0)/WINNT.SIF

dd if=(0xFF)/OS/XPEN/I386/WINNT.SIF of=(fd1)/WINNT.SIF

###Begin HexEditing (Map SetupLDR.bin to Ramdrive)

map --mem (0xFF)/XPEN/SETUPLDR.BIN (rd)

cat --locate=i386 --replace=XPEN (rd)+1

rootnoverify (0xff)

chainloader (rd)+1



title Main Menu

configfile /boot/grub/menu_win.lst

menu_win7.lst
#gfxmenu /boot/grub/40ya_gfx

###the w7boot on the root is the vista sp0 bootmgr



iftitle [if exist /boot/Images/Win7/bx86.wim] Win7 Setup 32Bit

###Map w7boot into Mem for LivePatching

map --mem /w7boot (rd)

###Patch CRC Check w7boot

write --offset=0xE28 (rd)+1 \xEB\x08

###write unicode \bwin\b32

write --offset=0x54B5C (rd)+1 \\\x00b\x00o\x00o\x00t\x00\\\x007\x008\x006\x00

chainloader (rd)+1

root ()



iftitle [if exist /boot/Images/Win7/bx64.wim] Win7 Setup 64Bit

###Map w7boot into Mem for LivePatching

map --mem /w7boot (rd)

###Patch CRC Check w7boot

write --offset=0xE28 (rd)+1 \xEB\x08

###write unicode \bwin\b64

write --offset=0x54B5C (rd)+1 \\\x00b\x00o\x00o\x00t\x00\\\x007\x006\x004\x00

chainloader (rd)+1

root ()



title Main Menu

configfile /boot/grub/menu_win.lst

menu_tools.lst
[/size]#gfxmenu /boot/grub/40ya_gfx

find --set-root --ignore-floppies /boot/Images/Tools/



iftitle [if exist /boot/Images/Tools/Acronis.iso && set ACRONIS=/boot/Images/Tools/Acronis.iso] Acronis Tool Collection\n%ACRONIS%

map %ACRONIS% (0xff) || map --mem %ACRONIS% (0xff)

map --hook

root (0xff)

chainloader (0xff)



iftitle [if exist /boot/Images/Tools/dban.iso && set DBAN=/boot/Images/Tools/dban.iso] dban HDD-Eraser v2.2.6\n%DBAN%

map %DBAN% (0xff) || map --mem %DBAN% (0xff)

map --hook

root (0xff)

chainloader (0xff)



iftitle [if exist /boot/Images/Tools/PLoPBootManager.iso.gz && set PLOP=/boot/Images/Tools/PLoPBootManager.iso.gz] PloP Boot Manager v5.13\n%PLOP%

map --mem %PLOP% (0xff)

map --hook

root (0xff)

chainloader (0xff)



iftitle [if exist /boot/Images/Tools/ProsoftEngineeringMediaToolsPro.iso && set PROSOFT=/boot/Images/Tools/ProsoftEngineeringMediaToolsPro.iso] Prosoft Engineering MediaTools Pro v5.1\n%PROSOFT%

find --set-root --ignore-floppies %PROSOFT%

map %PROSOFT% (0xff) || map --mem %PROSOFT% (0xff)

map --hook

root (0xff)

echo -e \n\nHere is my serial:\nxxxx-xxxx-xxxx-xxxx\nAfter Boot, u'll need them!

echo Press a key to continue

pause

chainloader (0xff)



iftitle [if exist /boot/Images/Tools/memtest86.iso.gz && set MEM=/boot/Images/Tools/memtest86.iso.gz] memtest86 v4.2\n%MEM%

map %MEM% (0xff) || map --mem %MEM% (0xff)

map --hook

root (0xff)

chainloader (0xff)



iftitle [if exist /boot/Images/Tools/konboot.img.gz && set KON=/boot/Images/Tools/konboot.img.gz] Kon-Boot v1.1 (Linux/Windows)\n%KON%

map --mem %KON% (fd0)

map --hook

chainloader (fd0)+1

map (hd1) (hd0) || map (hd0) (hd0)

map --hook

rootnoverify (fd0)



iftitle [if exist /boot/Images/Tools/redobackup.iso && set REDO=/boot/Images/Tools/redobackup.iso] RedoBackup v0.9.9\n%REDO%

find --set-root --ignore-floppies %REDO%

#uuid ()

map --heads=0 --sectors-per-track=0 %REDO% (0xff) || map --mem --heads=0 --sectors-per-track=0 %REDO% (0xff)

map --hook

chainloader (0xff)



iftitle [if exist /boot/Images/Tools/pmagic-6.6.iso && set PARTED=/boot/Images/Tools/pmagic-6.6.iso] Parted Magic v6.6\n%PARTED%

find --set-root %PARTED%

map %PARTED% (hd32) || map --mem %PARTED% (hd32)

map --hook

root (hd32)

kernel /pmagic/bzImage noapic load_ramdisk=1 prompt_ramdisk=0 rw vga=791 sleep=10 loglevel=0 keymap=de iso_filename=%PARTED%

initrd /pmagic/initramfs

map --unmap=0:0xff



iftitle [if exist /boot/Images/Tools/ubcd50rc2.iso && set UBCD=/boot/Images/Tools/ubcd50rc2.iso] UBCD v5 RC2\n%UBCD%

map %UBCD% (0xff) || map --mem %UBCD% (0xff)

map --hook

root (0xff)

chainloader (0xff)



iftitle [if exist /boot/Images/Tools/PasswordRegistyEditor.iso && set PWCH=/boot/Images/Tools/PasswordRegistyEditor.iso] Offline Windows PWchanger + Reg Editor (27.06.2010)\n%PWCH%

find --set-root %PWCH%

map %PWCH% (hd32)

map --hook

root (hd32)

chainloader (hd32)



iftitle [if exist /boot/Images/Tools/BootIt.gz && set BOOTIT=/boot/Images/Tools/BootIt.gz] BootIT\n%BOOTIT%

find --set-root %BOOTIT%

map --mem %BOOTIT% (fd0)

map --hook

root (fd0)

chainloader +1



iftitle [if exist /boot/Images/Tools/Ghost.wim] Ghost v15.0

###Map w7boot into Mem for LivePatching

map --mem /w7boot (rd)

### Patch CRC Check w7boot

write --offset=0xE28 (rd)+1 \xEB\x08

### write unicode \boot\

write --offset=0x54B5C (rd)+1 \\\x00b\x00o\x00o\x00t\x00\\\x00g\x00h\x00o\x00

chainloader (rd)+1

root ()



iftitle [if exist /boot/Images/Tools/ghost_2003.ima && set GH2k3=/boot/Images/Tools/ghost_2003.ima] Boot Ghost 2003\n%GH2k3%

find --set-root %GH2k3%

map --mem %GH2k3% (fd0)

map --hook

chainloader (fd0)+1



iftitle [if exist /boot/Images/Tools/ghost_2003.ima.gz && set GH2k3P=/boot/Images/Tools/ghost_2003.ima.gz] Boot Ghost 2003 Packed\n%GH2k3P%

map %GH2k3P% (fd0) || map --mem %GH2k3P% (fd0)

map --hook

chainloader (fd0)+1



title Main Menu

configfile /boot/grub/menu.lst


#14 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 16 December 2011 - 12:29 PM

Thanks for the great work!

What will happen, if several mentioned folders are present in the root directory? All their Menus will be listed in the Main Menu? Can you link a snapshot how your Menu.lst looks like on screen? :)

#15 laddanator

laddanator

    Frequent Member

  • Advanced user
  • 337 posts
  • Location:Virginia
  • Interests:Writing code and getting stuff to work when no one else can! Wrote a Windows Vista, 7, and 8 legal activation tool in VBscript and compiled it to exe. First project of this undertaking. Working on an AIO legal activation tool that includes XP.
  •  
    United States

Posted 20 December 2011 - 03:40 AM

iftitle [if exist /boot/Images/Win7/bx86.wim] Win7 Setup 32Bit

###Map w7boot into Mem for LivePatching

map --mem /w7boot (rd)

###Patch CRC Check w7boot

write --offset=0xE28 (rd)+1 xEBx08

###write unicode bwinb32

write --offset=0x54B5C (rd)+1 x00bx00ox00ox00tx00x007x008x006x00

chainloader (rd)+1

root (0



tefole, no bootmgr was used to install 7? Or did you rename bootmgr to W7Boot? If so is this the bootmgr from Winpe 2.0 or Winpe for Win7 SP1? The offsets look different than mine

map --mem /BOOTMGR (rd)

write --offset=0x105E (rd)+1 xEBx08

write --offset=0x54696 (rd)+1 1

chainloader (rd)+1

root ()

Never Mind...just saw this



###the w7boot on the root is the vista sp0 bootmgr



#16 laddanator

laddanator

    Frequent Member

  • Advanced user
  • 337 posts
  • Location:Virginia
  • Interests:Writing code and getting stuff to work when no one else can! Wrote a Windows Vista, 7, and 8 legal activation tool in VBscript and compiled it to exe. First project of this undertaking. Working on an AIO legal activation tool that includes XP.
  •  
    United States

Posted 20 December 2011 - 05:40 PM

Speaking of offset. I know this is off topic but has anyone figured out the new bootmgr offsets from Win 7 SP1 WAIK upgrade?

#17 Rui Paz

Rui Paz

    Frequent Member

  • Advanced user
  • 201 posts
  •  
    Portugal

Posted 28 December 2011 - 01:29 PM

If he doesn't add the licence then why do you give him the files?

tip: if you add

write 0x8274 0x2001

to the start of your menu.lst file, then the latest chenall version of grub4dos will autonumber the menu entries for you!

Various options are:
#autonumber boot entries with a space

write 0x8274 0x2001



#autonumber boot entries with a hyphen

write 0x8274 0x2d01



# autonumber all entries (even non-bootable ones)

write 0x8274 0x20ff


Hi Steve,

Do you know if its possible to start numbering the entries from 1 instead of 0?

TIA

#18 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 28 December 2011 - 01:42 PM

The user entry by typing a number will go wrong unless you start at 0. e.g. the user can type 2 and then type 1 and the menu entry 21 will be selected. So I suggest you use the first menu entry (0 entry) as a title for your menu (or even just a blank line. e.g.

title
root

title this is the first number 1 menu title
xxxx
yyy
zzz

so this will look like

1 this is the first number 1 menu title

The very latest grldr file from chenall will not number non-boot entries.

#19 Rui Paz

Rui Paz

    Frequent Member

  • Advanced user
  • 201 posts
  •  
    Portugal

Posted 28 December 2011 - 06:42 PM

Hi Steve,

I have this on my menu.lst file:


# Menu Autonumber

write 0x8274 0x2001

If i add the two lines:


title  

root


I only get a empty line on the menu and the first real entry continues to be 0.

Posted Image

#20 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 28 December 2011 - 07:09 PM

You can use

write 0x8274 0x20ff
but only blank title entries will be unnumbered, titles which are not blank will be listed and nonbooting entries will still increment the menu numbers...

#21 laddanator

laddanator

    Frequent Member

  • Advanced user
  • 337 posts
  • Location:Virginia
  • Interests:Writing code and getting stuff to work when no one else can! Wrote a Windows Vista, 7, and 8 legal activation tool in VBscript and compiled it to exe. First project of this undertaking. Working on an AIO legal activation tool that includes XP.
  •  
    United States

Posted 28 December 2011 - 07:11 PM

what exactly did the new grldr (or grub4dos) from 12-27-11 fix? Downloaded it but nothing in change log.


I have the 12-26-11 grldr and my number system is fine even with spaces

title
root


timeout 15

color white/blue

write 0x8274 0x2001



title Boot From Hard Drive (Windows Vista/7 or Xp)nBoot Into Main OS Drive

checkrange 0x80 read 0x8280 && map () (hd1)

checkrange 0x80 read 0x8280 && map (hd1) ()

checkrange 0x80 read 0x8280 && map --hook

rootnoverify (hd0,0)

chainloader +1 || chainloader /ntldr



title

root



title More Options Below.

root



title

root



## 01.Partition Wizard 7.0 Home Edition

iftitle [find --set-root --devices=h /laddsbootusb.tag && call set Wizard=%@root^%] Partition Wizard 7.0 From %Wizard%nGreat Partitioning Tool  

password --md5 $1$A$hzYlFap3SLNNQ/tA7c3.S.

find --set-root --devices=h /laddsbootusb.tag

echo Loading Partition Wizard From %Wizard%

set PW=%Wizard%/IMAGES/PWHE7.ISO

map %PW% (hd32) || map --mem %PW% (hd32)

map --hook

root (hd32)

chainloader (hd32)

##(hd32)

This is not my entire lst but the first part. I use

title
root

for spaces and I have no blank spots on bootup. Numbers are fine.

#22 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 28 December 2011 - 07:14 PM

what exactly did the new grldr (or grub4dos) from 12-27-11 fix? Downloaded it but nothing in change log.


2011-12-13
1 Fixed grub_sprintf function% d does not correctly display negative of the bug.

2011-12-12 command 'if' added '> =' and'<=', and able to perform numeric comparison.
1.if command also supports ==, >= and <= comparison operators.
New if command supports three more >=,==,<=
If both sides are numbers, automatically convert numeric to compare, or according to the ASCII string size comparison.

2011-12-11
1 can use the map - status = n to obtain the status of the disk has been mapped. use map - status = n to get status of hooked drive n.
Returns the following two variable information (return)
%?% = Start_Sector
% @ Retval% = Sector_Count
If the disk does not exist return 0.

2011-12-08
1 support auto menu number (useful when using the dynamic menu). Support menu AutoNumber.this is useful when used iftitle.
usage:
write 0x8274 0x2001
or
write 0x8274 0x2D01
0x20 (space) or 0x2d ('-') is the delimiter char in ascii code.
More usage of introduction:
http://bbs.wuyou.com...180142&page=193 # pid2351695

2011-12-06
1.bug correction.
(2) when using the debug mode to display the conditions of the menu commands executed.


the ChangeLog_chenall.txt has the most info on changes but does need xlating.

#23 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 28 December 2011 - 07:38 PM

For autonumber which only numbers boot entries use grub4dos-0.4.5b-2011-12-26.zip or later
You can create a blank 'boot' entry which is not numbered like this...



write 0x8274 0x2001

default 1



title

configfile /menu.lst



title this will be numbered 1

map /DOS6.22_bootdisk.iso (0xff)

map --hook

chainloader (0xff)



title this is a separator

root





title this will be numbered 2

map /DOS6.22_bootdisk.iso (0xff)

map --hook

chainloader (0xff)





#24 Rui Paz

Rui Paz

    Frequent Member

  • Advanced user
  • 201 posts
  •  
    Portugal

Posted 28 December 2011 - 07:51 PM

For autonumber which only numbers boot entries use grub4dos-0.4.5b-2011-12-26.zip or later
You can create a blank 'boot' entry which is not numbered like this...




write 0x8274 0x2001

default 1



title

configfile /menu.lst



title this will be numbered 1

map /DOS6.22_bootdisk.iso (0xff)

map --hook

chainloader (0xff)



title this is a separator

root





title this will be numbered 2

map /DOS6.22_bootdisk.iso (0xff)

map --hook

chainloader (0xff)




That did the trick. Thanks for the help.

#25 laddanator

laddanator

    Frequent Member

  • Advanced user
  • 337 posts
  • Location:Virginia
  • Interests:Writing code and getting stuff to work when no one else can! Wrote a Windows Vista, 7, and 8 legal activation tool in VBscript and compiled it to exe. First project of this undertaking. Working on an AIO legal activation tool that includes XP.
  •  
    United States

Posted 28 December 2011 - 09:17 PM

2011-12-13


This is the last entry in the changelog. Doesn't say anything about 12-27-11. I'm I not reading the date right? Dec 27th 2011 is the newest release, right?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users