LastOS AIO (WIP)

Discussion in 'LastOS News' started by Glenn, Mar 20, 2023.

  1. Glenn

    Glenn Administrator Staff Member

    I tried Ventoy and it worked ok on some systems (not all), it refused to work with Secure Boot in my tests. So to make a AIO USB I thought about seeing what I could do with multiple install.esd's;

    Turns out that you can use Y:\sources\setup.exe /installfrom Y:\Last10\install.wim, but this didn't seem to want to work with .esd files (bugger), so back to the testing...

    The 2nd solution was so simple that it made sense... it will use the install.esd from the folder the setup.exe is in, so if you have multiple copies of the setup.exe in multiple folders it will just use the one in with it.

    Then I thought(Maybe Microsoft's documentation was wrong:

    It's actually

    such a simple fix, so now I can make multiple installers on the desktop with Windows WIM files (LTSC will still require the different setup.exe folder to include the ei.cfg as this file screws up PRO versions and without it LTSC wont install... so the solution is a combination of both my methods, but I'll only need the 2 lots of setup files (one for LTSC and one for Pro/HOME etc).

    Just the thought of one PE that has all Windows on the one USB is a handy idea IMO.
     
  2. Glenn

    Glenn Administrator Staff Member

    I have had some secure boot systems require the USB be FAT32 formatted before it would boot, a work around for this might be to put the \sources\boot.wim and boot files onto a fat32 partition and simply put all the rest of LastXX onto the 2nd partition, it works fine like this. If I decide to do a AIO I'll be sure to make a ISO that will be installable to a single partition, but this solution may suit some people and is an easy mod.
     
  3. Glenn

    Glenn Administrator Staff Member

    I just had another thought, the Y:\ drive is in fact writable on USB disks, so it would be easy to make a ei.cfg file using a script, but I am happy to include 2 lots of setup files :)
     
  4. Glenn

    Glenn Administrator Staff Member

    I am making the MakeShortcuts in ppAppsLive make the Icons on the desktop with the correct location/images.

    I'll make the FirstLogon.cmd open the correct $Scripts folder based on the Selected OS, this will allow custom $PostInstall etc to be set in them too. So it'll be a AIO solution.
     
  5. Glenn

    Glenn Administrator Staff Member

    Here is the results so far :)

    -EDIT-

    LTSC is still being a pain, I might have to change it to be in the sources and move the pro to sources_Pro instead.

    -EDIT-

    My Bad the key I provided was not right - working fine

    -EDIT-

    Also you can include ei.cfg in the same sources folder and the Pro images work too, bonus, never used to work in win 8.

    -EDIT-

    Yep, tested as working now, you can have AIO in the one source folder and include ei.cfg and all version will install Pro or LTSC
     

    Attached Files:

    Trouba likes this.
  6. Ghost

    Ghost Forum Crapolator

    We had a issue in windows 7 that finding the writable drive was kinda here or there but it turned out very useful, same principal, it sounds like what Kay did back years ago with XP and VIsta a dual boot .iso . I have seen where choosing a .iso file was doable also but that was a few years ago, I can not remember the way that was done though but it was on a Linux kernel I believe.
     
  7. Glenn

    Glenn Administrator Staff Member

    Ventoy also uses linux to load ISO,WIM etc. But like I said it fails to secure boot, making it not work right on Surfaces or other locked down hardware (if you can call it that).

    I know Trouba hates the SetMaxResolution in VM's, but I really like it in real hardware as it allows me to do the backups etc a LOT easier than a 800x600 screen allows, anyways, the newer Win10XPE project files break it from working at all, so I have to figure out why and/or revert my builder back to an older version.

    Instead of having xml's for every language I may look at making it ask which Language you want before making the shortcuts - if more than one language is detected, this will allow only one icon per OS.

    I don't think it's worth including Windows 8, but a windows 7 may be worth messing with to include? been a LOOONG time since I played with that beast, but Trouba has a nice fresh Win 7 image I can try it with.
     
  8. Ghost

    Ghost Forum Crapolator

    Lite Win 7 over XP mini, and a XP full to back the OLD hardware up, other than that, get a list started ..... Good luck , I do read .. :)
     
  9. bphlpt

    bphlpt A lowly staff member Staff Member

    I think Freezer has a Windows 9 (ie 8) that he likes that might be worth including, just to have all the options available. :)
     
  10. Glenn

    Glenn Administrator Staff Member

    VirtualBox_Windows 11 x64_21_03_2023_12_29_10.png

    I got the SetMaxRes fixed and I made the selector for picking the install Locations (it defaults to All), Not the prettiest thing, but it's opened sourced so if anyone wants to make it prettier or I get motivated later, it can be improved... It just makes less Icons on the desktop - so not a huge reason to have it, I haven't tested but if you only have one location it will not show the Locations Selector and just make shortcuts.
     
    pacav69, bphlpt and Trouba like this.
  11. Glenn

    Glenn Administrator Staff Member

    AutoUnattend XML addition:
    Code:
    <RunSynchronousCommand wcm:action="add">
                        <Order>9</Order>
                        <Description>Set OS Installed</Description>
                        <Path>reg add &quot;HKLM\SOFTWARE\ssTek&quot; /v &quot;OSInstalled&quot; /t REG_SZ /d Picnic10 /f</Path>
                    </RunSynchronousCommand>
    VirtualBox_Windows 11 x64_21_03_2023_13_53_35.png

    This is how I am detecting which OS you install, without a lot of messing about... then I should be able to grab it out using FirstLogon.cmd and run the correct scripts for the end OS to do the $PostLogon, $Tweaks etc for each OS.

    -EDIT-

    Example Script:
    Code:
    @echo off
    for /F "tokens=3" %%A in ('reg query "HKLM\Software\ssTek" /v "OSInstalled"') DO set "OSInstalled=%%A
    IF "%OSInstalled%"=="Last11-v2" goto :Last11v2
    IF "%OSInstalled%"=="Picnic10" goto :Picnic10
    IF "%OSInstalled%"=="Picnic11" goto :Picnic11
    goto :End
    
    :Last11v2
    echo Here is Last11-v2
    Goto :End
    
    :Picnic10
    echo Here is Picnic10
    Goto :End
    
    :Picnic11
    echo Here is Picnic11
    Goto :End
    
    :End
    pause
    Actual Script: sources\$OEM$\$$\Setup\Scripts\FirstLogon.cmd:
    Code:
    @ECHO OFF
    MODE CON COLS=80 LINES=2
    title LastOS Installer
    for /F "tokens=3" %%A in ('reg query "HKLM\Software\ssTek" /v "OSInstalled"') DO set "OSInstalled=%%A
    IF "%OSInstalled%"=="Last11-v2" goto :Last11v2
    IF "%OSInstalled%"=="Picnic10" goto :Picnic10
    IF "%OSInstalled%"=="Picnic11" goto :Picnic11
    goto :End
    :Last11v2
    rem ** Run FirstLogon.cmd from C: **
    FOR %%i IN (Y X W V U T S R Q P O N M L K J I H G F E D C) DO IF EXIST "%%i:\sources\$Scripts\FirstLogon.cmd" (SET CDROM=%%i:& goto DONECD)
    Goto :End
    :DONECD
    IF "%CDROM%"=="" (goto dudend)
    rem ** Run FirstLogon.cmd from DVD/USB **
    %CDROM%
    cd\
    cd %CDROM%\sources\$Scripts
    %CDROM%\sources\$Scripts\FirstLogon.cmd
    goto :realend
    :dudend
    echo Unable to find X:\sources\$Scripts\FirstLogon.cmd > "C:\Users\Public\Desktop\Automation_Failed.txt"
    echo did you remove your USB or DVD before setup had completed? >> "C:\Users\Public\Desktop\Automation_Failed.txt"
    Goto :End
    :Picnic10
    rem ** Run FirstLogon.cmd from C: **
    C:
    cd\
    cd C:\Windows\Setup\LastOS\$Scripts
    C:\Windows\Setup\LastOS\$Scripts\FirstLogon.cmd
    Goto :End
    :Picnic11
    rem ** Run FirstLogon.cmd from C: **
    C:
    cd\
    cd C:\Windows\Setup\LastOS\$Scripts
    C:\Windows\Setup\LastOS\$Scripts\FirstLogon.cmd
    Goto :End
    :End
    :realend
    As I'd already separated out the Scripts in the PicnicOS's, I was able to just bypass the USB/DVD one and only call them when picking Last11-v2 to install.... Testing it now, but it should work as expected.

    PicnicOS's already point directly to the C:\Windows\setup\LastOS\FirstLogon.cmd, so I'll leave them alone, but my script really doesn't need it for those 2 as it never gets ran, but any other OS's can make use of the methods, so I'll leave it for examples.
     
    Last edited: Mar 21, 2023
    Trouba likes this.
  12. Glenn

    Glenn Administrator Staff Member

    Drat the MaxRes isn't playing on real hardware, it's temperamental, I am gonna ignore it for now and keep working on other things... annoying but.

    -EDIT-

    Seemed to work fine on my main system, just not the Surface Tablet... Still doesn't seem to let you change the res post boot, but does at least change it on logon.

    -EDIT-

    Last7 Added, testing up all right so far.
     
    Last edited: Mar 21, 2023
    bphlpt and Trouba like this.
  13. Glenn

    Glenn Administrator Staff Member

    Just thought I'd share my day of working on this and making it work for me.

    I am curious if anyone else needs such a USB AIO (is it worth me sharing any of the files etc?) I know that most of us have our preferred OS and not all of us are installing 10's of machines and generally only have under 10 to maintain ourselves, but if anyone does want this I'm willing to share the ISO or just the skeleton to add your existing LastOS images... I am not sure, but I wanted to document it as I have got to the stage in my life where things don't stick around in my memory anymore and it's better to write it down.
     
    pacav69, unitop4 and bphlpt like this.
  14. Trouba

    Trouba Administrator Staff Member

    Of course, do share, if it isn't too much/complex to create a template for it (and maybe some pointers).
     
    bphlpt likes this.
  15. Glenn

    Glenn Administrator Staff Member

    Here is the builder/overlay tool, comes with a readme.

    It does require you have my later releases and if you don't include a ISO it'll delete the xml so they wont be shown, you really do require Last11_v2 though as it populates the whole ISO with the setup files etc it needs.
     

    Attached Files:

    pacav69 and Trouba like this.
  16. Glenn

    Glenn Administrator Staff Member

    Let me know if you have trouble making the bootable ISO, I could make it use the ISO creator from Win10XPE as a separate script.
     
    Trouba likes this.
  17. Trouba

    Trouba Administrator Staff Member

    Okay, will do. I'll download the .iso overnight. Been going through intensive training, having very little time right now so it may take a few days.
     
    Glenn likes this.
  18. unitop4

    unitop4 GUINEA PIG TESTER

    AIO creator worked great, just trying to figure out how to make iso of output folder. Figured it out, just copied over my last usb. works fine
     
    Last edited: Mar 21, 2023
    Glenn likes this.
  19. Glenn

    Glenn Administrator Staff Member

    You could put any OS that uses WIM/ESD, there is ways to get Linux installable too, but I really don't feel Linux users care about using a WinPE to install from :D
     
    unitop4 likes this.
  20. Glenn

    Glenn Administrator Staff Member

    chevy350 likes this.
  21. Glenn

    Glenn Administrator Staff Member

    Code:
    :::::::::::::::::::::::::::::::::::::::::
    :: Automatically check & get admin rights
    :::::::::::::::::::::::::::::::::::::::::
    @echo off
    CLS
    ECHO.
    ECHO =============================
    ECHO Running Admin shell
    ECHO =============================
    :checkPrivileges
    NET FILE 1>NUL 2>NUL
    if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
    :getPrivileges
    if '%1'=='ELEV' (shift & goto gotPrivileges)
    ECHO.
    ECHO **************************************
    ECHO Invoking UAC for Privilege Escalation
    ECHO **************************************
    setlocal DisableDelayedExpansion
    set "batchPath=%~0"
    setlocal EnableDelayedExpansion
    ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
    ECHO UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
    "%temp%\OEgetPrivileges.vbs"
    exit /B
    :gotPrivileges
    ::::::::::::::::::::::::::::
    ::START
    ::::::::::::::::::::::::::::
    setlocal & pushd .
    REM put here code as you like
    @ECHO OFF
    TITLE WinPE Dual Boot - LastOS
    COLOR F0
    pushd "%~dp0"
    SET BCDSTORE=%~dp0Boot\BCD
    SET LAST11=sources\boot.wim
    SET WIM64=sources\bootmin.wim
    if not exist %BCDSTORE% goto END
    bcdedit /store %BCDSTORE% /enum | find "osdevice" > GUID.txt
    For /F "tokens=2 delims={}" %%i in (GUID.txt) do (set _NEWGUID=%%i)
    bcdedit /store %BCDSTORE% /set {default} device ramdisk=[boot]\%LAST11%,{%_NEWGUID%}
    bcdedit /store %BCDSTORE% /set {default} osdevice ramdisk=[boot]\%LAST11%,{%_NEWGUID%}
    bcdedit /store %BCDSTORE% /set {default} description "Last11"
    bcdedit /store %BCDSTORE% /copy {default} /d "Standard PE" > GUID2.txt
    For /F "tokens=2 delims={}" %%i in (GUID2.txt) do (set _NEWGUID2=%%i)
    bcdedit /store %BCDSTORE% /set {%_NEWGUID2%} device ramdisk=[boot]\%WIM64%,{%_NEWGUID%}
    bcdedit /store %BCDSTORE% /set {%_NEWGUID2%} osdevice ramdisk=[boot]\%WIM64%,{%_NEWGUID%}
    bcdedit /store %BCDSTORE% /deletevalue {default} bootmenupolicy
    if exist GUID.txt DEL GUID.txt
    if exist GUID2.txt DEL GUID2.txt
    :END
    pause
    exit
    I put this on my USB stick with Last11_v4 and run it
    I then copy a standard (slightly modded boot.wim to the sources folder renamed to "bootmin.wim"
    I then used EasyBCD to enable a 5 seconds countdown (script could be modded to do this, but I just figured it all out and wanted to share it. Always wanted a compatible DUAL boot menu USB key.. this is how.

    -EDIT-
    Code:
    bcdedit /store %BCDSTORE% /timeout 5
    I added this just above the "If exist GUID.txt" line, I've not confirmed it's correct yet, but assume it'll work.
     
    Last edited: May 25, 2023
  22. ese callum

    ese callum New Member

  23. zdevilinside

    zdevilinside Active Member

    Take a look at Medicat. It uses Ventoy and you can just dump one of the LastOS ISOs into the OSImages folder. I have been doing that for awhile now.
     
  24. Glenn

    Glenn Administrator Staff Member

    Pretty huge download, will see what it is once it's in

    -EDIT-

    I see, it is a modern Hirens boot CD, but has a lot, it offers UEFI and CSM boot methods, so would work as a good option for 2 USB sticks (32GB+).

    I am building one to test on a laptop, will see how it performs, if the Ventoy causes any slowdowns I'll probably stick to my Dual boot method I currently use as my work is more about backups and unlocking and then installing, not so much recovery and virus removal - I prefer to keep what I need and start fresh than to spend ages trying to get an existing OS working again.
     
    Last edited: Aug 31, 2023
  25. zdevilinside

    zdevilinside Active Member

    I use it because it is a "Swiss Army" knife with every imaginable need that I have had. I am going to have to get R-Studio on it so that I can use that for data recovery. The thing I love the most about it is that you can put an ISO in the OSImage folder and boot off it.

    You don't have to use flash drives with it either - I have put it on a 1TB SSD that I have in an external enclosure.
     

Share This Page