Jump to content

WinSetupFromUSB 1.0beta8: cmdlines.txt is not executed


Recommended Posts

Hello,

i have a problem with the execution of the commands in the file cmdlines.txt and would be pleased if you could help me. I would like to add some regkeys by the cmdlines.txt method at T-12 as only then registry keys added to HKCU will be added to the default user profile and later are valid for all users.

So what i do:

Extract de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985.iso to C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\ with 7zip 9.27
Copy $OEM$ to C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\$OEM$
Copy winnt.sif to C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\I386\winnt.sif
Delete C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\[BOOT]
Delete C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\DOCS
Delete C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\DOTNETFX
Delete C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\SUPPORT
Delete C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\VALUEADD
At the end C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\ is about 860 MB

Insert 2GB USB pen drive
Start C:\WinSetup-1-0-beta8\WinSetupFromUSB_1-0-beta8.exe with admin rights
Select Auto-Format it with FBinst: (*) NTFS [x] align
Add to Disk: Windows 2000/XP/2003 Setup: C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\

Go! -> pen drive format warning: OK -> Accept Microsoft EULA

But at the end the cmdlines.txt is not executed. So here is how my WINNT.SIF and $OEM$ files look like:

C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\I386\ ... all the windows files and WINNT.SIF
C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\$OEM$\cmdlines.txt
C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\$OEM$\regkeys.reg
C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\$OEM$\$$\Resources\Themes ... the Zune theme files named in WINNT.SIF
C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\$OEM$\$1\_DRIVERS\ ... all the driver files
C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\$OEM$\$1\_INSTALL\GuiRunOnce.cmd
C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\$OEM$\$1\_INSTALL\SetupParams.cmd
C:\de_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73985\$OEM$\$1\_INSTALL\ ... some more files to be executed

cmdlines.txt:

[COMMANDS]
"CMD.EXE /C echo TEST > C:\TEST1.TXT"
"REGEDT32.EXE /S regkeys.reg"
"CMD.EXE /C echo TEST > C:\TEST2.TXT"

The TEST-files don't exist after the installation!

regkeys.reg:

Windows Registry Editor Version 5.00

; Enable Basic Authentification f.e. for WebDAV
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters]
"UseBasicAuth"=dword:00000001

; Changes default Search Options
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
"SearchSystemDirs"=dword:00000001
"SearchHidden"=dword:00000001
"IncludeSubFolders"=dword:00000001
"CaseSensitive"=dword:00000000
"SearchSlowFiles"=dword:00000000

; Turns On Classic Search
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState]
"FullPath"=dword:00000001
"FullPathAddress"=dword:00000001
"Use Search Asst"="Yes"
"Settings"=hex:0c,00,02,00,1b,01,e7,77,60,00,00,00

...

the keys are added to the registry without problems if i double click the file later, but unfortunately only to the currently logged in user.

SetupParams.cmd and GuiRunOnce.cmd are executed without a problem.

So on the USB pen drive it looks like that:

X:\WINSETUP\XPpSP3\I386
X:\WINSETUP\XPpSP3\$OEM$\cmdlines.txt
X:\WINSETUP\XPpSP3\$OEM$\regkeys.reg
X:\WINSETUP\XPpSP3\$OEM$\$1\_DRIVERS\ ... all the driver files
X:\WINSETUP\XPpSP3\$OEM$\$1\_INSTALL\GuiRunOnce.cmd
X:\WINSETUP\XPpSP3\$OEM$\$1\_INSTALL\SetupParams.cmd
X:\WINSETUP\XPpSP3\$OEM$\$1\_INSTALL\ ... some more files to be executed

WINNT.SIF:

;SetupMgrTag
[Data]
MsDosInitiated="0"
UnattendedInstall=Yes
Floppyless=1
AutomaticUpdates=Yes
AutoPartition="0"

[Unattended]
OemPreinstall=Yes
OemSkipEula=Yes
WaitForReboot=No
TargetPath=\WINDOWS
DriverSigningPolicy=Ignore
OemPnPDriversPath="_DRIVERS\ACPI_ATK0110;_DRIVERS\Atheros_LAN;_DRIVERS\ATI_Display;_DRIVERS\ATI_HDMI_Audio;_DRIVERS\ATI_SMBus;_DRIVERS\DLink_DWL-G122_revC1;_DRIVERS\Intel_Chipset;_DRIVERS\Intel_Grafik;_DRIVERS\Intel_HDMI_Audio;_DRIVERS\Intel_SATA;_DRIVERS\MitsubishiCP9550DW;_DRIVERS\MSI-US300EX;_DRIVERS\Nvidia_Away;_DRIVERS\Nvidia_Display;_DRIVERS\Nvidia_HDAudio;_DRIVERS\Nvidia_LAN;_DRIVERS\Nvidia_SATA;_DRIVERS\Nvidia_SMBUS;_DRIVERS\Nvidia_SMU;_DRIVERS\Realtek_AC97;_DRIVERS\Realtek_HD_Audio;_DRIVERS\Realtek_LAN_PCI;_DRIVERS\Realtek_LAN_PCI-E;_DRIVERS\SIS_Grafik;_DRIVERS\TP-Link_TL-WN721N;_DRIVERS\VIA_HD_Audio"
UnattendMode=FullUnattended
UnattendSwitch="Yes"

[UserData]
ProductKey=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
FullName="Home User"
OrgName="Home"
ComputerName=HomeComputer

[SetupParams]
UserExecute="%SystemDrive%\_INSTALL\SetupParams.cmd"

[GuiUnattended]
AdminPassword="XXXXXXXX"
EncryptedAdminPassword=No
AutoLogon=Yes
AutoLogonCount=1
OEMSkipRegional=1
TimeZone=110
OemSkipWelcome=1

[Shell]
CustomDefaultThemeFile = "%WinDir%\Resources\Themes\Zune.theme"

[Display]
BitsPerPel=32
Xresolution=1024
YResolution=768
Vrefresh=60

[TapiLocation]
CountryCode=49
Dialing=Tone
AreaCode=030
LongDistanceAccess="0"

[RegionalSettings]
LanguageGroup=1
Language=00000407
SystemLocale=00000407
UserLocale=00000407
InputLocale=0407:00000407

[GuiRunOnce]
Command0="%SystemDrive%\_INSTALL\GuiRunOnce.cmd"

[Identification]
JoinWorkgroup=ARBEITSGRUPPE

[Networking]
InstallDefaultComponents=Yes

[Components]
msmsgs=off
msnexplr=off
zonegames=off

[WindowsFirewall]
Profiles=WindowsFirewall.Standard

[WindowsFirewall.Standard]
Mode=1
Exceptions=1
Notifications=1

[IEPopupBlocker]
BlockPopups=Yes
ShowInformationBar=Yes

Edited by ladiko
Link to comment
Share on other sites


Just tested same scenario with reduced winnt.sif in VMWare Player as a regular USB boot and all worked fine, XP SP3 MSDN.

...
G:\WINSETUP\XPpSP3.ISO
G:\WINSETUP\XPpSP3\$OEM$
G:\WINSETUP\XPpSP3\AUTORUN.INF
G:\WINSETUP\XPpSP3\DOCS
G:\WINSETUP\XPpSP3\DOTNETFX
G:\WINSETUP\XPpSP3\I386
G:\WINSETUP\XPpSP3\README.HTM
G:\WINSETUP\XPpSP3\SETUP.EXE
G:\WINSETUP\XPpSP3\SETUPXP.HTM
G:\WINSETUP\XPpSP3\SUPPORT
G:\WINSETUP\XPpSP3\VALUEADD
G:\WINSETUP\XPpSP3\WIN51
G:\WINSETUP\XPpSP3\WIN51IP
G:\WINSETUP\XPpSP3\WIN51IP.SP3
G:\WINSETUP\XPpSP3\$OEM$\$1
G:\WINSETUP\XPpSP3\$OEM$\cmdlines.txt
G:\WINSETUP\XPpSP3\$OEM$\regkeys.reg
G:\WINSETUP\XPpSP3\$OEM$\$1\tagfile_in$1.txt
...

cmdlines.txt:

[COMMANDS]
"CMD.EXE /C echo TEST > C:\TEST1.TXT"
"CMD.EXE /C echo TEST > C:\TEST2.TXT"
"REGEDT32.EXE /S regkeys.reg"

regkeys.reg:

Windows Registry Editor Version 5.00

; Enable Basic Authentification f.e. for WebDAV
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters]
"Test"="Yes"

tagfile_in$1.txt is non-empty one, or it gets deleted from source when copied.

winnt.sif in i386:

[data]
msdosinitiated="0"
AutoPartition="0"
win9xupgrade="no"
winntupgrade="no"
EulaComplete="1"

UnattendedInstall=Yes
Floppyless=1
AutomaticUpdates=Yes

[Unattended]
OemPreinstall=Yes
OemSkipEula=Yes
WaitForReboot=No
TargetPath=\WINDOWS
DriverSigningPolicy=Ignore
;OemPnPDriversPath="_DRIVERS\ACPI_ATK0110;_DRIVERS\Atheros_LAN;_DRIVERS\ATI_Display;_DRIVERS\ATI_HDMI_Audio;_DRIVERS\ATI_SMBus;_DRIVERS\DLink_DWL-G122_revC1;_DRIVERS\Intel_Chipset;_DRIVERS\Intel_Grafik;_DRIVERS\Intel_HDMI_Audio;_DRIVERS\Intel_SATA;_DRIVERS\MitsubishiCP9550DW;_DRIVERS\MSI-US300EX;_DRIVERS\Nvidia_Away;_DRIVERS\Nvidia_Display;_DRIVERS\Nvidia_HDAudio;_DRIVERS\Nvidia_LAN;_DRIVERS\Nvidia_SATA;_DRIVERS\Nvidia_SMBUS;_DRIVERS\Nvidia_SMU;_DRIVERS\Realtek_AC97;_DRIVERS\Realtek_HD_Audio;_DRIVERS\Realtek_LAN_PCI;_DRIVERS\Realtek_LAN_PCI-E;_DRIVERS\SIS_Grafik;_DRIVERS\TP-Link_TL-WN721N;_DRIVERS\VIA_HD_Audio"
UnattendMode=FullUnattended
UnattendSwitch="Yes"

[UserData]
ProductKey = "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"

FullName="Home User"
OrgName="Home"
ComputerName=HomeComputer

[GuiUnattended]
AdminPassword="1234"
EncryptedAdminPassword=No
AutoLogon=Yes

yEvoy.jpg 9p8DZ.jpg

I'd start with winnt.sif, compare differences and check if and where it gets broken. Next check setup log files in Windows directory for clues.

Link to comment
Share on other sites

thank you for your help, i will look into the log files tomorrow and test it with a shorter winnt.sif and will give response. i appreciate your details information and fast reply!

by the way, i tried it with qemu, virtualpc and virtualbox, but as most normal computers list the hdd first and the usb pen drive second, i didnt found a way to boot from the second drive with all the virtualization solutions and when i set the pen drive as the first drive to boot, windows xp setup also listed it first and nuked the pen drives boot sector by writing it's own. what about vmware player?

Link to comment
Share on other sites

what about vmware player?
The posted method works and is tested working. Just follow the instructions.

The one in QEMU, which is included with WinSetupFromUSB and presents the USB disk as a IDE one is also working, but the included HD image file test.img, which is the second hard disk, is a small one, only for a quick test. You can safely replace it with as big as you need your hard disk size to be.

fsutil file createnew test.img filesize_in_bytes

Good idea is to make filesize_in_bytes multiple of 512 or easier to calculate of 1024 to avoid warning messages from grub4dos for example.

QEMU directory with test.img file used is in WinSetup_program_directory\files\tools\RMPrepUSB\QEMU. Then you can use StartFromUSB_WinSetup.bat in the same directory, or the QEMU option in the program to launch QEMU.

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...