• Announcements

    • xper

      MSFN Sponsorship and AdBlockers!   07/10/2016

      Dear members, MSFN is made available via subscriptions, donations and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, become a site sponsor and ads will be disabled automatically and by subscribing you get other sponsor benefits.
DaveXP

Windows Update Method For An Unattended Cd

52 posts in this topic

I'm gonna give it ago in a sec

0

Share this post


Link to post
Share on other sites

You could probably do Echo %systemdrive% >> blah.reg then import blah.reg. I assume it would save %systemdrive% as the correct letter.

-gosh

0

Share this post


Link to post
Share on other sites

This is kind of confusing

RunOnceEx doesn't like any variable at all (even tried %homedrive%\install\)

Doing an IF EXIST and SET command for %hdd% sets it to C:\, but only in the active command window. %hdd% won't work if run from anywhere else. Pretty much useless when the first runonceex key is set_variables.cmd (which is in system32) and the command window closes thus losing the variable.

Giving me a headache this is!

0

Share this post


Link to post
Share on other sites

It's been mentioned you can use %11% for system32, etc.

And Aaron, if you're feeling a little tired you can always make me a temp mod and i'll look over the place for you.

-gosh

0

Share this post


Link to post
Share on other sites

meh, i find the best way is to do it via a batch file, ie:

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY%\zz010 /VE /D "Doing Stuff" /f

REG ADD %KEY%\zz010 /V 1 /D "%systemdrive%\Install\stuff.exe" /f

that way you can put variables in, i run this from cmdlines.txt

0

Share this post


Link to post
Share on other sites

hmm.... interesting!

So you run this from cmdlines?

0

Share this post


Link to post
Share on other sites

yep, along with some registry entries for HKCU, it installs all the stuff on the first login after setup

0

Share this post


Link to post
Share on other sites

Brilliant, this pretty much solves everything then! :rolleyes: I'll throw in cmdow.exe to hide the command window from the end-user when its adding all those entries (creating a cd for a friend of mine :))

0

Share this post


Link to post
Share on other sites

I think i'll do that too, REG likes to say something like "The command was successful" all the time, i could probably send it to nul but your way is cleaner :)

0

Share this post


Link to post
Share on other sites

Okay. I have a theory so please bare with me. I pretty much understand the whole concept of runonce where cmdlines.txt runs a batch file and this in turn makes a reg value in the regitry and setup deletes it as it runs so it only runs once. hence the name. However many things such as .msi files dont run correctly (from what I understand. Please correct me if I am wrong) unless the shell is running and you are logged in.

My theory:

Lets say you want to install things while logged on using the windows update method (the fancy looking .inf installation method for us obsessed with look, kind of people) hehe.

You would finish off the runonce updates (called from cmdlines.txt) with a batch file that copies a shortcut from your install folder to the all users --> startmenu --> startup folder. This shortcut calls up a batch from the install folder on your system drive (I use a shortcut rather than an actual batch because I have had no luck in running a batch file then having it delete itself. This is so that the first time you logon it will run a batch file that will in turn run an inf, lets say Gosh's idea for an installing inf file ----> I apologize for only referencing Gosh's work because he is the only person I can think of right now. Once again I apologize as I and my others know there is some tension in this forum with the people who have all those stars beneath their name.

Anywho, back to what I was saying, the batch file file would run the installation of an inf file and then would run a command to delete the shortcut in the startup folder so to not run every startup. I think thats it. Do you guys think I hit the mark with this or should I stop smoking what you guys think I would be smoking when I wrote this. lol

0

Share this post


Link to post
Share on other sites

I'm confused - everything should install fine from the RunOnceEx method as the shell is fully loaded at this stage, you only need to add the registry keys to inititate (or enable if you like) this method during cmdlines.txt so you shouldn't have a problem..

0

Share this post


Link to post
Share on other sites

@Gism0 I can't be sure but from what I gathered is not every program I have can successfully be run unless you are logged in.

@Gosh. I took a quick glance and I apologize if this is what you posted. I knew that if I read the whole thread I would find something like this. I knew I couldn't have been the only person to think of this.

0

Share this post


Link to post
Share on other sites
@Gism0 I can't be sure but from what I gathered is not every program I have can successfully be run unless you are logged in.

but arn't you technically logged in at this stage? it runs on the first login (usually administrator) where everything is loaded..

i've personally never had a single problem installing a program at this stage, only at the cmdlines stage

0

Share this post


Link to post
Share on other sites

back and forth, back and forth. lol. I could be wrong but I don't think you are logged in (COULD BE WRONG). I have never tried to install everything from runonce because I have heard that .msi files don't install perfectly as they would if you were logged in. Like I said I have heard. I have not yet tried installing everything from runonce.

0

Share this post


Link to post
Share on other sites

lol noprob. Just want to verify that this idea is not mine. As gosh posted, he came up with this before I did so I don't want to steal what may have been his original idea.

0

Share this post


Link to post
Share on other sites

Just Noticed, you can also add the dword Flags to RunOnceEx

0x00000000 - All functions are disabled

0x00000004 - Check Shell Status - Verifies the shell is ready to accept OLE commands

0x00000008 - No Error Dialogs - Error dialog boxes are not displayed

0x00000010 - Create Error Log File - Create C:\Windows\RunOnceEx.err file if errors occur

0x00000020 - Create Execution Log File - Create a C:\Windows\RunOnceEx.log file with status of commands

0x00000040 - No Exception Trapping - Does not trap exceptions that occur when registering DLLs

0x00000080 - No Status Dialog - Status dialog box is not displayed while RunOnceEx runs

To use more than one at once just add them up, ie: No Status Dialog + create error log file = 90

0

Share this post


Link to post
Share on other sites

I don't care about credit, although i did want to point out i mentioned something similiar just for the record. I just posted an idea though, it would be nice if someone could take the idea and put it into something we can add to our unattended installs. Maybe MSTest or someone will do it.

-gosh

0

Share this post


Link to post
Share on other sites

Alrighty, let me see if I get this right :)

You want a way to use the 'windows update' inf installation method once the user has logged fully on and the desktop is showing?

After trying a few different things this is what I came up with:

Firstly you need to add a key to the registry during setup. The method I use for this is a modified moviemk.inf but you could use cmdlines.txt or guirunonce I would imagine.

Here's my current moviemk.inf

[Version]
Signature="$Windows NT$"

[DefaultInstall]
AddReg=PreLogon

[PreLogon]
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Runonce","runonce",,"rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 %10%\runonce.inf"

HKCU,"Software\Microsoft\CTF","Disable Thread Input Manager",0x00010001,1

HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Tour","RunCount",0x00010001,0

HKCU,"Software\Microsoft\Windows\CurrentVersion\Explorer\Streams","Settings",0x00000001,\
 09,00,00,00,01,00,00,00,01,00,00,00,e0,d0,57,00,73,35,cf,11,ae,69,08,00,2b,\
 2e,12,62,04,00,00,00,08,00,00,00,43,00,00,00

HKCU,"Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults","{20D04FE0-3AEA-1069-A2D8-08002B30309D}",0x00000001,\
 1c,00,00,00,01,00,00,00,00,00,00,00,00,00,9a,00,00,00,00,00,01,00,00,00,ff,\
 ff,ff,ff,f0,f0,f0,f0,14,00,03,00,9a,00,00,00,00,00,00,00,30,00,00,00,fd,df,\
 df,fd,0f,00,05,00,24,00,10,00,2e,00,46,00,00,00,00,00,01,00,00,00,02,00,00,\
 00,03,00,00,00,04,00,00,00,78,00,96,00,60,00,60,00,78,00,00,00,00,00,01,00,\
 00,00,02,00,00,00,03,00,00,00,05,00,00,00,ff,ff,ff,ff,cf,f3,a8,b0,33,43,ab,\
 4b,88,73,1c,cb,1c,ad,a4,8b,30,f1,25,b7,ef,47,1a,10,a5,f1,02,60,8c,9e,eb,ac,\
 04,00,00,00
HKCU,"Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults","{F3364BA0-65B9-11CE-A9BA-00AA004AE837}",0x00000001,\
 1c,00,00,00,01,00,00,00,00,00,00,00,00,00,90,00,02,00,00,00,01,00,00,00,00,\
 00,00,00,f0,f0,f0,f0,14,00,03,00,90,00,00,00,00,00,00,00,30,00,00,00,fd,df,\
 df,fd,0f,00,04,00,20,00,10,00,28,00,3c,00,00,00,00,00,01,00,00,00,02,00,00,\
 00,03,00,00,00,d2,00,70,00,8c,00,8c,00,00,00,00,00,01,00,00,00,02,00,00,00,\
 03,00,00,00,ff,ff,ff,ff,22,3e,37,3e,99,da,b7,4c,a8,86,75,4e,ae,98,4c,b4,30,\
 f1,25,b7,ef,47,1a,10,a5,f1,02,60,8c,9e,eb,ac,04,00,00,00

HKCU,"Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop","TaskbarWinXP",0x00000001,\
 0c,00,00,00,08,00,00,00,02,00,00,00,00,00,00,00,b0,e2,2b,d8,64,57,d0,11,a9,\
 6e,00,c0,4f,d7,05,a2,22,00,1c,00,0a,10,00,00,1a,00,00,00,01,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,4c,00,00,00,01,14,02,00,00,00,00,00,c0,00,00,\
 00,00,00,00,46,81,00,00,00,10,00,00,00,e0,ce,55,ee,fe,ee,c2,01,00,c0,d5,bc,\
 54,b1,c3,01,00,8b,14,ef,fe,ee,c2,01,00,00,00,00,00,00,00,00,01,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,15,02,14,00,1f,50,e0,4f,d0,20,ea,3a,69,10,\
 a2,d8,08,00,2b,30,30,9d,19,00,2f,43,3a,5c,00,00,00,00,00,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,5c,00,31,00,00,00,00,00,74,2e,12,7a,10,00,44,4f,43,\
 55,4d,45,7e,31,00,00,44,00,03,00,04,00,ef,be,74,2e,12,7a,79,2f,00,00,14,00,\
 00,00,44,00,6f,00,63,00,75,00,6d,00,65,00,6e,00,74,00,73,00,20,00,61,00,6e,\
 00,64,00,20,00,53,00,65,00,74,00,74,00,69,00,6e,00,67,00,73,00,00,00,18,00,\
 4a,00,31,00,00,00,00,00,74,2e,9c,84,10,00,41,44,4d,49,4e,49,7e,31,00,00,32,\
 00,03,00,04,00,ef,be,74,2e,9c,84,7b,2f,00,00,14,00,00,00,41,00,64,00,6d,00,\
 69,00,6e,00,69,00,73,00,74,00,72,00,61,00,74,00,6f,00,72,00,00,00,18,00,64,\
 00,31,00,00,00,00,00,74,2e,23,7a,13,00,41,50,50,4c,49,43,7e,31,00,00,4c,00,\
 03,00,04,00,ef,be,74,2e,9c,84,77,2f,00,00,14,00,36,00,41,00,70,00,70,00,6c,\
 00,69,00,63,00,61,00,74,00,69,00,6f,00,6e,00,20,00,44,00,61,00,74,00,61,00,\
 00,00,40,73,68,65,6c,6c,33,32,2e,64,6c,6c,2c,2d,32,31,37,36,35,00,18,00,42,\
 00,31,00,00,00,00,00,74,2e,18,72,14,00,4d,49,43,52,4f,53,7e,31,00,00,2a,00,\
 03,00,04,00,ef,be,74,2e,9c,7c,9a,2e,00,b8,14,00,00,00,4d,00,69,00,63,00,72,\
 00,6f,00,73,00,6f,00,66,00,74,00,00,00,18,00,52,00,31,00,00,00,00,00,74,2e,\
 ea,73,10,00,49,4e,54,45,52,4e,7e,31,00,00,3a,00,03,00,04,00,ef,be,74,2e,9c,\
 7c,9a,2e,00,b8,14,00,00,00,49,00,6e,00,74,00,65,00,72,00,6e,00,65,00,74,00,\
 20,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,00,00,18,00,48,00,31,\
 00,00,00,00,00,74,2e,a1,7c,10,00,51,55,49,43,4b,4c,7e,31,00,00,30,00,03,00,\
 04,00,ef,be,74,2e,a1,7c,9a,2e,00,b8,14,00,00,00,51,00,75,00,69,00,63,00,6b,\
 00,20,00,4c,00,61,00,75,00,6e,00,63,00,68,00,00,00,18,00,00,00,10,00,00,00,\
 05,00,00,a0,1a,00,00,00,37,01,00,00,00,00,00,00,26,00,00,00,61,07,00,00,00,\
 00,00,00,19,00,00,00,00,00,00,00,00,00,00,00,19,00,00,00,00,00,00,00,01,00,\
 00,00,01,00,00,00,aa,4f,28,68,48,6a,d0,11,8c,78,00,c0,4f,d9,18,b4,04,04,00,\
 00,60,0d,00,00,00,00,00,00,19,00,00,00,00,00,00,00,00,00,00,00,19,00,00,00,\
 00,00,00,00,01,00,00,00

Note the first line of the addreg section. It adds an entry in the HKEY_CURRENT_USER RunOnce registry key.

This key is that last to be processed during the startup sequence, being run even after the startup folder. The entry tells the system to run another inf, runonce.inf.

Here's runonce.inf

[Version]
Signature="$Windows NT$"

[DefaultInstall]
AddReg=Setup

[Setup]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\Setup","Windows Registry",,"%10%\regedit.exe guiset.reg"

This inf adds a value to the HKEY_LOCAL_MACHINE RunOnce\Setup key. As the user has already logged on, this command is run immediately. It tells the system to start the installation process and a nice 'windows update' box pops up and runs your setup programs, in this case registry entries.

Here's a screenshot of it in action

install.png

0

Share this post


Link to post
Share on other sites

Yaaaaaa u da man!!!! I will put this method to the test A.S.A.P.

Thanks

0

Share this post


Link to post
Share on other sites

DaveXP,

Just ran across your method for creating an unattended CD. I have an OEM version of Pro with SP1 included. DO I still need the SP1a and rollup incorporated...and where can I get the SP2 (if any) updates. A while back I created an unattended HOME CD and it worked great. Since then I have upgraded several times and wanted to try something a little more challenging. Any help is appreciated.

Thanks

0

Share this post


Link to post
Share on other sites

first off, this is a very old post.

second, it's also refered to as RunOnceEX.

http://unattended.msfn.org/xp/runonceex.htm

second, you don't HAVE to add the hotfixes, you can if you want. The easiest way to do this is with XPCreate. Check it's forum. I don't know if it works with an OEM version of the disk though. If it doesn't, use svcpack.inf.

http://unattended.msfn.org/xp/hotfixes.htm

0

Share this post


Link to post
Share on other sites

OKay i have followed the first part of these instructions on how to do this....(w2k btw)

I created the Setup.reg, and all the batch files, basically i copied everything that was on the first part of this post.

It will not run on first restart, nor will it grab the files i want to set up, i have to click the install.cmd manually in the c:\install file after windows setup, then reboot, but then i only see the last two things happening..basically the cleanup.. it does not install the adobe, abobe update, and mcafee.

Here is my setup.reg

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx]
"Title"="Installing Applications"


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\zz110]
"1"="C:\\Install\\Acrobat\\AdbeRdr60_enu_full.exe -p /s /v/qn"
"@="Acrobat Reader 6"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\zz120]
"1"="C:\\Install\\Acrobat\\AAcro-Reader_6.0.2_Update.exe /s /v/qb"
"@="Acrobat Reader 6 Update to 6.02"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\zz130]
"1"="C:\\Install\\Virus\\win2k.msi /qn"
"@="Mcafee Virus Scanner"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\zz140]
"1"="C:\\Install\\Remove2.cmd"
@="Removing Setup Files & Restarting the Computer"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\zz150]
"1"="regedit.exe /s C:\\Install\\regtweaks.reg"
@="Registry Tweaks"

Here is my cmdlines.txt

[COMMANDS]
".\install.cmd"
".\user.cmd"

And my install.cmd is here

CLS
@echo off
ECHO.
ECHO Adding Windows Update Method
REGEDIT /S %systemdrive%\install\Setup.reg
ECHO.

Any help is apprecaited...

0

Share this post


Link to post
Share on other sites

yes i noticed the typo in AAcro-Reader that was when i pasted.. it is just Acro-Reader on the setup.reg

0

Share this post


Link to post
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.