How to create empty folders during setup?

Questions about Update Pack making? Ask here.
Post Reply
newsposter
Posts: 1131
Joined: Wed Sep 14, 2005 11:31 am

How to create empty folders during setup?

Post by newsposter » Thu Feb 19, 2009 6:18 pm

Would someone kindly work up an example .ini/.inf (to be held in an AddOn) that I can use to create some empty folders during XP setup?

I'm looking for some annotated sample code. A working one-liner would be more than sufficient.

Thanks!

User avatar
ricktendo64
Posts: 3213
Joined: Mon May 22, 2006 12:27 am
Location: Honduras

Post by ricktendo64 » Thu Feb 19, 2009 10:25 pm

Well there are several tricks I use, 1st you can use blank.txt file from the i386 dir to create some dirs:

Code: Select all

[Version]
signature="$Windows NT$"
LayoutFile=layout.inf

[Optional Components]
Blank

[Blank]
OptionDesc  ="Blank"
Tip         ="Creates empty folders."
Modes       =0,1,2,3
CopyFiles   =ProgFiles.Folder,System32.Folder

[DestinationDirs]
ProgFiles.Folder=16422,FolderName
System32.Folder=11,FolderName

[ProgFiles.Folder]
blank.txt

[System32.Folder]
blank.txt
No need for SourceDisksNames/Files for this inf since blank.txt is already listed in layout.inf, dosnet.inf and txtsetup.sif

But what I prefer is to use RegisterDLLs to call CMD.EXE to create a dir:

Code: Select all

[Version]
signature="$Windows NT$"

[Optional Components]
Blank

[Blank]
OptionDesc  ="Blank"
Tip         ="Creates empty folders."
Modes       =0,1,2,3
RegisterDLLs=ProgFiles.Folder,System32.Folder

[ProgFiles.Folder]
11,,cmd.exe,,,"/c md ""%16422%\FolderName"""

[System32.Folder]
11,,cmd.exe,,,"/c md %11%\FolderName"
Dont worry you will not see any ugly CMD windows, RegisterDLLs will hide them by default

newsposter
Posts: 1131
Joined: Wed Sep 14, 2005 11:31 am

Post by newsposter » Fri Feb 20, 2009 3:03 am

I'm trying to setup about 6 empty dirs for 'future use' *and* jam some registry presets.

Not to worry, no HKCU stuff, just HKLM keys.

Very tasty, and thanks!!!

User avatar
crashfly
Posts: 789
Joined: Thu Mar 13, 2008 11:39 pm
Location: Arkansas, USA

Post by crashfly » Fri Feb 20, 2009 3:26 pm

Depending on where you want the directories, you might not even have to do that.

If you use the $OEM$ directory, you can create the directories from that procedure during setup. This mainly works if you are creating directories on the system drive that the OS is being installed to.

Something else to consider is to have the commands to run during "cmdlines.txt" portion of the setup. It could also perform the same functions instead of integrating another addon.
A mind is like a parachute, it only functions when it is open.
--Anonymous

How to Ask Questions the Smart Way

User avatar
ricktendo64
Posts: 3213
Joined: Mon May 22, 2006 12:27 am
Location: Honduras

Post by ricktendo64 » Fri Feb 20, 2009 3:59 pm

If they are system directories you dont even have to do that, you can simply use [txtsetup_dirs] in your entries.ini to add a new number and dir...you dont have to add any files to copy in [txtsetup_files] it will create the dir no matter what

Code: Select all

[txtsetup_dirs]
XXX=system32\FolderName

newsposter
Posts: 1131
Joined: Wed Sep 14, 2005 11:31 am

Post by newsposter » Fri Feb 20, 2009 6:18 pm

all of the folders I need to create are in %SystemDrive%/Program Files

Post Reply