UUP to ISO - Create Bootable ISO from Windows 10 Build Upgrade Files  


  1. Posts : 17,661
    Windows 10 Pro
    Thread Starter
       #540

    DonCuthbert said:
    This uses a PowerShell Function, written by Chris Wu, to create the ISO instead of requiring oscdimg.exe or imagex, etc. https://gallery.technet.microsoft.co...ction-a8deeffd
    Wow that's an incredible script! An extremely creative way to use PowerShell, but it's no wonder seeing who's made it.

    Thanks for sharing :)
      My Computer


  2. Posts : 3,453
       #541

    slicendice said:
    Which PS Script are you referring to? The ones I know of require you to partially download Windows ADK. For DISM if it's missing and for CD imaging it uses oscdimg which is also included in ADK.
    Yah, I'd like to see that script... Wimlib is far better than dism. I did try conveting Winlib to C# but got into a tangle and gave up ( C -> C# is a lot harder than people may think ... also the C compiled dll can't be called with external extern - needs to be re-complied as a C++ dll with the missing header file) - if anyone does manage to port it I would like to know about it...

    BTW.. you don't need ADK/oscdimg - I'm using native API's in ESDISO (it's out-dated, I know).. :

    Code:
    using System; 
    using System.Runtime.InteropServices; 
    using IMAPI2FS; 
    using System.IO; 
     
    namespace ISOBuilder 
    { 
        public class BuildISO 
        { 
            [MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_DISPATCH)] Array psaBoot; 
     
            [DllImport("shlwapi.dll", CharSet = CharSet.Unicode)] 
            static internal extern uint SHCreateStreamOnFile(string pszFile, uint grfMode, out FsiStream ppstm); 
     
            public void MakeISO(string MBRbootFile, string EFIbootFile,string path, string VolID) 
            { 
                MsftFileSystemImage iso = new MsftFileSystemImage(); 
     
                psaBoot = Array.CreateInstance(typeof(Object), 2); 
     
                FsiStream MBRbootStream,EFIbootStream; 
     
                iso.ChooseImageDefaultsForMediaType(IMAPI_MEDIA_PHYSICAL_TYPE.IMAPI_MEDIA_TYPE_DISK); 
                iso.FileSystemsToCreate = FsiFileSystems.FsiFileSystemUDF; 
                iso.VolumeName = VolID; 
     
                // Need  streams for the boot image files 
                UInt32 ret = SHCreateStreamOnFile(MBRbootFile, 0x00, out MBRbootStream); 
                 
                // Create MBR boot 
                BootOptions MBRbootOptions = new BootOptions(); 
                MBRbootOptions.Manufacturer = "Microsoft"; 
                MBRbootOptions.PlatformId = PlatformId.PlatformX86; 
                MBRbootOptions.Emulation = EmulationType.EmulationNone; 
                if (ret == 0) MBRbootOptions.AssignBootImage(MBRbootStream); 
     
                ///<!-- EFI boot is architecture specific --> 
                ret = SHCreateStreamOnFile(EFIbootFile, 0x00, out EFIbootStream); 
                // Create EFI boot 
                BootOptions EFIbootOptions = new BootOptions(); 
                EFIbootOptions.Manufacturer = "Microsoft"; 
                EFIbootOptions.PlatformId = PlatformId.PlatformEFI; 
                EFIbootOptions.Emulation = EmulationType.EmulationNone; 
                if (ret == 0) EFIbootOptions.AssignBootImage(EFIbootStream); 
     
                psaBoot.SetValue(MBRbootOptions, 0); 
                psaBoot.SetValue(EFIbootOptions, 1); 
                iso.BootImageOptionsArray = psaBoot; 
     
                iso.Root.AddTree(path, false); 
     
                IFileSystemImageResult resultImage = iso.CreateResultImage(); 
                IStream imageStream =  resultImage.ImageStream; 
                FsiStream newStream = null; 
     
                if (imageStream != null) 
                { 
                    tagSTATSTG stat; 
                    imageStream.Stat(out stat, 0x1); 
     
                    uint res = SHCreateStreamOnFile(path + ".iso", 0x1001, out newStream); 
                    if (res == 0 && newStream != null) 
                    { 
                        _ULARGE_INTEGER inBytes; 
                        _ULARGE_INTEGER outBytes; 
     
                        try 
                        { 
                            imageStream.RemoteCopyTo(newStream, stat.cbSize, out inBytes, out outBytes); 
                        } 
                        finally 
                        { 
                            Marshal.FinalReleaseComObject(imageStream); 
                            newStream.Commit(0); 
                            Marshal.FinalReleaseComObject(newStream); 
                            Marshal.FinalReleaseComObject(resultImage); 
                            Marshal.FinalReleaseComObject(iso); 
                           // if (System.IO.Directory.Exists(path)) System.IO.Directory.Delete(path, true); 
     
                        } 
                    } 
                    else 
                    { 
                        Marshal.FinalReleaseComObject(imageStream); 
                        Marshal.FinalReleaseComObject(resultImage); 
                        Marshal.FinalReleaseComObject(iso); 
                        //TODO: Throw exception or do whatever to signal failure here 
                    } 
                } 
                else 
                { 
                    Marshal.FinalReleaseComObject(resultImage); 
                    Marshal.FinalReleaseComObject(iso); 
                    //TODO: Throw exception or do whatever to signal failure here 
                } 
            } 
        } 
    }
    I'm sure it can be simplified and ported to PS..... however for this project, calling the third-party stuff will be much easier.

    Edit: a bit late in posting - thanx ffor the script.
      My Computer


  3. Posts : 119
    Windows 10
       #542

    Chris Wu's New-IsoFile function only allows for a single boot ISO (i.e. Legacy or EFI) for use to boot a VM from the resulting ISO file. If you choose EFI boot, but use something like Rufus to create a USB stick, you can still boot a physical Legacy BIOS PC with it.
      My Computer


  4. Posts : 56,825
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #543

    djrobison22 said:
    f14tomcat,

    I ended up doing it the way you suggested and I really want to thank you for that quick thinking! it made my morning so much easier that it gave me some free time to lay back down!

    Take care,

    Danny R
    Glad that worked for , Danny. Enjoy your "lay back" time!

    TC
      My Computers


  5. Posts : 2,667
    Windows 11 21H2 (22000.593)
       #544

    DonCuthbert said:
    Chris Wu's New-IsoFile function only allows for a single boot ISO (i.e. Legacy or EFI) for use to boot a VM from the resulting ISO file. If you choose EFI boot, but use something like Rufus to create a USB stick, you can still boot a physical Legacy BIOS PC with it.
    Thanks for the link to the new-ISOfile script. Would you mind sharing your own script as well?

    I'd love to be able to create an AIO disc to carry around for install purposes for both support as well as for easier VM creation without having to maintain so many different .ISOs.
      My Computers


  6. Posts : 119
    Windows 10
       #545

    johngalt said:
    Thanks for the link to the new-ISOfile script. Would you mind sharing your own script as well?

    I'd love to be able to create an AIO disc to carry around for install purposes for both support as well as for easier VM creation without having to maintain so many different .ISOs.
    OK, but remember I am not a programmer and have almost no experience with scripting. I just began with wanting to do everything with PowerShell instead of DISM one morning and decided to throw in making the combined Pro and Home ISO. The end result takes forever to run, as it mounts and converts the Home WIM to Pro and then adds it to the Install.wim in the ISO folder. I haven't figured out how to paste the code properly into this forum post (it ends up all in one line for me) so I will attach the text file.
    ISOfromESD.txt
      My Computer


  7. Posts : 2,667
    Windows 11 21H2 (22000.593)
       #546

    DonCuthbert said:
    OK, but remember I am not a programmer and have almost no experience with scripting. I just began with wanting to do everything with PowerShell instead of DISM one morning and decided to throw in making the combined Pro and Home ISO. The end result takes forever to run, as it mounts and converts the Home WIM to Pro and then adds it to the Install.wim in the ISO folder. I haven't figured out how to paste the code properly into this forum post (it ends up all in one line for me) so I will attach the text file.
    ISOfromESD.txt
    What if the user supplies both .wim files?
      My Computers


  8. Posts : 119
    Windows 10
       #547

    johngalt said:
    What if the user supplies both .wim files?
    That would be much faster to process, but you still need the other 3 Indexes that are in a full ESD file to produce standard Windows 10 install media. Index:1 is the main file and folder structure for the ISO. Indexes 2 & 3 combine to create the full boot.wim and Index:4 is usually either Home or Pro, which is used to create Install.wim in the ISO.
    Code:
    DISM /Get-WimInfo /WimFile:Install.esd
    
    Deployment Image Servicing and Management tool
    Version: 10.0.14393.0
    
    Details for image : Install.esd
    
    Index : 1
    Name : Windows Setup Media
    Description : Windows Setup Media
    Size : 262,777,817 bytes
    
    Index : 2
    Name : Microsoft Windows PE (x64)
    Description : Microsoft Windows PE (x64)
    Size : 1,633,924,022 bytes
    
    Index : 3
    Name : Microsoft Windows Setup (x64)
    Description : Microsoft Windows Setup (x64)
    Size : 1,786,347,488 bytes
    
    Index : 4
    Name : Windows 10 Home
    Description : Windows 10 Home
    Size : 15,140,872,818 bytes
    
    The operation completed successfully.
    A script could be made to take a full Home ESD and then just add a supplied Pro Install.wim to the ISO. That would run much faster as it doesn't have to mount and convert the Home Install.wim to Pro.

    The Official version 1607 install media includes Windows 10 Pro, Windows 10 Home, Windows 10 Home Single Language and Windows 10 Education combined in one Install.esd.

    I believe the UUP to ISO process is missing what is usually Index:3 in the full ESD file that we used to get, which is part of why it ends up not including "Repair your computer" in the end result. But it still works to install Windows.
      My Computer


  9. Posts : 2,667
    Windows 11 21H2 (22000.593)
       #548

    DonCuthbert said:
    That would be much faster to process, but you still need the other 3 Indexes that are in a full ESD file to produce standard Windows 10 install media. Index:1 is the main file and folder structure for the ISO. Indexes 2 & 3 combine to create the full boot.wim and Index:4 is usually either Home or Pro, which is used to create Install.wim in the ISO.
    Code:
    DISM /Get-WimInfo /WimFile:Install.esd
    
    Deployment Image Servicing and Management tool
    Version: 10.0.14393.0
    
    Details for image : Install.esd
    
    Index : 1
    Name : Windows Setup Media
    Description : Windows Setup Media
    Size : 262,777,817 bytes
    
    Index : 2
    Name : Microsoft Windows PE (x64)
    Description : Microsoft Windows PE (x64)
    Size : 1,633,924,022 bytes
    
    Index : 3
    Name : Microsoft Windows Setup (x64)
    Description : Microsoft Windows Setup (x64)
    Size : 1,786,347,488 bytes
    
    Index : 4
    Name : Windows 10 Home
    Description : Windows 10 Home
    Size : 15,140,872,818 bytes
    
    The operation completed successfully.
    A script could be made to take a full Home ESD and then just add a supplied Pro Install.wim to the ISO. That would run much faster as it doesn't have to mount and convert the Home Install.wim to Pro.

    The Official version 1607 install media includes Windows 10 Pro, Windows 10 Home, Windows 10 Home Single Language and Windows 10 Education combined in one Install.esd.

    I believe the UUP to ISO process is missing what is usually Index:3 in the full ESD file that we used to get, which is part of why it ends up not including "Repair your computer" in the end result. But it still works to install Windows.
    Which would indicate that those files are already on our system (which they are, considering we have the ability to fix things ourselves directly from boot), and that the current UUP>ISO scripts could, in fact, be amended to add that information back in from an existing Windows 10 Install to make a proper .ISO with repair ability.
      My Computers


  10. Posts : 119
    Windows 10
       #549

    johngalt said:
    Which would indicate that those files are already on our system (which they are, considering we have the ability to fix things ourselves directly from boot), and that the current UUP>ISO scripts could, in fact, be amended to add that information back in from an existing Windows 10 Install to make a proper .ISO with repair ability.
    Windows Update isn't trying to create a standard Windows install ISO though. It only needs to successfully upgrade Windows to the new build. We are trying to produce bootable Install media instead.

    Index:3 is a version of WindowsPE, but it has additional files and folders compared to Index:2. Plus it is normally the same build as what you are upgrading to. Someone would have to analyze exactly what the differences are between Index:2 and Index:3 and figure out how to add in all of the missing folders and files from the new build files which were created by Windows Update in the UUP process.

    That is why the working solution is to simply use a prior build ISO and replace install.wim with the new one. You end up with a mix of builds in the ISO, but what it installs is the new build. But when you run Repair your computer, it uses a prior build's WindowsRE.
      My Computer


 

Tutorial Categories

UUP to ISO - Create Bootable ISO from Windows 10 Build Upgrade Files Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  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 22:18.
Find Us




Windows 10 Forums