How can I change the default settings when Windows finishes installing?

blue-person

New Member
Hello everyone.

I'm trying to get some settings regarding the wallpaper, dark theme, and system colors to be applied automatically at the end of the Windows installation, as well as when creating a new user, but I have not been successful. The closest I've come to getting it to work as I intend is that the settings are applied correctly when it finishes installing Windows, but when I tried to create a new user, the default Windows settings are kept.

I'm doing all this through registry modifications, but I don't know if I should do is through the Registry option in NTLite or it is better to do it through CMD scripts in Post-Setup, either as Machine or User. Anyways, all these registry modifications do is to set the Dark Theme and change the default color to purple. I have tried using making these changes with both HKEY_CURRENT_USER and HKEY_USER\.DEFAULT\, but it doesn't really work as I needed.

Regarding the wallpaper, I changed the wallpaper and lock screen by replacing img0.jpg and img101.jpg from NLTmpMnt, so this actually work as intended.

I've also been thinking that this would be best done by creating and using a Theme, but I don't know how to create one and use NTLite to have it used automatically, wallpaper included.

I would appreciate if someone could guide me a bit to solve this. Any information that may be required I am fully willing to give.

Thanks in advance!
 

Hellbovine

Well-Known Member
I'm assuming we're talking about W10 or W11? If so, there are many different ways to go about this, so you will probably get replies that are all very different from each other...In my opinion, the best method is to stop Windows from installing a default theme. This is why customization is difficult, as you have experienced, because many personalization settings will reset back to the defaults of the Aero theme that gets installed when a user is created. The fix is integrating some registry keys which tell the operating system to install no theme:

; Start > Settings > Personalization > Themes > None
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes]
"InstallTheme"=""
"InstallThemeLight"=""

; Start > Settings > Personalization > Themes > None
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Themes]
"InstallTheme"=""
"InstallThemeLight"=""

Note: there are a set of empty quotes at the end of these keys, because originally they point to the filepath of the Aero theme and by removing the filepath, the user provisioning will essentially skip the step of installing the theme file and move on to the next thing it has to do instead. These keys are verified to work on W10 21H2.

Once those keys are integrated into the image with NTLite, go ahead and install that image to see its effects. While you are at the Windows desktop, use a registry compare tool to capture all the personalization keys you need (to integrate into your image), or use the personalization options that NTLite has, whichever way you prefer. When you have all the keys you need, let NTLite handle how to integrate them, there's no need to worry about manually changing filepaths to be HKEY_USER or anything like that. The real issue here is the default Aero theme, and once that obstacle is gone the rest is smooth sailing.
 
Last edited:

garlin

Moderator
Staff member
What you're encountering is a dirty secret about W10/11. All those HKCU hacks work, but not for new users.

HKCU is simply a shortcut in the registry, for the current user (whoever is logged on). If you're customizing yourself, it works fine.
The normal rule was to add the same hacks to HKEY_USER\.DEFAULT and all new users inherit the same settings.

The problem with later Windows releases is user provisioning is ignoring (for whatever reason), many user desktop settings.

There's a simple way to check this out. Add customizations to Default User. Now create a new local account, and log on. Some of your settings are entirely missing. What needs to happen is to apply those settings AFTER you're logged on.

For now, copy your HKCU hacks in a reg file. Drop that reg file into Post-Setup (User Execution), and those will be applied when you logon. You may have to log out and back, to have some of them take effect (or restart explorer.exe).
 

blue-person

New Member
What you're encountering is a dirty secret about W10/11. All those HKCU hacks work, but not for new users.

HKCU is simply a shortcut in the registry, for the current user (whoever is logged on). If you're customizing yourself, it works fine.
The normal rule was to add the same hacks to HKEY_USER\.DEFAULT and all new users inherit the same settings.

The problem with later Windows releases is user provisioning is ignoring (for whatever reason), many user desktop settings.

There's a simple way to check this out. Add customizations to Default User. Now create a new local account, and log on. Some of your settings are entirely missing. What needs to happen is to apply those settings AFTER you're logged on.

For now, copy your HKCU hacks in a reg file. Drop that reg file into Post-Setup (User Execution), and those will be applied when you logon. You may have to log out and back, to have some of them take effect (or restart explorer.exe).
Thanks for answering!

I've actually already tried running the .reg's as both Machine and User. Despite the fact that the changes are maintained at the end of the installation when they are executed as User, when a new user is created in the system, these changes are not applied.

I was doing some research and thought it would be a good idea to use Group Policy, but I've never really used it and I don't know how to use NTLite to make the system import and use this type of configuration.
 

blue-person

New Member
I'm assuming we're talking about W10 or W11? If so, there are many different ways to go about this, so you will probably get replies that are all very different from each other...In my opinion, the best method is to stop Windows from installing a default theme. This is why customization is difficult, as you have experienced, because many personalization settings will reset back to the defaults of the Aero theme that gets installed when a user is created. The fix is integrating some registry keys which tell the operating system to install no theme:

; Start > Settings > Personalization > Themes > None
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes]
"InstallTheme"=""
"InstallThemeLight"=""

; Start > Settings > Personalization > Themes > None
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Themes]
"InstallTheme"=""
"InstallThemeLight"=""

Note: there are a set of empty quotes at the end of these keys, because originally they point to the filepath of the Aero theme and by removing the filepath, the user provisioning will essentially skip the step of installing the theme file and move on to the next thing it has to do instead. These keys are verified to work on W10 21H2.

Once those keys are integrated into the image with NTLite, go ahead and install that image to see its effects. While you are at the Windows desktop, use a registry compare tool to capture all the personalization keys you need (to integrate into your image), or use the personalization options that NTLite has, whichever way you prefer. When you have all the keys you need, let NTLite handle how to integrate them, there's no need to worry about manually changing filepaths to be HKEY_USER or anything like that. The real issue here is the default Aero theme, and once that obstacle is gone the rest is smooth sailing.
First of all, yes, I am using Windows 10, specifically, an Enterprise LTSC. I forgot to mention it, sorry.

Now, I guess I could try, but I don't know how to import a theme onto the installation media. I think an easy way to do it would be to replace the files in '\Temp\NLTmpMount01', but I feel that doing this is a very "dirty" way to modify the system. I also don't know if it would be better to do it through 'sources\$OEM$\$$', or if it would do the same in practical terms.

How could I do it? Is there a more efficient way?
 

Hellbovine

Well-Known Member
I think you misunderstood what I wrote. I'm not saying you need to import a theme. Here's how W10 21H2 works as a quick non-technical example on an unmodified Windows:

You go through "Windows Setup" to format the drive and install the operating system files. Then eventually you get to the Windows Desktop, but before it lets you visibly see the desktop, it goes and installs the Aero theme using the registry key paths I listed, except that the keys normally point to the Aero theme filepath, instead of being blank, like they are in the ones I gave you.

By using the keys I supplied, Windows will skip the installation of the Aero theme, which then essentially "unlocks" a ton of customization options you normally cannot integrate because as soon as the Aero theme gets installed by Windows, it overwrites your settings. Try following what I said, it's extremely simple, just integrate those 2 keys into an NTlite image, install it, then look at how different Windows is once you reach the desktop.
 
Last edited:

blue-person

New Member
I think you misunderstood what I wrote. I'm not saying you need to import a theme. Here's how W10 21H2 works as a quick non-technical example on an unmodified Windows:

You go through "Windows Setup" to format the drive and install the operating system files. Then eventually you get to the Windows Desktop, but before it lets you visibly see the desktop, it goes and installs the Aero theme using the registry key paths I listed, except that the keys normally point to the Aero theme filepath, instead of being blank, like they are in the ones I gave you.

By using the keys I supplied, Windows will skip the installation of the Aero theme, which then essentially "unlocks" a ton of customization options you normally cannot integrate because as soon as the Aero theme gets installed by Windows, it overwrites your settings. Try following what I said, it's extremely simple, just integrate those 2 keys into an NTlite image, install it, then look at how different Windows is once you reach the desktop.

Oh, got it. Sorry, I was thinking of something different. I'll try. Thanks for answer so soon!
 

Hellbovine

Well-Known Member
Oh, got it. Sorry, I was thinking of something different. I'll try. Thanks for answer so soon!
As a way to quickly test this without reinstalling Windows, you should be able to install those 2 keys, then reboot the computer and create a new user. Login to the new user, and it should take you to the desktop with no theme installed, so you can see how different it is, and just how many settings the Aero theme overwrites if it were there.
 

garlin

Moderator
Staff member
Now, I guess I could try, but I don't know how to import a theme onto the installation media. I think an easy way to do it would be to replace the files in '\Temp\NLTmpMount01', but I feel that doing this is a very "dirty" way to modify the system. I also don't know if it would be better to do it through 'sources\$OEM$\$$', or if it would do the same in practical terms.

How could I do it? Is there a more efficient way?
Time for today's side lesson on TrustedInstaller vs OEM folders.

Windows protects specific system files (or what it considers "critical") like kernel DLL's, pre-installed drivers, Defender, and yes wallpapers -- by having TrustedInstaller own them. TrustedInstaller is a security level above SYSTEM or Administrator, to prevent you tampering with them.

When NTLite mounts an image, those folder and file permissions are preserved. To get around the security issue, two workarounds are offered.
BAD - Use takeown & icacls commands to take ownership of the files.
GOOD - Use PowerRun or NSudo to temporarily grant you CMD or Explorer rights as TrustedInstaller.

takeown & icacls can lead to unfortunate user errors, in both executing the commands and worse not restoring their original state.
If you're granted TI rights, then you can edit any file in NLTmp folder.

The longer way to avoid this problem, is to use OEM Setup folders to write any content after the WIM is extracted. This also works, but all copied files are owned by SYSTEM, while it doesn't impact wallpapers -- can mess up other expected permissions. Files inside the NLTmp folder are stored inside the WIM: any changes require loading and saving to WIM.

Files inside the OEM folders live in the image folder, and can be modified at any time before the ISO is created -- without opening WIM.

Both methods work equally well for normal files like a wallpaper. If you're doing what you feel is an one-time (or rare) edit, then edit the file directly in NLTmp. For files you may want to change more often, OEM folders are a simpler answer.
 

Clanger

Moderator
Staff member
taking ownership of registry keys can mess a system up too, running "elevated" only when its needed is the much safer option.
 

Kasual

Well-Known Member
First of all, yes, I am using Windows 10, specifically, an Enterprise LTSC. I forgot to mention it, sorry.

Now, I guess I could try, but I don't know how to import a theme onto the installation media. I think an easy way to do it would be to replace the files in '\Temp\NLTmpMount01', but I feel that doing this is a very "dirty" way to modify the system. I also don't know if it would be better to do it through 'sources\$OEM$\$$', or if it would do the same in practical terms.

How could I do it? Is there a more efficient way?
Remove themes in components, add your theme in $$\Resources\Themes called Aero.theme, that should be fine, replacing files in mounted images also needs to have replaced in winsxs or setup will replace by stock files.

I've actually already tried running the .reg's as both Machine and User. Despite the fact that the changes are maintained at the end of the installation when they are executed as User, when a new user is created in the system, these changes are not applied.
Some reg files need to be integrated after log in.
 

Hellbovine

Well-Known Member
I took some time last night to create a registry file, and instructions, that I believe does everything blue-person is asking for, also to their specific requests about finding a clean, non-hacky solution. I wanted to add this because my gut is telling me that many people may be giving up on this topic, or settling, rather than finding a solution they like. The internet is rampant with people asking these same questions, and they often go unresolved, so hopefully this working solution will provide people a starting point so they can see it can be done.

INSTRUCTIONS:
1) Run NTLite as an administrator. Once it is loaded, go to "Image" at the top, click "Add" then select "Image directory" and point to the Windows image folder you want to modify. If you are unsure of this step, then see this guide (link). Right-click on the Windows image and select "Load" and wait until it is finished. Right-click on the image again and now select "Explore mount directory" which lets you browse the files inside.

2) Inside the mounted directory, go into the "Windows" folder, then the "Web" folder, and now right-click and create a new folder (you should also see folders for 4K, Screen, and Wallpaper here). Name the new folder Custom with a capital "C" and then open it and paste your custom picture inside, and be sure to name this picture as Wallpaper with a capital "W". If your image is not already in .png format you will either need to convert it, or edit the attached registry file so that the 2 instances of "Wallpaper.png" now appear as "Wallpaper.jpg" or whichever format your picture is in. This new picture will be used as both the default wallpaper on the desktop and also the Lock Screen.

3) After you finish with the mounted directory, exit out of that window and go back into the NTLite program. On the left menu, select "Registry" and then click "Add" from the menu at the top, choose "Registry files" and point it to wherever you saved the attached registry file that you downloaded.

4) To finalize the changes, click "Apply" from the menu on the left, then click "Process" and wait for it to finish. Exit out of NTLite, then copy all of the files inside the edited Windows image folder to a formatted USB (NTFS or exFat), then boot to that USB to install your modified Windows.

Note: OP mentioned they were on Enterprise edition, and for brevity sake I took the easy route and used an Enterprise-only policy to address the Lock Screen, as such that specific registry key will not work on Pro/Home. It should go without saying that this solution is specific to one person, and other people should only use it as a learning experience to craft something for their needs.
 

Attachments

  • Purple.reg
    2.2 KB
Last edited:
Top