Jump to content

Automatic Partitioning for unattended installs


Recommended Posts

So I’m trying to create an automated windows install plus office install dvd. Office is under control and works perfectly. Unattending windows is no problem in itself. However, here’s the kink. We need to repartition hard disk 1 into a 25gb C drive and the rest as a D drive. Hard drives range in size from 40gb to 300gb. Sounds simple right? If you were running the standard XP install it’s a cakewalk. However, we want this fully automated.

I used the winnt.sif reference page to create my unattended install. As you know it says:

Repartition=No

Specifies whether to delete all partitions on the first drive of the client computer and to reformat the drive with the NTFS file system automatically.

This is the only place other than to prompt for partition info or not that it talks about partitioning. So that’s the choice, leave everything as is, or repartition to a single partition. What should be very simple has become a month long quest for me. I have tried so many ways of doing this and failed at all of them. Partition Magic scripting (at least I thought it used to have scripting) has been removed by Symantec. I tried Partition Manager, even paid 300 bucks for it. It supposedly has scripting but we have as of yet been able to get it to work without breaking windows to the point that it doesn’t even boot into safe mode. I’ve worked with their tech support and stumped them. Hopefully I can return that crappy software.

I tried windows 98 emulation and fdisk scripting, no dice. Lastely I’ve tried FreeFDISK from http://www.23cc.com/free-fdisk/ and it’s got me soooo close I can taste it.

Here’s where I’m at. I created a windows 98 bootdisk and used nero to make the bootable dvd. I altered the autoexec.bat to execute mscdex and smartdrv then prompt the user to select which dvddrive the cd is in since I can’t find a way to automate that (I tried using IF EXIST <filename> but if there’s no disk in the drive then dos gives an abort/retry/fail error) using the choice command. Then autoexec executes the freefdisk commands off the CD. It repartitions the drive perfectly even accounting for the unknown size of the D drive, it just maximizes it. Then autoexec tries to execute the windows install using the command:

X:\i386\winnt.exe /s:x:\i386 /u:x:\i386\winnt.sif

And it promptly tells me it doesn’t have swap space. Now if I format the C partition with fat32 the install kicks off but then midway through says it can’t find a bunch of files… sigh. Even if it were to install, then its fat32 and I've not even started looking into automatically converting it.

Any thoughts? Questions? Suggestions? I’m all ears.

Link to comment
Share on other sites


Hi!

Repartition=No <-- Only valid if using RIS, not ordinary unattended.txt installations!

I would urge u to use WinPE to partition ur machines prior to the intended Windows setup. If WinPE is not within your license agreement, then use BartPE which will provide u with a much environment to acchieve what u want compared to MS-DOS thingy's...

About the convert issue from FAT32 to NTFS, there is either an entry in the unattended.txt:

[unattended]

FileSystem = ConvertNTFS

or u could perform the same actions from within WinPE/BartPE using the convert.exe command...

Link to comment
Share on other sites

X:\i386\winnt.exe /s:x:\i386 /u:x:\i386\winnt.sif

And it promptly tells me it doesn’t have swap space. Now if I format the C partition with fat32 the install kicks off but then midway through says it can’t find a bunch of files… sigh.

try adding

/tempdrive:c:

or

/tempdrive:c

(sorry, I can't remember if it needs the trailing colon.

Use the above post suggestion to convert it to NTFS...

Post back to let us know how it goes! Check here for the full command lines...

http://www.microsoft.com/resources/documen...w.mspx?mfr=true

Edited by JuMz
Link to comment
Share on other sites

I tried adding the tempdrive command since that was the easiest and it worked but XP still dies halfway through saying it can't find a bunch of files.

I didn't realize WinPE did this sort of thing, I always thought it was just a liveCD so I picked up a copy of it and we're trying to get it working. I think the problem now is that I don't have the OPK (our license manager was out of the office this afternoon) so we used a dos utility to create a bootable winPE disk and that works, we get into a 32 bit shell with a command window that only runs startnet. I configured the winbom.ini and we tried extracting the boot img from that cd and throwing it all together with XP and office but it still just stopped at the same point after startnet.cmd. End of the day at that point so I'll pick it back up tomorrow. I didn't try diskpart, that's not going to run in dos 6.22 is it?

Thanks for your help guys, I think winpe is definitely the best bet.

Link to comment
Share on other sites

I tried adding the tempdrive command since that was the easiest and it worked but XP still dies halfway through saying it can't find a bunch of files.

Could you please elaborate a little more? What EXACTLY is the error message?

I configured the winbom.ini and we tried extracting the boot img from that cd and throwing it all together with XP and office but it still just stopped at the same point after startnet.cmd.

Could you be a little more specific in your steps here? Startnet.cmd is automatically launched upon entering WinPE. In there, in order for the winbom.ini file to be read, you need to first launch factory -winpe.

Did you run the winnt32 version of the installation of XP?

Link to comment
Share on other sites

There are loads of info on how to use/cutomize WinPE with the WinPE forum, basic flow of the installation sequence when launching XP from WinPE is:

1. Creating a custom WinPE, using the OPK

1. Boot into WinPE

2. Startnet.cmd runs

3. Execute diskpart script

4. Execute format of drive

5. Launching Winnt32.exe to run a GUI setup of WinXP/2003...

Link to comment
Share on other sites

JuMz,

I didn't elaborate on the error since I'd given up on that process of doing unattended installs. If I remember right it says Windows can't find the file xxxx.xxx and asks us to locate it. That cdrw has been blown away so I can't reproduce it anymore and it's an obsolete process.

startnet.cmd executes one command. factory -winpe. Everything else is inside winbom:

[Factory]
WinBOMType=WinPE
Reseal=No
[WinPE]
Restart=No
[DiskConfig]
Disk1 = disk1.Config
[disk1.Config]
WipeDisk = Yes
Size1 = 25000
Size2 = *
PartitionType1 = Primary
PartitionType2 = Primary
FileSystem1 = NTFS
FileSystem2 = NTFS
ForceFormat = Yes
QuickFormat1 = Yes
QuickFormat2 = Yes
SetActive1 = Yes
[OemRunOnce]
md c:\install
md c:\install\office
xcopy x:\i386\office\*.* c:\install\office /e /y
x:\xppro\i386\winnt32 /dudisable /makelocalsource /s:x:\xppro\i386 /unattend:x:\xppro\i386\winnt.sif
[PnPDriverUpdate]
[PnPDrivers]
[NetCards]
[UpdateInis]
[FactoryRunOnce]
[Branding]
[AppPreInstall]

Link to comment
Share on other sites

Hmm, my winbom.ini is very similar, except I run the winnt32 install outside of the winbom (in startnet, after factory -winpe)...

Focusing on the Windows error a little more (as I think the problem is with your installation source and not with WinPE or formatting)...Do you receive the error during the 32bit part of the install (i.e. in WinPE) or after it reboots and in Textmode...If you receive the 'cannot find file' error during the 32bit part, that means there is an entry in your dosnet.inf in your I386 folder pointing to a file that does not exisist in the actual installation source. However, if the error occurs during the textmode portion, then it is possible that The dosnet.inf didn't copy a file the txtsetup.sif was expecting to find (this controls what files are copied during the textmode portion of the setup). This is usually due to the lack of entry of that file in the dosnet.inf

How have you modified your installation source? (i.e. Nlite or RVM, etc).

**EDIT: It seems I have made an error on the commandlines my winnt32 uses. Here is what I use:

winnt32 /syspart:%InstallDrive% /s:%SetupFiles% /makelocalsource:all /unattend:%AnswerFile% /noreboot

It is VERY important that you use the :all if you wish to include the CMPNENTS folder as part of your install...I also use the /noreboot so the setup doesn't boot it out of WinPE before it is finished. I actually don't use the /tempdrive but /syspart instead. Through my experience, If I didn't have the /syspart, the winnt32 setup would through an error indicating that it could not find any valid system partitions on the drive...this was the only way I could resolve that...Just for completeness, my winbom.ini is as follows:

[Version]
signature=$CHICAGO$

[Factory]
WinBomType = WinPE
Reseal=No

[WinPE]
Restart=No

[DiskConfig]
Disk1 = First.Config


[First.Config]

WipeDisk = Yes
Size1 = *
PartitionType1 = Primary
FileSystem1 = NTFS
QuickFormat1 = Yes
SetActive1 = Yes

Edited by JuMz
Link to comment
Share on other sites

Hmm, my winbom.ini is very similar, except I run the winnt32 install outside of the winbom (in startnet, after factory -winpe)...

Focusing on the Windows error a little more (as I think the problem is with your installation source and not with WinPE or formatting)...Do you receive the error during the 32bit part of the install (i.e. in WinPE) or after it reboots and in Textmode...If you receive the 'cannot find file' error during the 32bit part, that means there is an entry in your dosnet.inf in your I386 folder pointing to a file that does not exisist in the actual installation source. However, if the error occurs during the textmode portion, then it is possible that The dosnet.inf didn't copy a file the txtsetup.sif was expecting to find (this controls what files are copied during the textmode portion of the setup). This is usually due to the lack of entry of that file in the dosnet.inf

How have you modified your installation source? (i.e. Nlite or RVM, etc).

**EDIT: It seems I have made an error on the commandlines my winnt32 uses. Here is what I use:

winnt32 /syspart:%InstallDrive% /s:%SetupFiles% /makelocalsource:all /unattend:%AnswerFile% /noreboot

It is VERY important that you use the :all if you wish to include the CMPNENTS folder as part of your install...I also use the /noreboot so the setup doesn't boot it out of WinPE before it is finished. I actually don't use the /tempdrive but /syspart instead. Through my experience, If I didn't have the /syspart, the winnt32 setup would through an error indicating that it could not find any valid system partitions on the drive...this was the only way I could resolve that...Just for completeness, my winbom.ini is as follows:

It appears there was some confusion. We were getting the file copy errors back when we were doing the windows 98 dos install using winnt.exe . We are now booting winpe and doing some trial and error testing.

Link to comment
Share on other sites

Sorry about that. Just re-read the first post...

Have you tried this...

[Data]Answer File = Unattend.txt

AutoPartition

Installs Windows to the first available partition that has adequate space for a Windows installation and does not already contain an installed version of Windows.

Syntax AutoPartition = 1

Value 1

Example AutoPartition = 1

Comments Either omit the AutoPartition entry from your answer file or set the value of AutoPartition to 1. If AutoPartition = 1, the /tempdrive command-line option of Winnt32.exe is ignored during Setup. If you do not set the value, text-mode Setup installs Windows on the partition where $WIN_NT$.~LS is located.

It will install to the first available partition without repartitioning everything?

And with regards to the conversion of the Filesystem, I believe XP can do that...

FileSystem

Specifies whether to convert the primary partition to NTFS or to leave it alone.

Syntax FileSystem = ConvertNTFS LeaveAlone

Values ConvertNTFS

Converts the primary partition to NTFS.

LeaveAlone Does not change the primary partition file system.

Example FileSystem = ConvertNTFS

Comments This entry is provided for backward compatibility with the Windows 2000 unattended Setup.

For the Windows XP and Windows Server 2003 family of operating systems, if your manufacturing processes require that you format the hard disk as FAT32, use the Oformat tool to create a FAT32 volume with clusters aligned in an optimal way for later conversion to the NTFS file system. Then use the Convert command-line tool to convert the file system to NTFS.

You can also convert the partition during text-mode Setup by setting the FileSystem entry equal to ConvertNTFS. However, the hard drive performs better if you use Convert with Oformat and/or Cvtarea instead of using the FileSystem entry. For more information, see the Legacy Methods section of NTFS Preinstallation and Windows XP.

Note

If you plan to use ExtendOemPartition during Setup, the file system must be NTFS.

FileSystem is not a valid entry in Sysprep.inf.

This entry should be in the [unattended] section

Perhaps this entry may also help you...

ExtendOemPartition

Specifies whether to extend the partition on which you install Windows.

Syntax ExtendOemPartition = 0 | 1 | extra_size_in_MB

Values 0

Setup does not extend the partition.

1

Setup extends the partition to fill out the hard disk.

extra_size_in_MB

Setup increases the current partition size by this amount. This is useful if you want to configure more than one partition on the hard disk.

Example ExtendOemPartition = 1000

Comments This entry causes Setup to extend this destination partition into any available unpartitioned space that physically follows it on the disk.

ExtendOemPartition automatically leaves the last cylinder on the hard disk free to allow dynamic disk support.

Important

You can extend only NTFS file system partitions.

When you use ExtendOEMPartition in Sysprep.inf for imaged computers, the destination computer’s hard disk must be the same size or larger than the hard disk of the original master installation.

The partition that you want to extend must have unpartitioned space available following the partition.

If your manufacturing process requires FAT32, use the Oformat command-line tool included in the OEM Preinstallation Kit to format the hard disk so that you configure it for NTFS. Use the Convert command-line tool to convert the file system.

You can also convert the partition during text-mode Setup by setting the FileSystem entry in the [unattended] section of Unattend.txt to ConvertNTFS. FileSystem is not a valid entry in Sysprep.inf. However, the hard drive performs better if you use Convert with Oformat and/or Cvtarea instead of the FileSystem entry. For more information, see the Legacy Methods section of NTFS Preinstallation and Windows XP.

You can also use the ExtendPartition entry in the [ComputerSettings] section of Winbom.ini to extend the partition using the Factory tool.

Edited by JuMz
Link to comment
Share on other sites

We seem to be having a problem processing winbom.ini. Our CD boots, runs everything in startnet.cmd (which is factory -winpe) and then leaves us at a command prompt although there's plenty of stuff in winbom. I've seen the order that factory searches for winbom and the first one is a reg key, how can I check for reg keys on the cd?

Link to comment
Share on other sites

Which entry specifically in the winbom.ini do you have these keys in? I know that when you have the WinbomType = WinPE (as opposed to Factory or OOBE), only certain entries of the winbom.ini that pertain to that WinbomType are processed...

Link to comment
Share on other sites

Here's my latest winbom.ini which is on the root of the dvd.

[Factory]
WinBOMType=WinPE
Reseal=No
[WinPE]
Restart=No
[DiskConfig]
Disk1 = disk1.Config
[disk1.Config]
WipeDisk = Yes
Size1 = 25000
Size2 = *
PartitionType1 = Primary
PartitionType2 = Primary
FileSystem1 = NTFS
FileSystem2 = NTFS
ForceFormat = Yes
QuickFormat1 = Yes
QuickFormat2 = Yes
SetActive1 = Yes
[OemRunOnce]
md c:\install
xcopy x:\install\*.* c:\install /e /y
x:\xppro\i386\winnt32 /syspart /dudisable /makelocalsource /s:x:\xppro\i386 /unattend:x:\xppro\i386\winnt.sif
[WinPE.Net]
StartNet = No

Link to comment
Share on other sites

I have never used the OemRunOnce section before...not sure exactly how...Here is what the helpfile says...

[OEMRunOnce]Answer File = Winbom.ini

WinbomType = WinPE, Factory

The [OEMRunOnce] section enables you to control how and when external applications and command shell scripts run when auditing the computer in the factory environment, using the Sysprep -factory command.

You can run any application or command shell script accessible on the local computer or on the network (if you specify a network adapter).

Applications and command shell scripts called in the [OEMRunOnce] section process synchronously. Each application or script runs in the order specified in the [OEMRunOnce] section, and each application or script must finish before the next command runs.

Verify that all applications and shell command scripts listed in this section run in a fully automated way. If the application or script stops for end user input, or for any other reason requiring end-user interaction, the process eventually times out and logs an error.

The applications and scripts listed in [OEMRunOnce] process before the applications and scripts listed in [OemRun]. The [OEMRun] section process last.

Value: display_text, { command_line | section_name, {APP | INF | MSI} }

display_text

Specifies text to display in the OemRunOnce dialog box when Sysprep -factory processes this section.

command_line

Specifies a command-line to run synchronously with respect to the other commands listed in the [OEMRunOnce] section.

section_name

Specifies the name to use in the [section_name] heading within the [OEMRunOnce] section.

APP

Indicates that the application or command is not an .inf file or an MSI installation package.

INF

Indicates that the setup application is an .inf file.

MSI

Indicates that the setup application to run is an MSI installation package. Not supported in Windows PE.

[section_name]

The [section_name] section contains entries for configuring the preinstallation of applications during Factory mode of Sysprep. Preinstall the applications using the credentials specified in the UserName and Password entries in the [Factory] section of Winbom.ini.

Entry Description WinbomType

CmdLine Specifies any command-line switches to append to the command line, when running the application specified by SetupFile, and InstallType is Attach or Standard. WinPE, Factory

InstallType Specifies the method to use when preinstalling applications. WinPE, Factory

Reboot Specifies whether to reboot after processing [OEMRunOnce]. WinPE, Factory

RemoveStagePath Specifies whether to delete the directory specified by StagePath. WinPE, Factory

SectionName Specifies the section in the .inf file that contains the setup directives. WinPE, Factory

SetupFile Specifies the setup or uninstall application located in StagePath. WinPE, Factory

SourcePath Specifies the location of files to stage, a Setup.exe, or an .inf file. WinPE, Factory

StagePath Specifies either the location where to place files or the location of files to remove. WinPE, Factory

CmdLine

Specifies any command-line switches to append to the command line, when running the application specified by SetupFile, and InstallType is Attach or Standard.

Syntax CmdLine = command_line_switches

Value command_line_switches

Example CmdLine = -SMS

WinbomType WinPE, Factory

Comments Notes

If InstallType is Detach, and SetupFile does not have a value, then Setup ignores CmdLine.

If InstallType is Stage, then Setup ignores CmdLine.

If this command installs an application that uses an InstallShield-based installer, you must add an -SMS switch to the command line. You must capitalize -SMS. This command-line option ensures that the process created by the installer completes its operation before processing the next entry in the [OEMRunOnce] section.

Return to top

InstallType

Specifies the method to use when preinstalling applications.

Syntax InstallType = Attach | Detach | Stage | Standard

Values Attach

Runs a setup program located at StagePath, assuming that you already staged the application files on the destination computer.

Detach

Removes the directory specified by StagePath.

Stage

Copies the installed files and directories located in SourcePath to StagePath, but does not configure any registry settings. If you specify SetupFile, then Setup ignores StagePath and Sysprep -factory assumes that SetupFile is a staging installation application.

Standard

Runs a standard, non-MSI setup application using SetupFile located at SourcePath. The command-line options specified by CmdLine are appended to the command line that runs SetupFile. Standard is required if you install an application from an .inf file.

Example InstallType = Attach

WinbomType WinPE, Factory

Comments When you stage an application, all the files are placed on the computer but no changes are made to the registry. After the image of the master installation is placed onto the destination computer, you can either attach (complete the installation) or detach (remove all the files) each application, to configure the computer as ordered by the customer. Setup of the attached application is faster because the setup program does not need to copy the files to the computer. And it is much faster to delete files from a computer than to install an application over a network connection, especially if this application is installed on a majority of the computers that you manufacture.

Note

If InstallType is Standard, you cannot process a second Winbom.ini file later to detach that application.

Return to top

Reboot

Specifies whether to reboot after processing [OEMRunOnce].

Syntax Reboot = Yes | No

Values Yes

Restarts the computer.

No

Does not restart the computer.

Default Value No

Example Reboot = Yes

WinbomType WinPE, Factory

Return to top

RemoveStagePath

Specifies whether to delete the directory specified by StagePath.

Syntax RemoveStagePath = Yes | No

Values Yes

Deletes the StagePath directory and all of its contents.

No

Does not delete the directory.

Default Value Yes

Example RemoveStagePath = No

WinbomType WinPE, Factory

Comments Use this entry only when the value of InstallType is Attach. If the sourcepath of your files is local, and you do not want to delete these files, set the value of RemoveStagePath to No. If the path is not local, Setup does not delete the source files.

If InstallType is Detach, Stage, or Standard, then Setup ignores RemoveStagePath.

Return to top

SectionName

Specifies the section in the .inf file that contains the setup directives.

Syntax SectionName = sectionname

Value sectionname

The name of the section containing the setup directives used during an .inf installation.

Example SectionName = MySectionName

WinbomType WinPE, Factory

Comments SectionName is required if the value of InstallType is Standard and the application that you process is an .inf installation.

If InstallType is Attach, Detach, or Stage, then Setup ignores SectionName.

Return to top

SetupFile

Specifies the setup or uninstall application located in StagePath.

Syntax SetupFile = filename

Value filename

The file name of the setup application

Example SetupFile = Apple.msi

WinbomType WinPE, Factory

Comments SetupFile is required if:

The value of InstallType is Stage.

The value of InstallType is Attach and the setup program is an MSI application.

If the value of InstallType is Standard, SetupFile is either an .inf file or an .exe file.

If the value of InstallType is Detach, SetupFile is assumed to be Uninstall.exe.

Return to top

SourcePath

Specifies the location of files to stage, a Setup.exe, or an .inf file.

Syntax SourcePath = source_path

Value source_path

Example SourcePath = C:\MyFiles\Setup.exe

WinbomType WinPE, Factory

Comments The interpretation of source_path depends on InstallType.

If the value of InstallType is Stage, source_path is the location of the files to stage on the destination computer.

If the value of InstallType is Standard, source_path is the location of Setup.exe or an .inf file.

You must specify SourcePath if the value of InstallType is Stage.

Setup ignores SourcePath if the value of InstallType is Attach or Detach.

Return to top

StagePath

Specifies either the location where to place files or the location of files to remove.

Syntax StagePath = stage_path

Value stage_path

Example StagePath = C:\MyFiles

WinbomType WinPE, Factory

Comments StagePath is required if:

The value of InstallType is Stage.

The value of InstallType is Attach and the setup program is an MSI application.

The value of InstallType is Detach.

Setup ignores StagePath if the value of InstallType is Standard.

If InstallType is Stage or Attach, stage_path is the location where to place the files.

If InstallType is Detach, target_path is the location of files to remove.

Return to top

Summary of Relationships

The following table summarizes the relationships between the various entries in the [OEMRunOnce] sections:

Entry in [OEMRunOnce] InstallType

Attach Detach Stage Standard

CmdLine Append to SetupFile Ignored Ignored Append to SetupFile

RemoveStagePath Default to Yes Ignored Ignored Ignored

SectionName Ignored Ignored Ignored Required

SetupFile Required if attaching an .msi application. Located in StagePath. Assumed to be Uninstall.exe. Required if staging an .msi application. Located in StagePath. Name of the .inf or .exe file.

SourcePath Ignored Ignored Location of files to stage. Location of Setup.exe or .inf file.

StagePath Required if attaching an .msi application. Location of files to stage. Required. Location of files to remove. Required. Location of files to stage. Ignored

Return to top

Sample [OEMRunOnce] Section for Preinstalling Applications

This sample demonstrates how to stage, attach, detach, and install applications during the manufacturing process.

Preparing the Master Installation

The first Winbom.ini file copies the files for three different applications to the master computer, but does not fully install the applications. When the computer shuts down, it restarts in Factory mode of Sysprep.

[OEMRunOnce]

"Connect to network share", "net use R: \\server\share"

"First Application Stage", "Application1.Stage", MSI

"Second Application Stage", "Application2.Stage", MSI

"Third Application Stage", "Application3.Stage", MSI

[Application1.Stage]

InstallType = Stage

StagePath = "C:\App1_Temp"

SetupFile = "Application_One.msi"

SourcePath = "R:\ApplicationOne"

[Application2.Stage]

InstallType = Stage

StagePath = "C:\App2_Temp"

SetupFile = "Application_Two.msi"

SourcePath = "R:\ApplicationTwo"

[Application3.Stage]

InstallType = Stage

StagePath = "C:\App3_Temp"

SetupFile = "Application_Three.msi"

SourcePath = "R:\ApplicationThree"

[Factory]

ResealMode = Factory

Reseal = Yes

At this point, make an image of the master installation and place this image on the destination computer. When the computer restarts in the Factory mode of Sysprep, it processes a second Winbom.ini file.

Configuring the Build-to-Order Destination Computer

This second Winbom.ini file installs the first application, locates the files for the second application, and removes the files for the third application from the computer. The computer then shuts down, ready for distribution to the customer.

[OEMRunOnce]

"First Application Attach", "Application1.Attach", MSI

"Third Application Detach", "Application3.Detach", MSI

[Application1.Attach]

InstallType = Attach

StagePath = "C:\App1_Temp"

SetupFile = "Application_One.msi"

[Application3.Detach]

InstallType = Detach

StagePath = "C:\App3_Temp"

[Factory]

ResealMode = OOBE

Reseal = Shutdown

It seems you are missing the structure the helpfile seems to say is required...

Edited by JuMz
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...