0

During Windows 11 installation:

enter image description here

Obviously install.wim's only image inside is extracted in this "Copying Windows files" stage. Now, this install.wim, I wish to replace with my own WIM file containing 2 images spanning 2 drives:

Program Files, Program Files (x86), Windows — inside C:

PerfLogs, ProgramData, Temp & Users — inside D:

(Yes I've tinkered with splitting these between 2 drives enough to know it works)

So, how do I make the setup iterate through this "Copying Windows files" twice? I don't have experience in cracking installers & such, but I know there should be command in a script:

dism apply-image /imagefile:install.wim /applydir:C:\ {/index:1 | /name:"Windows 11 Home"}

If so, then achieving this should be a relative cinch.

EDIT:

I may be on a false lead. I've somewhat hex searched an extracted Windows installation ISO & it seems the DISM commands are done with dynamic links rather than the command line shell. I don't know where to go from here.

1
  • 1
    Your personal need for an answer is unlikely going to be a determination if you receive an answer to your question. If you receive an answer to this question, it could be hours, days, weeks in the future. You might have to take the appropriate steps to figure out the problem yourself if you are under a tight deadline. You might be better off, just booting into WinPE, which is configured to run a custom PowerShell script instead of trying to modify the behavior of Microsoft's installation environment.
    – Ramhound
    Commented Nov 9, 2022 at 19:35

1 Answer 1

1

This can be done, but not by editing the installer. You just have to emulate what the installer is doing.

Full step by step guide for doing this with the Users folder - the steps are the same for win11: https://www.tenforums.com/tutorials/1964-move-users-folder-location-windows-10-a.html

Recommended reading:

  • Capture and apply your WIM image using DISM - the basic steps for installing windows from a .wim file

  • [optional] Create a Data Image of the files a normal capture does not include, like D:\mystuff\.

  • Create an unattend.xml answer file to have windows install certain system directories (ProgramData, Users, etc.) to drive D:

Here's an example unattend.xml to give you an idea of how to set up /Users/ on D: and apply your data image onto partition 1 (D:), but you should use the Windows SIM to generate these, since the available settings tend to change between windows releases

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
  <settings pass="oobeSystem">
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <FolderLocations>
        <ProfilesDirectory>D:\Users</ProfilesDirectory>
      </FolderLocations>
    </component>
  </settings>
  <settings pass="windowsPE">
    <component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <ImageInstall>
        <DataImage wcm:action="add">
          <InstallTo>
            <DiskID>0</DiskID>
            <PartitionID>1</PartitionID>
          </InstallTo>
          <InstallFrom>
            <Path>X:\folder\MyData.wim</Path>
          </InstallFrom>
          <Order>1</Order>
        </DataImage>
      </ImageInstall>
    </component>
  </settings>
</unattend>

edit:

  • ProgramData can be moved the same way, but is not recommended. It's easier to copy any files to D: and link the folder
  • Temp is just an environment variable, %TEMP%, and doesn't need to be set at install
  • PerfLogs is hardcoded to %SYSTEMDRIVE%\PerfLogs, so it will always be on your primary windows partition. You can link it elsewhere the same way as ProgramData

Those steps can be done with a script as part of the unattend.xml using RunSynchronousCommand

10
  • Seems to work well for Users folder (with it's ProfilesDirectory tag), but what about the rest PerfLogs, ProgramData & Temp? Do they also have tags for them? Commented Nov 9, 2022 at 21:49
  • @TempusNomen ProgramData does, but it may not work anymore. I've added suggestions for it and the others
    – Cpt.Whale
    Commented Nov 9, 2022 at 22:38
  • Yeah, every single one of the 4 folders: PerfLogs, ProgramData, Temp & Users, I've moved to D: & linked to from C:. I don't want to go the extra, inelegant work of setting them up differently as you suggest it, so I want them done in the same step. Commented Nov 9, 2022 at 22:55
  • @TempusNomen if that's all you're doing, just have unattend.xml run a script after basic installation to copy and link. Or if you do have a second wim for your D: drive, just apply it with the DataImage step. Nothing where you move ProgramData is going to be "elegant" lol
    – Cpt.Whale
    Commented Nov 9, 2022 at 23:16
  • Where do I start learning to do either? A quick brush up so I can decide which to go with? Commented Nov 9, 2022 at 23:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .