Tuesday, 16 January 2018

Set up a different E2B wallpaper for each menu

It is possible to configure E2B so that each menu loads a different background wallpaper.

For the AUTO and WINDOWS menus, we just need to add these 800x600 files:
  • \_ISO\AUTO.bmp
  • \_ISO\SVR2K8R2.bmp
  • \_ISO\SVR2012.bmp
  • \_ISO\VISTA.bmp
  • \_ISO\WIN7.bmp
  • \_ISO\WIN8.bmp
  • \_ISO\WIN10.bmp
  • \_ISO\SVR2016.bmp
  • \_ISO\WINMENU.bmp (background for the Windows Install Menu - if any of the other Windows .bmp are used, this should also exist)
Note that the file extension should be .bmp, even if the actual contents are .jpg files or .gz or LZMA compressed .bmp files. For instance, you can just rename VISTA.jpg to VISTA.bmp, etc.


For the other 9 menu folders (MAINMENU, DOS, ANTIVIRUS, etc.), we can add a .mnu file to each of the menu folders as described at http://www.easy2boot.com/configuring-e2b/multiple-backgrounds/

However, I have added an alternative method now which may be easier for you to change and update...



Alternative Method


This method allows you to specify different wallpapers for the 9 menu folders from just one simple batch file.
1. Create a file \_ISO\SwitchBackground.g4b, containing the text...
!BAT
if "%MFOLDER%"=="/_ISO/ANTIVIRUS"         set BG=lamp.jpg
if "%MFOLDER%"=="/_ISO/BACKUP"            set BG=moon.jpg
if "%MFOLDER%"=="/_ISO/DOS"               set BG=lakesunset.jpg
if "%MFOLDER%"=="/_ISO/LINUX"             set BG=girl19.jpg
if "%MFOLDER%"=="/_ISO/MAINMENU"          set BG=girl19.jpg
if "%MFOLDER%"=="/_ISO/UTILITIES"         set BG=profile800x600.jpg
if "%MFOLDER%"=="/_ISO/UTILITIES_MEMTEST" set BG=girl19.jpg
if "%MFOLDER%"=="/_ISO/WIN"               set BG=girl19.jpg
if "%MFOLDER%"=="/_ISO/WINPE"             set BG=smilegreen.jpg
splashimage /_ISO/%BG%
set BG=
!BAT
if "%MFOLDER%"=="/_ISO/ANTIVIRUS"         set BG=lamp.jpg
if "%MFOLDER%"=="/_ISO/BACKUP"            set BG=moon.jpg
if "%MFOLDER%"=="/_ISO/DOS"               set BG=lakesunset.jpg
if "%MFOLDER%"=="/_ISO/LINUX"             set BG=girl1.jpg
if "%MFOLDER%"=="/_ISO/MAINMENU"          set BG=girl2.jpg
if "%MFOLDER%"=="/_ISO/UTILITIES"         set BG=profile800x600.jpg
if "%MFOLDER%"=="/_ISO/UTILITIES_MEMTEST" set BG=girl3.jpg
if "%MFOLDER%"=="/_ISO/WIN"               set BG=girl4.jpg
if "%MFOLDER%"=="/_ISO/WINPE"             set BG=smilegreen.jpg
splashimage /_ISO/%BG%
set BG=
You should change the name of the jpg/bmp files as required.
You can add color commands also if you wish, e.g.
if "%MFOLDER%"=="/_ISO/WINPE"             set BG=smilegreen.jpg && color normal=0xFF0000 && color highlight=0xFFFFFF

Tip: You can name the picture files as DOS.jpg, ANTIVIRUS.jpg, BACKUP.bmp, etc.
2. Create a new file at \_ISO\MAINMENU\$$$$CONFIG\SetBackground.mnu with the following contents:
call /_ISO/SwitchBackground.g4b
3. Copy the $$$$CONFIG folder (complete with the same SetBackground.mnu file) to each of the 8 other folders, e.g. \_ISO\ANTIVIRUS\$$$$CONFIG\SetBackground.mnu, \_ISO\BACKUP\$$$$CONFIG\SetBackground.mnu, etc.).
Do not copy the folder to \_ISO\AUTO or \_ISO\WINDOWS\xxxx folders because it will not be used.
4. Ensure your jpg or bmp files are in the \_ISO folder.  You can use a different folder to store the background files if you change the splashimage line in SwitchBackground.g4b to have the correct path.
You can now easily change any of the menu wallpapers just by editing the SwitchBackground.g4b file.
Note that jpg files often cause a loss of quality, so if you want the best/sharpest quality for your backgrounds, I recommend working with .bmp files. You can compress your .bmp files using the provided LZMA_Encode.cmd script as described on this E2B web page. A compressed .bmp file is smaller and will therefore load faster.