Jump to content
thedexmonster

Relocate Windows folders before populated during install

Recommended Posts

I am attempting to modify %ProgramFiles% and %ProgramFiles(x86)% definitions as well as a few minor directories during setup. What I am not sure of is where or when to apply this so windows copies the least amount of files to the default locations.

If I have to, I will write a script that finds and replaces any registry entries already modified and use the results of the script to move those files to their new locations.

 

Any guidance is greatly appreciated! Comments also!!

 

I plan on using registry entries like the following.

 

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment]
"CSIDL_PROGRAM_FILES"="F:\\Program Files\\"
"CSIDL_PROGRAM_FILESX86"="F:\\Program Files (x86)\\"
"Users"="F:\\Users"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
"CSIDL_PROGRAM_FILES"="F:\\Program Files\\"
"CSIDL_PROGRAM_FILESX86"="F:\\Program Files (x86)\\"
"Users"="F:\\Users"


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion]
"CommonFilesDir"="F:\\Program Files\\Common Files"
"CommonFilesDir (x86)"="F:\\Program Files (x86)\\Common Files"
"CommonW6432Dir"="F:\\Program Files\\Common Files"
"ProgramFilesDir"="F:\\Program Files"
"ProgramFilesDir (x86)"="F:\\Program Files (x86)"
"ProgramW6432Dir"="F:\\Program Files"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"Common Desktop"="F:\\Users\\All Users\\Desktop"
"Common Start Menu"="F:\\Users\\All Users\\Start Menu"
"CommonVideo"="F:\\Users\\All Users\\Media"
"CommonPictures"="F:\\Users\\All Users\\Media"
"Common Programs"="F:\\Users\\All Users\\Start Menu\\Programs"
"CommonMusic"="F:\\Users\\All Users\\Media"
"Common Administrative Tools"="F:\\Users\\All Users\\Start Menu\\Programs\\Administrative Tools"
"Common Startup"="F:\\Users\\All Users\\Start Menu\\Programs\\Startup"
"Common Documents"="F:\\Users\\All Users\\Documents"
"OEM Links"="F:\\Users\\All Users\\Links"
"Common Templates"="F:\\Users\\All Users\\Templates"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
"CommonPictures"=hex(2):25,00,50,00,55,00,42,00,4c,00,49,00,43,00,25,00,5c,00,\
  4d,00,65,00,64,00,69,00,61,00,00,00
"CommonMusic"=hex(2):25,00,50,00,55,00,42,00,4c,00,49,00,43,00,25,00,5c,00,4d,\
  00,65,00,64,00,69,00,61,00,00,00
"CommonVideo"=hex(2):25,00,50,00,55,00,42,00,4c,00,49,00,43,00,25,00,5c,00,4d,\
  00,65,00,64,00,69,00,61,00,00,00
"Common Start Menu"=hex(2):25,00,50,00,55,00,42,00,4c,00,49,00,43,00,25,00,5c,\
  00,53,00,74,00,61,00,72,00,74,00,20,00,4d,00,65,00,6e,00,75,00,00,00
"Common Programs"=hex(2):25,00,50,00,55,00,42,00,4c,00,49,00,43,00,25,00,5c,00,\
  53,00,74,00,61,00,72,00,74,00,20,00,4d,00,65,00,6e,00,75,00,5c,00,50,00,72,\
  00,6f,00,67,00,72,00,61,00,6d,00,73,00,00,00
"Common Startup"=hex(2):25,00,50,00,55,00,42,00,4c,00,49,00,43,00,25,00,5c,00,\
  53,00,74,00,61,00,72,00,74,00,20,00,4d,00,65,00,6e,00,75,00,5c,00,50,00,72,\
  00,6f,00,67,00,72,00,61,00,6d,00,73,00,5c,00,53,00,74,00,61,00,72,00,74,00,\
  75,00,70,00,00,00
"Common Templates"=hex(2):25,00,50,00,55,00,42,00,4c,00,49,00,43,00,25,00,5c,\
  00,54,00,65,00,6d,00,70,00,6c,00,61,00,74,00,65,00,73,00,00,00


  [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList]
"Public"=hex(2):25,00,55,00,73,00,65,00,72,00,73,00,25,00,5c,00,50,00,75,00,62,\
  00,6c,00,69,00,63,00,00,00
 
  [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\ProfileList]
"Public"=hex(2):25,00,55,00,73,00,65,00,72,00,73,00,25,00,5c,00,50,00,75,00,62,\
  00,6c,00,69,00,63,00,00,00


[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion]
"CommonFilesDir"="F:\\Program Files (x86)\\Common Files"
"CommonFilesDir (x86)"="F:\\Program Files (x86)\\Common Files"
"CommonW6432Dir"="F:\\Program Files\\Common Files"
"ProgramFilesDir"="F:\\Program Files (x86)"
"ProgramFilesDir (x86)"="F:\\Program Files (x86)"
"ProgramW6432Dir"="F:\\Program Files"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\explorer\Shell Folders]
"Common Desktop"="F:\\Users\\All Users\\Desktop"
"Common Start Menu"="F:\\Users\\All Users\\Start Menu"
"CommonVideo"="F:\\Users\\All Users\\Media"
"CommonPictures"="F:\\Users\\All Users\\Media"
"Common Programs"="F:\\Users\\All Users\\Start Menu\\Programs"
"CommonMusic"="F:\\Users\\All Users\\Media"
"Common Administrative Tools"="F:\\Users\\All Users\\Start Menu\\Programs\\Administrative Tools"
"Common Startup"="F:\\Users\\All Users\\Start Menu\\Programs\\Startup"
"Common Documents"="F:\\Users\\All Users\\Documents"
"OEM Links"="F:\\Users\\All Users\\Links"
"Common Templates"="F:\\Users\\All Users\\Templates"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\explorer\User Shell Folders]
"CommonPictures"=hex(2):25,00,50,00,55,00,42,00,4c,00,49,00,43,00,25,00,5c,00,\
  4d,00,65,00,64,00,69,00,61,00,00,00
"CommonMusic"=hex(2):25,00,50,00,55,00,42,00,4c,00,49,00,43,00,25,00,5c,00,4d,\
  00,65,00,64,00,69,00,61,00,00,00
"CommonVideo"=hex(2):25,00,50,00,55,00,42,00,4c,00,49,00,43,00,25,00,5c,00,4d,\
  00,65,00,64,00,69,00,61,00,00,00
"Common Start Menu"=hex(2):25,00,50,00,55,00,42,00,4c,00,49,00,43,00,25,00,5c,\
  00,53,00,74,00,61,00,72,00,74,00,20,00,4d,00,65,00,6e,00,75,00,00,00
"Common Programs"=hex(2):25,00,50,00,55,00,42,00,4c,00,49,00,43,00,25,00,5c,00,\
  53,00,74,00,61,00,72,00,74,00,20,00,4d,00,65,00,6e,00,75,00,5c,00,50,00,72,\
  00,6f,00,67,00,72,00,61,00,6d,00,73,00,00,00
"Common Startup"=hex(2):25,00,50,00,55,00,42,00,4c,00,49,00,43,00,25,00,5c,00,\
  53,00,74,00,61,00,72,00,74,00,20,00,4d,00,65,00,6e,00,75,00,5c,00,50,00,72,\
  00,6f,00,67,00,72,00,61,00,6d,00,73,00,5c,00,53,00,74,00,61,00,72,00,74,00,\
  75,00,70,00,00,00
"Common Templates"=hex(2):25,00,50,00,55,00,42,00,4c,00,49,00,43,00,25,00,5c,\
  00,54,00,65,00,6d,00,70,00,6c,00,61,00,74,00,65,00,73,00,00,00

Share this post


Link to post
Share on other sites

Instead of messing around with global (system) environment variables (generally regarded as a bad idea), why not just use a symbolic link?

http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/

http://www.windows7home.net/how-to-create-symbolic-link-in-windows-7/

Share this post


Link to post
Share on other sites

I would consider that as an option as well, as long as I can run it in the installation process before a bunch of things are assigned the value of the variable in question. Any ideas there?

Share this post


Link to post
Share on other sites

Most of those customization options for the directories can be specified in the "autounattend" file.  There should be several places floating around that explains those options.  (Best bet would probably be Microsoft's own site for that information.)

Share this post


Link to post
Share on other sites

Well, I realize this would take way more effort than it's worth (if it's even possible) so I've given up :|. Everything gets linked properly but none of the files are originally placed in their modified locations. Causes a few problems... More advanced than I, just hoped I could simply trick the OS into doing what I asked.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...