Jump to content

Run custom installation at T-13 mark


Recommended Posts

Hi guys. Due to success of my previous post (here), I will ask my questions in a simple manner:

1) Is there any way to run a program at T-13 mark without registering anything at text mode setup (and not using batch files, only Infs)?

2) If not, how can I run my Inf through RunOnceEx directly from the CD-ROM (without batches and $OEM$ folders)? I'm doing the following:

First, register in [HiveInfs.Fresh] section of Txtsetup.sif my Inf file to install my applications. See below:

[HiveInfs.Fresh]
AddReg = hivedef.inf,AddReg
AddReg = hivesys.inf,AddReg
AddReg = hivesft.inf,AddReg
AddReg = hivecls.inf,AddReg
AddReg = hiveusd.inf,AddReg
AddReg = dmreg.inf  ,DM.AddReg
; Added by me
AddReg = Extras.inf ,Extras.Install

And here is my Inf file to install WMP10 silently and to apply a registry tweak for hiding the privacy statement:

Extras.inf

[Version]
Signature = "$Windows NT$"

[Extras.Install]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx",Title,0,"Installing components"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx",Flags,0x00010001,20
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\1",,,"Windows Media Player 10"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\1",1,,"%01%\mp10Setup.exe /c:""setup_wm.exe /Q /R:N /DisallowSystemRestore"" /q:A"

[Extras.Registry]
; Do not show Privacy Statement when running Media Player 10 the first time
HKCU,"SOFTWARE\Microsoft\MediaPlayer\Preferences","AcceptedPrivacyStatement",0x00010003,1

When I enter in the GUI phase of setup, at T-13 mark it appears the RunOnceEx message box, but Windows stops with an error: could not find the "%01%\mp10setup.exe" file (more or less)... I know that I have to specify the path to the exe in [Extras.Install], but I have no idea to accomplish this. Expanded variables don't work at text mode setup :no: (including [strings] section, I can't use this).

I have read that the section [sourceDisksNames] instructs Windows to find the source drive from which is installing, but without expanded variables, don't know how this works (if works). If I use %01% in the file path of the registry entry (%01% is defined as source path, if I'm right)

HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\1",1,,"%01%\mp10Setup.exe /c:""setup_wm.exe /Q /R:N /DisallowSystemRestore"" /q:A" , Windows DOESN'T expand %01%... :no:

I have read several hours (days!) this forum, searching and searching for terms like "runonceex", "winnt.sif", "t-13 mark", but no go... (read the gosh guides, threads, etc.). So please, don't be hard with me for posting this.

Any help would be very appreciated. Thanks very much ;)

Link to comment
Share on other sites


Not everything is installed through cmdlines.txt, and its definatly not wise to do it then either. Whats the issue with running it with the "preffered" methods?

RunOnceEx is more of an advanced method of an uA. I strongly suggest if you want to be a successful uA builder to start with batch files and then progress.

Also if you need an uA fast I suggest you take a look at WPI. WPI may not help you perfect your batch knowledge, but then again not everyone needs to.

Good luck

Link to comment
Share on other sites

There is an easier way to do this without having to edit the files in I386.

Just create your extras.inf file like this,

[Version]
Signature = "$Windows NT$"

[DefaultInstall]
AddReg    = Extras.Install, Extras.Registry

[Extras.Install]
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx,Title,0,"Installing components"
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx,Flags,0x10001,20
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\1,,,"Windows Media Player 10"
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\1,1,,"%24%\install\WMP10\MP10Setup.exe /q:A /c:""setup_wm.exe /Q /R:N /DisallowSystemRestore"""

[Extras.Registry]
; Do not show Privacy Statement when running Media Player 10 the first time
HKCU,SOFTWARE\Microsoft\MediaPlayer\Preferences,AcceptedPrivacyStatement,0x10003,1

and add the following to cmdlines.txt in $OEM$. Then place your extras.inf in $OEM$ too. Your media player setup should then go into a folder called WMP10, which should be placed in $OEM$\$1\install

[Commands]
"rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 128 .\extras.inf"

You'll just need to remember to redo your source or re-edit the files you have edited

Link to comment
Share on other sites

Thanks very much for your replies!! :)

I don't want to use the $OEM$ folders method (see my first post), nor cmdlines.txt.

I like very much the Inf way for its elegance (I have experience writing batch files, and I don't like for this purpose).

Well, Is there any system Inf executed at T-13 mark? If so, then it would be easy to add the run sentence of WMP10 setup by using rundll32 and the SetupAPI engine.

I know HIVEDEF.INF, HIVESFT.INF and HIVESYS.INF, but I'm not sure when these Infs are loaded and parsed. I have read that moviemk.inf is parsed and executed at T-13, but I'd prefer not to alter the Windows contents.

Therefore, if moviemk.inf is parsed at T-13, can I configure Setup in order to parse my own Inf at that time mark??

Again, thanks for your feedback :thumbup

Link to comment
Share on other sites

I'll PM you with an idea to try if you like, if it works continue it in the thread..., but for the one liner regarding the privacy statement, you can add

HKCU,"Software\Microsoft\MediaPlayer\Preferences","AcceptedPrivacyStatement",0x00010003,1

directly under [AddReg] in HIVEDEF.INF

Also if you ware to use the above and just slipstream the wmp10 files in using BTs method, you could avoid the inf completely

I think what you want is what most of us would love, directly from CD with no $OEM$, the problem is I cannot at the moment think of any method of doing this without either knowing /using hard coded drive letters or at least one batch file to get them.

Let me know the minimum requirements, and we'll try and work from there!

Edited by Yzöwl
Link to comment
Share on other sites

Let me know the minimum requirements, and we'll try and work from there!

The only problem is to find out the source drive where is located the executable (i.e., which is the drive letter of CD-ROM drive).

As I said before, I have read that [sourceDisksNames] is used to do this, but I've seen only examples using variables expansion, like this:

[SourceDisksNames]
1   = %cdname%,%cdtagfilei%,,\i386

Then, %1% is expanded to SourceDrive:\I386

Is there any way to do this specifying literals rather tan variables? For example,

[SourceDisksNames]
1   = "","win51ip",,\i386

and later use %1 in the Extras.Install section? (not sure about this, since Extras.Inf is parsed at the end of text mode setup, and I've read in the gosh guide that in this stage, the Inf parsing is very poor (not supporting variables expansion)).

Thanks for your valuable help :lol:

PD: If only could find an Inf parsed and executed at the T-13 mark or a way for adding my own Inf to another Inf to be parsed and executed at that time...

Link to comment
Share on other sites

You should be able to do something like this

[SourceDisksNames]
21       = %diskname%,%disktag%,,\Extras\WMP10

[Strings]
diskname = "Unattended Windows XP CD-ROM"
disktag  = "\win51ip"

You would then put your exe into a subfolder of Extras on the root of the CD named WMP10.

This is generally used for a copy files directive, where you would need to copy the files named in a source files section. Your only other option using a similar idea would be to lookat 'Advanced Inf', since that allows for cmd type commands, I just don't know at what stage in the install it would work.

Link to comment
Share on other sites

Thanks for the idea!

Where can I look for documentation about 'Advanced Inf'? because Gosh' site has a link to 'Advanced Inf 2.0', but the link is broken.

Now, I'm trying to add the registry entries directly into HIVESFT.INF. If this works, I hope this helps to someone in my same situation.

This forum is superb! :thumbup

PD: Gosh, and other experts on Inf scripting are still here?

Link to comment
Share on other sites

Hi again. I'm using a different method (easier to me).

I make a RunOnceX.inf file with the following:

[Version]
Signature = "$Windows NT$"

[AddTasks]
HKLM,"%RunOnceEx%\",Title,0,"Installing components"
HKLM,"%RunOnceEx%\",Flags,0x00010001,20
HKLM,"%RunOnceEx%\0",,,"Windows Media Player 10"
HKLM,"%RunOnceEx%\0",1,,"%1%\mp10setup.exe /c:""setup_wm.exe /Q /R:N /DisallowSystemRestore"" /q:A"

[Strings]
RunOnceEx = "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx"

This file is registered from HIVESFT.INF at the end of text mode setup:

[AddReg]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\Setup","",0,"rundll32 setupapi.dll,InstallHinfSection AddTasks 128 ..\WINDOWS\Inf\RunOnceX.inf"

The path to RunOnceX.inf is hard-coded by now.

I add RunOnceX.inf to DOSNET.INF and TXTSETUP.SIF

DOSNET.INF

[Files]
d1,RunOnceX.inf

TXTSETUP.SIF

[SourceDisksFiles]
RunOnceX.inf = 1,,,,,,,20,0,0

I'm using RunOnce\Setup instead RunOnceEx because RunOnce is executed at T-34 (according to these forums), but in T-13 RunOnceEx starts, and executes the tasks added in RunOnceX.inf. The problem is that Windows stops with a "Setup error" error, though the RunOnceEx box appears (but doesn't do anything). In addition, no text appears in RunOnceEx box (it should appear 'Windows Media Player 10').

What's wrong? and Can I substitute the RunOnce\Setup by RunOnceEx key and how to I would do this?

Thanks very much ;)

Link to comment
Share on other sites

:hello:

I've followed your advices, and I'm doing the following:

RunOnceX.inf

[Version]
Signature = "$Windows NT$"

[Prepare]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\",Title,0x00000000,"Setup"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\",Flags,0x00010001,0x00000020
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\Inf",,,"Scheduling"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\Inf",1,,"rundll32.exe setupapi.dll,InstallHinfSection AddTasks ..\WINDOWS\Inf\RunOnceX.inf"

[AddTasks]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\1",,,"Windows Media Player 10"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\1",1,,"%01%\mp10setup.exe /c:""setup_wm.exe /Q /R:N /DisallowSystemRestore"" /q:A"

All files are located on I386 subdir of WinXP CD.

TXTSETUP.SIF:

[SourceDisksFiles]
RunOnceX.inf = 1,,,,,,,20,0,0

[HiveInfs.Fresh]
; Added by ME
AddReg = RunOnceX.inf,Prepare

When text mode setup finishes, section [Prepare] is added to the registry (OK).

But at T-13 is executed:

HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\Inf",1,,"rundll32.exe setupapi.dll,InstallHinfSection AddTasks ..\WINDOWS\Inf\RunOnceX.inf"

and Windows shows an Error box saying: "Setup Error". RunOnceEx box appears, but it doesn't do anything :no:

I'm near of the finish, but what's wrong in the rundll32 command? :(

Thanks again for your infinite patience :rolleyes:

PD: I'm modding Windows XP Professional SP2 + Hotfixes integrated on svcpack.inf.

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