Jump to content

How is "Program Files" and its sub-directories created?


Recommended Posts

OK, this is tough to work out - I stripped a lot of stuff out of Windows...

... but nevermind all that - all I want to ask is, how do these 2 folders get created when Windows installs:

%ProgramFiles%\Windows Media Player

%ProgramFiles%\Internet Explorer

If the question was "How does system32 get created" the answer would be:

In I386 there is a file "TXTSETUP.SIF". Open this with Notepad and VOILA! there it is under [WinntDirectories] like so:

[WinntDirectories]

1 = "\"

2 = system32

3 = system32\config

4 = system32\drivers

5 = system

7 = system32\ras

9 = system32\spool

10 = system32\spool\drivers

11 = system32\spool\drivers\w32x86\3

12 = system32\spool\prtprocs

13 = system32\spool\prtprocs\w32x86

14 = system32\wins

15 = system32\dhcp

16 = repair

17 = system32\drivers\etc

18 = system32\spool\drivers\w32x86

19 = system32\drivers\disdn

20 = inf

21 = Help

22 = Fonts

23 = Config

24 = msagent\intl

25 = Cursors

26 = Media

This is as the section implies "WINNT" directories (its called "WINDOWS" in XP, WINNT is from Windows 2000 but I guess Microsoft just skimped a bit here and called the section in the TXTSETUP.SIF file for XP "[WinntDirectories]")

So thats it man, all this refers to is Windows directories, theres no mention of "Documents and settings" or "Program Files" so how are THOSE folders created?

Totally perplexed as to how Windows makes these folders. :(

Link to comment
Share on other sites


You can define Documents and settings folder name and location in HIVESFT.INF: change the value of DEFAULT_PROFILES_DIR under the String section.

I'd be interested to know about Program Files folder too. But it's not as easy. Maybe it's hardcoded in on of the system DLL files.

Link to comment
Share on other sites

It's important to conceptualize this:

text mode setup is dumb. It doesn't have any plug and play and no logging. Therefore everything has to be statically set. When you run test mode setup, it uses txtsetup.sif to build the windows folder, as you've noticed. Everything in txtsetup.sif is relative to the windows folder. Once text mode setup is done you only have a windows folder, not documents and settings or program files.

It is in the 32 bit gui mode setup that user programs are installing using syssetup.inf. Syssetup.inf calls wmp.inf and other wmp inf's which install media player. Syssetup.inf also calls ie.inf during the inf.always phase. the file used by gui mode setup and post setup is layout.inf. This file is used to determine where the files go to.

-gosh

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...