Customizing the Windows installer
January 7, 2023 12:22 AM   Subscribe

A long time ago you used to be able to add a config file to the Windows operating system installer that let you customize certain aspects. I'm looking to do that with Win11 and search results are full of garbage.

The specific aspect that I'm interested in changing are things like the name of the program files directory, the name of the users directory, name of the Windows directory, etc.

When you search for this, you get a whole lot of results of why you can't rename C:\Program Files\ because its baked into so many locations. That doesn't apply here, because I'm asking how to instruct the operating system installer to use a different name, such that it will be changed for the whole life of the system, not renaming it after the fact. I know this must be possible in some form because the operating system uses localized names, for example it will use C:\Archivos de programa\ on Spanish versions of Windows.

The same applies to the C:\Users\ directory. Search results are absolutely flooded with how to change the user profile name (e.g. C:\Users\foo\ to C:\Users\bar\) but not how to change the Users part. And to reiterate, I'm not trying to rename anything, I want to change it in the installer.

I'm looking for documentation on how to customize the install media ISO/flash drive with a config file that might allow specifying these paths (for Windows 11.) Maybe Microsoft has removed this functionality? I'd like to hear from seasoned Windows sysadmins on whether this is possible, and I can't believe google results are so shit.
posted by Otto Franz Joseph Leopold von Soxen-Puppetten to Computers & Internet (8 answers total) 2 users marked this as a favorite
 
Those paths are based on the Windows Locale.

When you download a Windows 10 ISO, you are asked to select a language and this will bake in some of those locale dependent strings.
https://www.microsoft.com/en-gb/software-download/windows10ISO

It is possible to add additional locale and languages to a base image, but I think the base will still use it's original locale settings for program file locations and a bunch of other things.
posted by Lanark at 6:31 AM on January 7, 2023 [1 favorite]


I've no idea if that is still possible. Can you remember the name of the configuration file that used to make it possible, or the names of the settings in it? That at least might help find some more relevant search results.

On an installed system, the "Program Files" location is set by the ProgramFilesDir registry subkey under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion.

Unfortunately searching for "ProgramFilesDir" just finds hundreds of pages explaining how to change it on an already-installed system or why you shouldn't.
posted by automatronic at 7:01 AM on January 7, 2023


Best answer: Right, my memory has just been jogged.

This used to be possible via an unattend.txt file, in INI format, for Windows XP.

Later versions use an unattend.xml file. Microsoft calls this an "Answer File" and the documentation about it is here, with the list of available settings available under here.

However, the ability to change these locations seems to have been removed (it was never officially supported, even on XP).

A possible workaround might be to move the directory after installation, and create a symbolic link from the normal location to the custom location, but I doubt you'd be able to do that on a running Windows system - you'd need to mount the disk from an OS booted off something else.
posted by automatronic at 7:26 AM on January 7, 2023 [2 favorites]


Best answer: Speaking as a seasoned Windows sysadmin, I strongly recommend taking all the advice on why you shouldn't move these things.

Most of the seasoning that Windows sysadmins accumulate involves becoming resigned to the sad fact that the further you shift a Windows installation away from the Microsoft defaults, the more shit is going to break in weird and obscure ways that create endless grief for your users and endless work for you. Customization is to be avoided if at all possible.

If I were still working as a Windows sysadmin and my boss asked me to make an unattended Windows installer that used nonstandard pathnames for the Windows installation folder, or the profiles root folder, or the %ProgramFiles%, %ProgramFiles(x86)% or %ProgramData% folders, I'd need to have the reasons why doing so was necessary spelt out in excruciating detail, and my most likely reaction would be to research and suggest workarounds for each of those reasons before I went anywhere near customizing Windows.
posted by flabdablet at 7:26 AM on January 7, 2023 [8 favorites]


Agree with flabdablet....I would be shocked if Windows11 didn't give you the option to do everything you want...it might be in the Win11 Enterprise SKU but it is likely still there.

With that said, I have definitely been on multi-week support escalations for software that didn't install/work properly because the installer had hard coded paths rather than use the APIs to discover the right paths at install time.
posted by mmascolino at 8:07 AM on January 7, 2023


I think what you want to search for is "group policy".
posted by jeffamaphone at 1:01 PM on January 7, 2023


Response by poster: The last time I did this it was indeed XP and I changed C:\Windows to C:\WinXP. I don't recall exactly why, but it worked fine.

I looked through the documentation in automatronic's link and didn't see anything about renaming paths, so I think I will just drop it. It was a pipe dream that perhaps this was easily possible. Thanks everyone.
posted by Otto Franz Joseph Leopold von Soxen-Puppetten at 2:48 PM on January 7, 2023


An alternate way is using sysprep— you set up the machine in the way you need it, then run sysprep with the OOBE (out of box experience) option. It essentially resets the machine to a fresh installer (but with your customizations baked in). You then image it, and use that to clone to other machines.
posted by Static Vagabond at 5:02 PM on January 7, 2023 [1 favorite]


« Older Best magnifying safety glasses?   |   How to deal with rude colleagues? Newer »
This thread is closed to new comments.