PEMenu for WinPE


  1. Posts : 24
    Windows 11 x64
       #1

    PEMenu for WinPE


    pemenu is a small program for generating start menu shortcuts for windows PE. I created it and have been using it for awhile. Since I learned a lot about winpe building here, from winxpe, which i used when i started building pe since the time i found them in another site, d'oven, and followed it here :)

    Win10XPE - Build Your Own Rescue Media [2]

    I decided to share it to the community, just in case someone prefers WinPE like I do.

    Note:

    This is mainly created for WinPE but I guess can also be used for other purpose.

    The idea is to just build a winpe wim file without any programs integrated or just as minimal pe as can be, that we can use as a base wim (I found some base wim built by other people as well, which is as small as 200+ MB although I still prefer building it myself, using and combining scripts from winxpe, wimbuilder, and from other winpe creators, credits to their authors and for sharing their work.

    All of the applications will be stored in the usb drive as a Self extracting archive while it will be just the pemenu.exe and the pemenu.ini file in the RAM virtual drive, which is mostly x:\ for WinPE. This way, we only need to update the application sfx archive every time there is an update to the application. We are also able to remove the usb drive while using any application as it gets copied to the RAM drive when executed, which is the same as installing a program then executing it.

    We can create a list of applications that will be auto installed during shortcut creations ( if pemenu.exe is called upon boot ), so it will be auto loaded into the ram during bootup. This will be a set of applications we want to use if we are booting multiple machines and we want to remove the usb as soon as it is booted. This config can be easily changed just by editing the pemenu.ini file if we want to add or remove auto starting applications during bootup and without recompiling winpe.

    Shortcuts created by pemenu is actually a shortcut to pemenu.exe with the archive name of the application and the switches to use for pemenu. So it means pemenu will be called in each application startup (the first time a program is called), and it will try to extract the sfx archive on the target drive, import the registry entry if any present (this is with the same name as the executable), then execute the application depending on the config in pemenu.ini and the parameters we passed on pemenu.exe, if the program path and files exists on the target directory, it will just try to execute the installed program.

    Here are the command parameters that can be used with pemenu.exe


    example command paramater usage:

    pemenu.exe /n:HWinfo_sfx.exe /x:e ; this will install the hwinfo.sfx but will NOT run the application after install
    pemenu.exe /n:HWinfo_sfx.exe /x:r ; this will install the hwinfo.sfx AND will RUN the application after install
    pemenu.exe /x:s ; this will update the pemenu.ini file entry 'sourcedir' with the current directory pemenu.exe is in. This helps in updating the location of the self extracting applications to be installed/ used. I use this in boot up phase as I my USB use the first available drive letter in the system (not using letterswap). This make sure that pemenu can find my applications whichever drive the system assigns to my USB drive.
    pemenu.exe ; no paramater will just generate the shortcuts of applications found in pemenu.ini, run auto install if any and run applications set to run after installation.



    Sample pemenu.ini contents

    ```
    Code:
    [main]
    ; password is the encryption used for all the SFX archive created
    ; I included this because some antivirus detects some programs as malware, e.g. windows password unlocker
    ; it will avoid at least getting detected by the antivirus as archive is protected by password
    password = pepassword
    ;sourcedir should point to the USB flash drive folder that contains the SFX archive collection folder and pemenu.exe
    ; complete path of the source dir will be "F:\PEMenu\sfxs" for this config
    sourcedir =F:\PEMenu
    ; targetdrive will be the root of the RAM drive for the PE OS
    targetdrive = X:\
    
    ; SFX archive name should be HWifoArchive.exe and should be saved inside 'pemenu\sfxs' folder
    [HWinfo_sfx]
    exename = HWiNFO64.exe
    param = 
    shortcutfolder = HW Info
    shortcutname = HWinfo
    exefullpath = Program Files\HWinfo
    desktopshortcut = 1
    ; this program will be autoinstalled to the RAM drive X:\ and will also be executed after install
    autoinstall = 1
    autoexecute = 1 
    
    
    ;Self executable archive name can be the same as the application name
    ; and should be saved inside 'pemenu\sfxs' folder
    [chkdsk]
    exename = chkdsk.exe
    param = 
    shortcutfolder = HD Tasks
    shortcutname = Check Disk GUI
    exefullpath = Program Files\Check Disk
    desktopshortcut = 1
    ; This config will create cpuz shortcut on Start Menu under HW Info folder
    ; autoinstall is 0, means it will not get extracted to the RAM drive X:\
    ; autoexete = 1 will not work without making autoinstall = 0
    autoinstall = 0
    autoexecute = 0
    
    ; SFX archive name should be cpuzArchive.exe and should be saved inside 'pemenu\sfxs' folder
    [cpuz_sfx]
    exename = cpuz_x64.exe
    param = 
    shortcutfolder = HW Info
    shortcutname = CPU-Z
    exefullpath = Program Files\CPU-Z
    desktopshortcut = 1
    ; this will install the program to the RAM drive but will not execute after installation
    autoinstall = 1
    ; autoexecute = 1 will not work without setting autoinstall = 1 first
    autoexecute = 0
    ```



    Directory structure for pemenu:

    PEMenu\ - location of pemenu.exe and pemenu.ini

    PEMenu\sfxs\ - directory where Icons.exe sfx and all applications self extracting archives are located

    PEMenu\sfxs\Icons.exe - self extracting archives of all the application icons, it will be used for creating start menu shortcut icons, icon name should be the same as the archive name, e.g., if sfx name is hwinfo_sfx.exe then icon should be hwinfo_sfx.ico

    - - - Updated - - -

    How to use :

    • Extract the content of pemenu.7z to your winpe usb or include it in your wim

      - I like it to be inside the wim file under X:\Program Files\pemenu\ and all sfxs under USB:\pemenu\sfxs\ and just copying pemenu.ini in the x:\Program Files\pemenu\ from X:\Program Files\pemenu\ during pe boot, but it is up to your preference, I do it so I can just edit the pemenu.ini in the USB when updating, adding or removing any programs from my WinPE and at the same time my startmenu links will not break as my pemenu.exe will be in X:\Program Files\pemenu\

    • Create self extracting archive(s) of your application(s) and save it inside (pemenu\sfxs)

      - You can use 7zip or nanozip for this step
      - The structure of the archive should be from root, e.g. Windows\system32 or Program Files\HWinfo
      - (If registry entries are required by the application) Include the registry entries of the application inside the self extracting archive. e.g. HWinfo_sfx.reg

    • Create self extrating archives of all your application's icon (name it Icons.exe) and save it inside (pemenu\sfxs)

      - This will be used for creating startmenu entries only, shortcuts created on your desktop will be the original application's icon

    • Edit the (pemenu.ini) to reflect your winpe path and your application configuration

      - See the previous notes on how to configure your application's behavior here

    • call pemenu.exe in winpe or run pemenu.exe inside winpe ( I do it during boot time to propagate the start menu )

    • done
    PEMenu for WinPE Attached Files
    Last edited by digilizard; 20 Oct 2023 at 20:08.
      My Computer


  2. Posts : 1
    10
       #2

    digilizard said:
    pemenu is a small program for generating start menu shortcuts for windows PE. I created it and have been using it for awhile. Since I learned a lot about winpe building here, from winxpe, which i used when i started building pe since the time i found them in another site, d'oven, and followed it here :)

    Win10XPE - Build Your Own Rescue Media [2]

    I decided to share it to the community, just in case someone prefers WinPE like I do.

    Note:

    This is mainly created for WinPE but I guess can also be used for other purpose.

    The idea is to just build a winpe wim file without any programs integrated or just as minimal pe as can be, that we can use as a base wim (I found some base wim built by other people as well, which is as small as 200+ MB although I still prefer building it myself, using and combining scripts from winxpe, wimbuilder, and from other winpe creators, credits to their authors and for sharing their work.

    All of the applications will be stored in the usb drive as a Self extracting archive while it will be just the pemenu.exe and the pemenu.ini file in the RAM virtual drive, which is mostly x:\ for WinPE. This way, we only need to update the application sfx archive every time there is an update to the application. We are also able to remove the usb drive while using any application as it gets copied to the RAM drive when executed, which is the same as installing a program then executing it.

    We can create a list of applications that will be auto installed during shortcut creations ( if pemenu.exe is called upon boot ), so it will be auto loaded into the ram during bootup. This will be a set of applications we want to use if we are booting multiple machines and we want to remove the usb as soon as it is booted. This config can be easily changed just by editing the pemenu.ini file if we want to add or remove auto starting applications during bootup and without recompiling winpe.

    Shortcuts created by pemenu is actually a shortcut to pemenu.exe with the archive name of the application and the switches to use for pemenu. So it means pemenu will be called in each application startup (the first time a program is called), and it will try to extract the sfx archive on the target drive, import the registry entry if any present (this is with the same name as the executable), then execute the application depending on the config in pemenu.ini and the parameters we passed on pemenu.exe, if the program path and files exists on the target directory, it will just try to execute the installed program.

    Here are the command parameters that can be used with pemenu.exe


    example command paramater usage:

    pemenu.exe /n:HWinfo_sfx.exe /x:e ; this will install the hwinfo.sfx but will NOT run the application after install
    pemenu.exe /n:HWinfo_sfx.exe /x:r ; this will install the hwinfo.sfx AND will RUN the application after install
    pemenu.exe /x:s ; this will update the pemenu.ini file entry 'sourcedir' with the current directory pemenu.exe is in. This helps in updating the location of the self extracting applications to be installed/ used. I use this in boot up phase as I my USB use the first available drive letter in the system (not using letterswap). This make sure that pemenu can find my applications whichever drive the system assigns to my USB drive.
    pemenu.exe ; no paramater will just generate the shortcuts of applications found in pemenu.ini, run auto install if any and run applications set to run after installation.



    Sample pemenu.ini contents

    ```
    Code:
    [main]
    ; password is the encryption used for all the SFX archive created
    ; I included this because some antivirus detects some programs as malware, e.g. windows password unlocker
    ; it will avoid at least getting detected by the antivirus as archive is protected by password
    password = pepassword
    ;sourcedir should point to the USB flash drive folder that contains the SFX archive collection folder and pemenu.exe
    ; complete path of the source dir will be "F:\PEMenu\sfxs" for this config
    sourcedir =F:\PEMenu
    ; targetdrive will be the root of the RAM drive for the PE OS
    targetdrive = X:\
    
    ; SFX archive name should be HWifoArchive.exe and should be saved inside 'pemenu\sfxs' folder
    [HWinfo_sfx]
    exename = HWiNFO64.exe
    param = 
    shortcutfolder = HW Info
    shortcutname = HWinfo
    exefullpath = Program Files\HWinfo
    desktopshortcut = 1
    ; this program will be autoinstalled to the RAM drive X:\ and will also be executed after install
    autoinstall = 1
    autoexecute = 1 
    
    
    ;Self executable archive name can be the same as the application name
    ; and should be saved inside 'pemenu\sfxs' folder
    [chkdsk]
    exename = chkdsk.exe
    param = 
    shortcutfolder = HD Tasks
    shortcutname = Check Disk GUI
    exefullpath = Program Files\Check Disk
    desktopshortcut = 1
    ; This config will create cpuz shortcut on Start Menu under HW Info folder
    ; autoinstall is 0, means it will not get extracted to the RAM drive X:\
    ; autoexete = 1 will not work without making autoinstall = 0
    autoinstall = 0
    autoexecute = 0
    
    ; SFX archive name should be cpuzArchive.exe and should be saved inside 'pemenu\sfxs' folder
    [cpuz_sfx]
    exename = cpuz_x64.exe
    param = 
    shortcutfolder = HW Info
    shortcutname = CPU-Z
    exefullpath = Program Files\CPU-Z
    desktopshortcut = 1
    ; this will install the program to the RAM drive but will not execute after installation
    autoinstall = 1
    ; autoexecute = 1 will not work without setting autoinstall = 1 first
    autoexecute = 0
    ```



    Directory structure for pemenu:

    PEMenu\ - location of pemenu.exe and pemenu.ini

    PEMenu\sfxs\ - directory where Icons.exe sfx and all applications self extracting archives are located

    PEMenu\sfxs\Icons.exe - self extracting archives of all the application icons, it will be used for creating start menu shortcut icons, icon name should be the same as the archive name, e.g., if sfx name is hwinfo_sfx.exe then icon should be hwinfo_sfx.ico

    - - - Updated - - -

    How to use :

    • Extract the content of pemenu.7z to your winpe usb or include it in your wim

      - I like it to be inside the wim file under X:\Program Files\pemenu\ and all sfxs under USB:\pemenu\sfxs\ and just copying pemenu.ini in the x:\Program Files\pemenu\ from X:\Program Files\pemenu\ during pe boot, but it is up to your preference, I do it so I can just edit the pemenu.ini in the USB when updating, adding or removing any programs from my WinPE and at the same time my startmenu links will not break as my pemenu.exe will be in X:\Program Files\pemenu\

    • Create self extracting archive(s) of your application(s) and save it inside (pemenu\sfxs)

      - You can use 7zip or nanozip for this step
      - The structure of the archive should be from root, e.g. Windows\system32 or Program Files\HWinfo
      - (If registry entries are required by the application) Include the registry entries of the application inside the self extracting archive. e.g. HWinfo_sfx.reg

    • Create self extrating archives of all your application's icon (name it Icons.exe) and save it inside (pemenu\sfxs)

      - This will be used for creating startmenu entries only, shortcuts created on your desktop will be the original application's icon

    • Edit the (pemenu.ini) to reflect your winpe path and your application configuration

      - See the previous notes on how to configure your application's behavior here

    • call pemenu.exe in winpe or run pemenu.exe inside winpe ( I do it during boot time to propagate the start menu )

    • done
    Hey, can you please point me in the direction of how to add app to Winpe.

    thank you
      My Computer


  3. Posts : 24
    Windows 11 x64
    Thread Starter
       #3

    Hi, sorry for the late reply, just got really busy.

    You can capture an installation from within Windows using tools like Total Uninstall, or go to the WinXPE thread and you can just create a self extracting archive from the applications downloaded by winxpe (just make sure you include the registry if any, and some windows system files it needs - check the script of the program install ), another way is to get portable applications on which most of them already got the application packaged for you.

    Here's an example application that you can try adding to your WinPE, program is Notepad3 and it got a simple registry entries for the context menu

    To try it:

    • Extract the content of the zip to your PE USB


    • Edit the pemenu.ini File so that the sourcedir= points your extracted pemenu location. e.g. Y:\PEMenu or run pemenu.exe with parameter /x:s . e.g. pemenu.exe /x:s


    • Run pemenu.exe and it will add the notepad3 entries on your winpe startmenu and will import the registry keys for you


    This is the content of the selft extracting archive with the full path highlighted in yellow
    PEMenu for WinPE-contents.png

    This is how to create a self extracting archive for pemenu, password is optional, all you need to change is highlighted in yellow
    PEMenu for WinPE-creating-sfx.png

    This is what you need to edit in pemenu.ini that corresponds to the item to the right, or much better to run pemenu.exe /x:s and pemenu will update it for you
    PEMenu for WinPE-structure.png

    Here's the PEMenu.zip with the Notepad3 sample config and sfx
    PEMenu for WinPE Attached Files
      My Computer


  4. Posts : 24
    Windows 11 x64
    Thread Starter
       #4

    Difference with just using pre built application builder


    I just want to point out the difference in using this pemenu compared to just building it straight with Wimbuilder or WinXPE

    Using pemenu (compared to building application directly. e.g. Wimbuilder or WinXPE)

    • WinPE USB can be removed and can be used in multiple computers after executing/ running the program. ( The executed application(s) will be copied to the RAM drive during execution ), but resides in the USB during winpe boot up, making loading winpe faster compared to copying all programs in RAM during bootup.

    • Updating a program is as easy as just replacing the sfx archive contents with the updated program files.

    • Editing the program to load on RAM or get executed on boot can be easily changed by simply changing entries in the pemenu.ini file.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:15.
Find Us




Windows 10 Forums