Jump to content

.inf file problem


Recommended Posts

This may sound silly but....

When i use an inf file during the install proccess and then try to use another inf file to do some other things after the pc has started it runs the stuff from the first inf file again and then continuse on to the new stuff.

Any ideas?

Link to comment
Share on other sites


Oh boy yes I recently ran into this. On a thread here I have seen a vb script that will delete a reg key but I have not tried it yet. I had the same issue as you I simply could not get two in a row working after may days of playing with them.

Possibly wiht that vb script we could execute it right after the first one but before the second one runs. I would very much like for that to work also.

If you would like to test this also it would be great. I'll see if I can find the thread wiht that nifty little pice of stuff init again.

Link to comment
Share on other sites

I fixed it. I think :)

in the inf file we have a section like this -

[DefaultInstall]
AddReg  = AdvSetup

[AdvSetup]
blah blah

In the second inf file i changed the name of "Advsetup" to something else and made the changes throughout the inf file and the problem went away.

Link to comment
Share on other sites

I first tried changing the name by adding extra letters to the end of "AdvSetup" but that didnt work so i changed the whole string.

The first file i use is like this

;
; Version 2.0
; Copyright  : © 2000,2001,2002,2003
; by Brook Humphrey (bah@webmedic.net)
; for Mobile PC Medic OEM systems
;

[version]
signature = "$CHICAGO$"
Compatible = 1
AdvancedINF = 2.5,"You need a newer version of AdvPack.DLL!"
LayoutFile = layout.inf, layout1.inf, layout2.inf


[DefaultInstall]
AddReg  = AdvSetup

[AdvSetup]
HKLM,%RunOnce%setup," Install XP by Brook Humphrey",0,""
HKLM,%RunOnce%setup,"   © 2000, 2001, 2002, 2003",0,""
HKLM,%RunOnce%setup,"      www.webmedic.net",0,""
HKLM,%RunOnce%setup,"______________________________",0,""
HKLM,%RunOnce%setup," ",0,""
HKLM,%RunOnce%setup,"Importing Regestry Entries..",0,"REGEDIT /S \install\\import.reg"
HKLM,%RunOnce%setup,"Applying Icon Layout Script",0,  "wscript \install\\iconlayout.vbs"
HKLM,%RunOnce%setup,"Running Command file",0,  "\install\\doit.cmd"
HKLM,%RunOnce%setup,"Turning on the Quick Launch ToolBar",0,  "wscript \install\\qlaunch.vbs"

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

And the second is -

;
; Version 2.0
; Copyright  : © 2000,2001,2002,2003
; by Brook Humphrey (bah@webmedic.net)
; for Mobile PC Medic OEM systems
; Used without permision

[version]
signature = "$CHICAGO$"
Compatible = 1
AdvancedINF = 2.5,"You need a newer version of AdvPack.DLL!"
LayoutFile = layout.inf, layout1.inf, layout2.inf


[DefaultInstall]
AddReg  = XPES-1

[XPES-1]
HKLM,%RunOnce%setup," Install XP by Brook Humphrey",0,""
HKLM,%RunOnce%setup,"   © 2000, 2001, 2002, 2003",0,""
HKLM,%RunOnce%setup,"      www.webmedic.net",0,""
HKLM,%RunOnce%setup,"______________________________",0,""
HKLM,%RunOnce%setup," ",0,""

HKLM,%RunOnce%setup,"Advanced Networking Pack",0, "%systemdrive%\\install\\system\\Recomended\\KB817778.exe -q -n -z"


;HKLM,%RunOnce%setup,"Final Setup",                      0,  "%systemdrive%\\install\\system\\setup.cmd"


[Del.XPES-1]
HKLM,%RunOnce%setup,"Installing Shell Toy",0,""

[Strings]
systemdrive = "c:"
Product     = "Shell Toy XP"
DiskName    = "Shell Toy XP, Setup Disk #1"
Uninstall   = "Software\Microsoft\Windows\CurrentVersion\Uninstall\"
Runonce     = "SOFTWARE\Microsoft\Windows\CurrentVersion\Runonce\"
Setup       = "SOFTWARE\Microsoft\Windows\CurrentVersion\Setup"
EXPLO       = "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
KEY_RUNONCE = "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce"
KEY_INSTALLEDCOMPS="SOFTWARE\Microsoft\Active Setup\Installed Components"

I know the format isnt correct in the first inf file but i did that before i read your post on it and havent fixed it yet.

Link to comment
Share on other sites

Scratch that - it worked for a while but when i added the 4th option in and at the same time changed the wording that shows up it reverted and ran the whole thing again.

I think this is connected with that other thread about resealing and it running again - I am working on it now.

edit - I let it complete and watched the reg key and when it finished it removed all the entries, i am getting the feeling that the .inf file that runs during setup is erroring at the end and thus preveting the registry from clearing the first load of instructions. more tests to follow

Link to comment
Share on other sites

As soon as my virtual pc has completly loaded the desktop for the first time i shut it down and make a copy of it. This allows me to just copy in a new version as soon as i messup/amdonewith the last one.

I have just copied in a fresh one and checked the registy and sure enough those keys are still there in the registry - the ones from my first inf file posted above.

So something is peventing them from being cleared. I dont know if there is an error in there or if it is a side effect of it running under guirunonce.

But i wont be checking for some time as it takes ages to do an install and i want to finish creating this inf file.

Your thoughts?

Link to comment
Share on other sites

well from what i have noticed they simply dont clear to after you reboot. Thats why the whole key needs to be deleted.

Possibly just using a reg file between each one and clearing the reg that way.

Oh man why didn't I think of that sooner. Ok never mind me. That should work great just use a reg file that zeros the regestry key should work great after you run the inf just zero it with the reg file. then run the next inf file. That would be even easier than a vbscript to do the job.

Link to comment
Share on other sites

well my inf files are executed from either cmdlines.txt and a cmd batch file so it would be very easy in both palces to just import a reg file after the inf terminates.

As for running the reg from the inf I'm not sure if that would work or not. You could test it anfd let me know For now I'm going to try the other way. Another thing about this is that is all the apps are installed during the graphic setup instead of durring guirunonce then you can pull off a few other little tidbits. Now if we could find out how to turn on quick links globaly for all users. A vb script is not exactly the best way to do it.

Link to comment
Share on other sites

Ill give it a go in a few mins.

As for the QL, ****, I have looked everywhere to get that. But the present script is way bloated, it goes through 3 or 4 extra stages just to get to the menu option.

But u can get there with one mouse click from the desktop. i just need to find a shortcurt for that and it will make the .vbs nearly instant.

Link to comment
Share on other sites

OH Yeah

I used this .reg file

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\setup]

And fired it with this .inf file

;
; Version 2.0
; Copyright  : © 2000,2001,2002,2003
; by Brook Humphrey (bah@webmedic.net)
; for Mobile PC Medic OEM systems
; Used without permision

[version]
signature = "$CHICAGO$"
Compatible = 1
AdvancedINF = 2.5,"You need a newer version of AdvPack.DLL!"
LayoutFile = layout.inf, layout1.inf, layout2.inf


[DefaultInstall]
AddReg = XPES-1

[XPES-1]
HKLM,%RunOnce%setup," XP Enhanced Setup 2003/2004",0,""
HKLM,%RunOnce%setup,"__________________________",0,""
HKLM,%RunOnce%setup," ",0,""

HKLM,%RunOnce%setup,"del",0, "regedit /s %systemdrive%\\Documents and Settings\\homer\\Desktop\\2.reg"


;HKLM,%RunOnce%setup,"Final Setup",                      0,  "%systemdrive%\\install\\system\\setup.cmd"


[Del.XPES-1]
HKLM,%RunOnce%setup,"Installing Shell Toy",0,""

[Strings]
systemdrive = "c:"
Product     = "Shell Toy XP"
DiskName    = "Shell Toy XP, Setup Disk #1"
Uninstall   = "Software\Microsoft\Windows\CurrentVersion\Uninstall\"
Runonce     = "SOFTWARE\Microsoft\Windows\CurrentVersion\Runonce\"
Setup       = "SOFTWARE\Microsoft\Windows\CurrentVersion\Setup"
EXPLO       = "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
KEY_RUNONCE = "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce"
KEY_INSTALLEDCOMPS="SOFTWARE\Microsoft\Active Setup\Installed Components"

Now it strikes me that - That could be placed at the end of the install proccess .inf or at the start of the Desktop based one.

Now for a question for you....

I use this in an .inf file to install .net framework

HKLM,%RunOnce%setup,"blah",0, "CMD.EXE /c msiexec /qn /i %systemdrive%\\blah\\MSWJV.msi"

and that works fine, have you found a way to use that cmdow program in this string to supress that command box without it calling a batch file?

Link to comment
Share on other sites

no thats one of the little nigglies. If you use cmdow it will spawn another task that will not work properly. I mean i did get it to hide the window but it also did not install .net or movie maker i think it was. The unstall would just bomb out for those two but the inf file would continue on. It was kind of funny the way it did things. So I want back to letting the window stick up there untill I find another way of hiding that window.

Link to comment
Share on other sites

Adding the command to load a .reg key to the top of the desktop based .inf file does not work, by the action of adding the command it triggers the old stuff to run first before it progresses through to the del part of the new stuff.

I do think it will work if placed at the end of the actual install .inf that runs during setup.

To get around that we need to do this -

[DefaultInstall]
DelReg = Clear.Reg
AddReg = XPES-1


[Clear.Reg]
HKLM,Software\Microsoft\Windows\CurrentVersion\RunOnce\setup


[XPES-1]
HKLM,%RunOnce%setup," XP Enhanced Setup 2003/2004",0,""
HKLM,%RunOnce%setup,"__________________________",0,""
HKLM,%RunOnce%setup," ",0,""

This is test and works - the whole .inf file now looks like this -

;
; Version 2.0
; Copyright  : © 2000,2001,2002,2003
; by Brook Humphrey (bah@webmedic.net)
; for Mobile PC Medic OEM systems
; Used without permision

[version]
signature = "$CHICAGO$"
Compatible = 1
AdvancedINF = 2.5,"You need a newer version of AdvPack.DLL!"
LayoutFile = layout.inf, layout1.inf, layout2.inf

[DefaultInstall]
DelReg = Clear.Reg
AddReg = XPES-1

[Clear.Reg]
HKLM,Software\Microsoft\Windows\CurrentVersion\RunOnce\setup

[XPES-1]
HKLM,%RunOnce%setup," XP Enhanced Setup 2003/2004",0,""
HKLM,%RunOnce%setup,"__________________________",0,""
HKLM,%RunOnce%setup," ",0,""

HKLM,%RunOnce%setup,"Advanced Networking Pack",0, "%systemdrive%\\install\\system\\Recomended\\KB817778.exe -q -n -z"
HKLM,%RunOnce%setup,"Microsoft Windows Journal Viewer",0, "CMD.EXE /c msiexec /qn /i %systemdrive%\\install\\system\\Recomended\\MSJournal\\MSWJV.msi"
HKLM,%RunOnce%setup,"Q327405: Recommended Update",0, "%systemdrive%\\install\\system\\Recomended\\hu1002_pro.exe /Q:A /R:N"
HKLM,%RunOnce%setup,"Q282010: Recommended Update",0, "%systemdrive%\\install\\system\\Recomended\\KB282010.EXE -q -n -z"
HKLM,%RunOnce%setup,"Q810243 Update:",0, "%systemdrive%\\install\\system\\Recomended\\Q810243.EXE -q -n -z"
HKLM,%RunOnce%setup,"Windows MovieMaker 2",0, "%systemdrive%\\install\\system\\Recomended\\MovieMaker.EXE /Q:A /R:N"
HKLM,%RunOnce%setup,"Windows Messenger 4.7",0, "%systemdrive%\\install\\system\\Recomended\\msn4-7.EXE /Q:A /R:N"
HKLM,%RunOnce%setup,".NET Framework version 1.1",0, "cmd.exe /c msiexec /qn /i %systemdrive%\\install\\system\\NetFramework\\netfx.msi"
HKLM,%RunOnce%setup,"Remove .Net Created user",0, "net user aspnet /delete"
HKLM,%RunOnce%setup,"Windows Media Player 9",0, "%systemdrive%\\install\\system\\Recomended\\MPSetupXP.exe /Q:A /R:N"
HKLM,%RunOnce%setup,"KB819639 WMP 9 Security fix",0, "%systemdrive%\\install\\system\\Recomended\\KB819639.exe /Q:A /R:N"

;HKLM,%RunOnce%setup,"Final Setup",                      0,  "%systemdrive%\\install\\system\\setup.cmd"


[Del.XPES-1]
HKLM,%RunOnce%setup,"Installing Shell Toy",0,""

[Strings]
systemdrive = "c:"
Product     = "Shell Toy XP"
DiskName    = "Shell Toy XP, Setup Disk #1"
Uninstall   = "Software\Microsoft\Windows\CurrentVersion\Uninstall\"
Runonce     = "SOFTWARE\Microsoft\Windows\CurrentVersion\Runonce\"
Setup       = "SOFTWARE\Microsoft\Windows\CurrentVersion\Setup"
EXPLO       = "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
KEY_RUNONCE = "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce"
KEY_INSTALLEDCOMPS="SOFTWARE\Microsoft\Active Setup\Installed Components"

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