Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Win7 renaming Windows installation directory

unattended win7 renaming

  • Please log in to reply
5 replies to this topic

#1
mrjrt

mrjrt

    Newbie

  • Member
  • 11 posts
  • Joined 19-November 10
  • OS:XP Pro x86

Hello all.

 

Just wondering if anyone can shed any light on my current quandry....I'm doing a spot of customisation and I'd like to rename the Windows directory. I was able to accomplish this in Windows XP by using:

[SetupData]
DefaultPath=\WinXP

...in TXTSETUP.SIF, but I can't find the equivalent functionality in Windows 7's install process. I have a similar problem with the "Program Files" directories. In XP's setup I was able to alter those using:

[Unattended]
ProgramFilesDir="\Local"
CommonProgramFilesDir="\Local\Common Files"

...in WINNT.SIF, but again, I can't find the equivalent functionality in Windows 7's install process. At least with the latter you can copy them, edit the registry and then delete the orignals. Not exactly an option with the system directory though.

 

My other avenue of enquiry is to make the changes into the WIM directly - rename the folders there and update the registry hives with the updated paths rather than trying to script the changes. The main hiccup I foresee is the bootloader probably generating the initial listing with the default path rather than looking up anything in the registry...anyone tried this already?

 

I know I could just hard link the names I want to the directories default names and then hide the default directories, but I do a lot of system-level work, so running with hidden files & directories isn't really an option for me.




How to remove advertisement from MSFN

#2
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,579 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Possibly some useful info in this thread:
http://www.msfn.org/...rs-a-subfolder/

 

jaclaz



#3
JFX

JFX

    Advanced Member

  • Member
  • PipPipPip
  • 471 posts
  • Joined 17-January 11
  • OS:Windows 7 x64
  • Country: Country Flag

You can't change the Windows folder path since Vista.

Doing it manually will only break your windows installation.



#4
mrjrt

mrjrt

    Newbie

  • Member
  • 11 posts
  • Joined 19-November 10
  • OS:XP Pro x86

Well, I gave up on my attempt (covered in another thread) to make this all configurable using custom autounattend.xml sections and piggybacking off setup.exe (couldn't suppress offline setup's reboot to give it time to do its thing), and decided to go back to modifying the install image directly (dirs and registry). The Program Files twins are quite happy in their new locations, and I've just finished up modifying the system and profiles dirs. I suspect if there's a problem it'll be with the system dir...but given WinPE's happy running from X:\Windows, I have hope it'll work...

 

...but that fateful install can wait until tomorrow.



#5
mrjrt

mrjrt

    Newbie

  • Member
  • 11 posts
  • Joined 19-November 10
  • OS:XP Pro x86

Weeeell, seems I've had some partial luck with my experiments that I figured I should share with people on the off-chance they come in useful. I don't expect anyone to consider this a good idea - but I always take being told you can't do something you used to be able to do as a challenge - hence why I stuck at it ;)

 

Basically, Windows quite happily supports running from a directory with any name, as I thought.

 

What fails however is dism.exe and dismhost.exe - these seem to have some horrible bugs forcing you to have a C:\Windows directory. dism.exe has a parameter that lets you specify the windows directory, but in my tests it seems to ignore this. I used my shim to rewrite the command line args being passed to the correct ones and some DISM functionality doesn't even try to use it - it just goes straight for C:\Windows. I tested this using ProcessMonitor with which I watched what was happening during the installation.

 

My set up was preparing my image with a renamed directory and a pre-edited offline registry (as mentioned before, ideally I want to transform a clean image dynamically so it's configurable - but this test is a proof of concept) - the first bit of setup copies this across fine. Setup then tries to fix up the offline registry - but annoyingly does so by - you guessed it - explicitly loading the hives from "c:\Windows\System32\config\". Workaround there is to add a junction back to the desired location and this bit then completes fine. The final phase is to install all the packages etc. and this is where dism's bugs come to the fore - despite the shim you still get the occasional access via C:\Windows - minimal, but still there.

 

Right at the very end however another bug pops up - "CBS", whatever it is, has a bug with paths - my desired path here is "C:\SBin\x86_64-Win64" - however this bit tries "C:\x86_64-Win64". Workaround here is another temporary junction and that gets you past it.

 

I've just let it finish downloading and installing all the updates and I now have a fully working up to date system with my system root in a non-standard location.



#6
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,579 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Very good. :)

If and when you will have time it would be nice if you could post a more detailed list of the steps involved, which I am sure would be very useful to those wishing to install to "non-C:\Windows" :yes:

 

jaclaz







Also tagged with one or more of these keywords: unattended, win7, renaming

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users