Jump to content

Easy way to install apps


Recommended Posts

I've been trying to following allong with the guide to an unatended windows installation and im so not succsessful. I was wondering if anyone would be willing to help me set one up I only have 5 apps and Microsoft Office 2003. I know most people will read this and be like "wow that guy is retarded" I just cant seem to grasp the runonce exe so if someone would be cool enough to help me I'll hook them up with somthines i dunno what but ill make it worth there wild.

Link to comment
Share on other sites


Ok, now let's proceed to next step: creating your own simple RunOnceEx.cmd file.

Go back to TFM and read it again.

Have a break an re-read it, slower. Once more.

There is a simple exemple on it. Use it:

copy it to a notepad and save it with a RunOnceEx.cmd name (type: all files).

Now remove the lines corresponding to programs you don't want.

An create new lines for the ones you want to install, following the patterns and explanations of the guide.

Give it a try, even if you don't grab it in full.

Then post your file here for comment and point out what you don't understand.

Maybe what is missing in the guide is a general explanation of how runonceex works. So let me try:

* RunOnceEx is a location in windows registry (internal settings) where you can write some commands.

The commands at this location will be executed only ONE time (runONCEex) just after the next user logs in, and then be deleted.

We use that feature by putting in RunOnceEx some software installation command.

* The purpose of the RunOnceEx.CMD file is not to run these commands, it is to PLACE the commands in that RunOnceEx location.

* So basically there are 2 times:

1- RunOnceEx.cmd is executed, and as a result, writes some installation commands in RunOnceEx (registry).

2- Windows process the commands in RunOnceEx (registry), and as a result, installation are performed.

* The 1st time can be done at any moment before the 2nd one :w00t:

We usually choose T-12, meaning that we call RunOnceEx.cmd for execution from cmdlines.txt.

* What is important to grasp is that the stuff inside RunOnceEx.cmd is not exactly the installation commands but commands (REG ADD) putting the installation commands into the RunOnceEx location in the registry.

* For each program we want to install we put at least 2 informations in the registry (hence the 2-more lines for each prog in RunOnceEx.cmd): The installation command itself (2nd line and following)) as well as a name (1st line) that will be highlighted in the RunOnceEx list window during the execution of the command.

Good luck

Link to comment
Share on other sites

I'm sorry but I've read it dozens of times and I understand that they are just commands right, not the actual program but how do you get the actual program otherwise wouldn't it be looking for the program strings and then return nothing? or am I wrong?

Link to comment
Share on other sites

Ok, I'm not sure what you guys exactly want so I'll try it another way. Following is the full comprehensively detailed procedure to make it work with a simple example. Try to follow it all along (even if some parts may be too basic for you) and things may get clearer.

First, you need to have the program installers on your disk (harddrive or CD, or anywhere windows can look at) when RunOnceEx is processed.

Now let's forget RunOnceEx for a moment and concentrate on commands to run programs:

For example if you want to install Adobe Reader:

1- If you don't have it, download Acrobat Reader installer to your hard disk.

It is a file named 'AdbeRdr707_en_US.exe' that should have been saved to your desktop (or another location depending on your browser settings and/or choice when downloading it.

Anyway you NEED it and you need to know where it is.

2- In your 'c:' drive make a new directory and call it 'install_test'

Move 'AdbeRdr707_en_US.exe' inside this directory from the above location.

Now, the full PATH to the Adobe installer is

C:\install_test\AdbeRdr707_en_US.exe
3a- So if you type (or better: paste) this full path in the Run box (Start Menu / Run) this will start the Adobe installer.

You can try this and then abort the install (click cancel).

3b- Now open Notepad and paste the above full path in a new file.

Save that file with a .cmd extension (beware to set file type to 'all files (*.*)'), for exemple test.cmd.

Save it to any location, let's say your desktop.

Now, double-click that test.cmd file. Since it is a command file, it is executed (line by line).

Since its first line (our full path) is also a valid command, it is executed and Adobe Installer starts again.

You can also abort this install (we are only trying).

4- In order to have your program installed unattendedly you may need to modify the command with some switches, something I won't explain here.

- Suffice to know that switches are specific to each program. So the one for Adobe may not work for another program.

- For this version of Adobe Reader it should be ' /S /v/qn' so our installer command would now be:

C:\install_test\AdbeRdr707_en_US.exe /S /v/qn

If you input that full line in the run box, it will install Adobe without you doing anything.

If you put that line in the test.cmd instead of the previous one, it also install Adobe unattendedly.

5- Now let's try the RunOnceEx thing:

* Open another Notepad and first, paste this in it:

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
REG ADD %KEY% /V TITLE /D "Test Programs Installation" /F

- The first line put the location of the RunOnceEx registry key into the %KEY% variable, so we don't have to type (or just read) that whole long thing again at each line.

- The second line sets the title of the RunOnceEx list window (the one showing up just after login, saying it is installing your programs).

-> It writes (REG ADD) the data (/D) 'Test Programs Installation' to the value (/V) TITLE of the key %KEY%. The ' /F' switch at the end forces the addition/overwriting of the value in the key.

* Now, for installing our program, below the above lines, paste this:

REG ADD %KEY%\001 /VE /D "Test with Adobe Reader" /F
REG ADD %KEY%\001 /V 1 /D "C:\install_test\AdbeRdr707_en_US.exe /S /v/qn" /F

- The first line adds a subkey named '001' to %KEY% and set its default value (/VE) data (/D) to the name we want to give to our program. This name will appear as an item in the RunOnceEx list window, and will be dispayed in bold when that specific item will be run.

- The second line adds another value (/V) named '1' in the same subkey %KEY%\001 and having for data (/D) the command to be run for this item. Here it is our Adobe installer command from above.

- It is important to grasp that here, the installer command is NOT YET a command stricto-sensu.

- Rather, in this context, it is just text data added to the registry by the REG ADD command.

-> As such it needs to be surrounded by the quotes and to follow the /D (data) switch of REG ADD.

- If more than one command are needed for the SAME program, we can add more command values in the same subkey with increasing value name (2, 3, etc.):

REG ADD %KEY%\001 /V 2 /D "C:\another\command\for\Adobe" /F.

- Other programs to be installed will go into other subkeys: %KEY%\002, %KEY%\003, etc. creating new items in the RunOnceEx list window.

* Save the whole thing as myRunOnceExTest.cmd in any location, let's say your desktop.

And again double-click it. Now those commands don't tell the computer to run the installer but to write the installer command in RunOnceEx, so after the file is executed (black window) the installer does NOT start.

Now log off and back on. You then see your installer starting automatically.

Congratulations, this is your first successfull RunOnceEx. :thumbup

Cancel again to stop the install and proceed to your desktop.

6- Ok, now you may say: "all that is very fine, but I am formating my c: drive at the beginning of windows installation so after that, I won't have any 'C:\install_test\' directory anymore."

Well, that is where the $OEM$ folder comes in:

- It is a special folder that you create on you XP installation CD next to the I386 folder. (only the name is 'special' but don't forget to modify winnt.sif with OemPreinstall according to the guide for this to work).

- In it you should create another special folder named $1.

All what is in $1 will be copied to your system drive (most likely C:) at the end of the windows text mode installation (blue screen installation).

This copying takes place before RunOnceEx, so everything will be in C:\ by the time the latter is processed.

- So if you create an install_test folder inside $1, you then will have a install_test folder in C:\.

- And if you place AdbeRdr707_en_US.exe in $OEM$\$1\install_test\ during your preparation, it will be copied to C:\install_test\.

*-> That way, our command line :

C:\install_test\AdbeRdr707_en_US.exe /S /v/qn

will still be a valid one at the time it will be executed (RunOnceEx).

* As a summary, during preparation, you should have Adobe Installer there:

XPCD\$OEM$\$1\install_test\AdbeRdr707_en_US.exe
where XPCD is the location where you are preparing your unattended install (it contains your I386 folder).

After burning your CD, it will be in

D:\$OEM$\$1\install_test\AdbeRdr707_en_US.exe
where D: is your CD-ROM drive.

During installation it will be copied to

C:\install_test\AdbeRdr707_en_US.exe

* myRunOnceExTest.cmd should be also in $OEM$, together with cmdlines.txt:

XPCD\$OEM$\myRunOnceExTest.cmd

XPCD\$OEM$\cmdlines.txt

with this last one having in it:
[COMMANDS]
"myRunOnceExTest.cmd"

Those two files will go on your CD there:

D:\$OEM$\myRunOnceExTest.cmd

D:\$OEM$\cmdlines.txt

During install, they won't (and don't need to) be copied to C:\.

Instead they will be executed directly from the CD:

- if exists, cmdlines.txt is automatically parsed by windows setup at T12

- it calls myRunOnceExTest.cmd as we want,

- myRunOnceExTest.cmd writes our commands to RunOnceEx in the registry.

* Later, at first logon, RunOnceEx is parsed and our command being a valid one (Adobe installer file does exists in C:\install_test\, thanks to $OEM$\$1), it is executed and Adobe is installed:

C:\install_test\AdbeRdr707_en_US.exe /S /v/qn

- Et voilà!

Now, sorry if this does not answer your questions. Please then be more specific. The above procedure might be a good ground to base your questions on.

Anyway, i hope it can help someone.

Edited by Djé
Link to comment
Share on other sites

  • 9 months later...

The only problem with this method which i do not like, is as you say, the RunOnceEX will run after the first login.

The method i use will allow my applications to install on the first reboot directly after Windows installation has finished and not after the first login.

Below is the way i do it, which is a lot better i think.

This is my $OEM$ folder.

-----$OEM$

|---- $1

|----Temp

|-----RunOnceEX.cmd

My RunOnceEX.cmd is copied to my harddrive inside the Temp Folder.

Anything in the $1 folder is copied to the root of your harddrive. I.e. C:\Temp\RunOnceEX.cmd

-----------------------------------------------------------------------------------------

This is part of my RunOnceEX.cmd file.

cmdow @ /HID

@echo off

The lines below looks for the drive letter of my CDRom and assigns that letter to CDROM.

IF EXIST D:\CD.TXT SET CDROM=D:

IF EXIST E:\CD.TXT SET CDROM=E:

IF EXIST F:\CD.TXT SET CDROM=F:

IF EXIST G:\CD.TXT SET CDROM=G:

IF EXIST H:\CD.TXT SET CDROM=H:

IF EXIST I:\CD.TXT SET CDROM=I:

IF EXIST J:\CD.TXT SET CDROM=J:

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

REG ADD %KEY%/V TITLE /D "Installing Applications" /f

REG ADD %KEY%/V1 /D "Please wait while Your Applications" /f

; Install SpyWare Doctor

REG ADD %KEY%06 /VE /D "SpyWare Doctor" /f

REG ADD %KEY%06 /V 1 /D "%CDROM%\apps\SpywareDoctor\sdsetup.exe /VERYSILENT /SP- /NORESTART" /f

; Cleaning Up And Rebooting

REG ADD %KEY%95 /VE /D "Cleaning Up And Rebooting" /f

REG ADD %KEY%95 /V 1 /D "%CDROM%\CleanUP\cleanup.cmd" /f

Exit

---------------------------------------------------------------------------------------------

The line below goes in my WINNT.sif file, it is the very last line in this file.

Since my RunOnceEX.cmd was copied to the root of the harddrive ie C:\Temp\RunOnceEX.cmd

i use the line UserExecute="%systemdrive%\Temp\RunOnceEX.cmd (%systemdrive% being C:)

[setupParams]

UserExecute="%systemdrive%\Temp\RunOnceEx.cmd"

This way as i said before will install my applications on the first reboot after Windows has finished installing and not after my first login.

Try it, you will fined it a lot better than the other method....

Hope this helps anyone?

Worf.

Link to comment
Share on other sites

Interesting method. I have to try it out.

I install half of my applications at T12 using cmdlines.txt

The last line in my cmdlines.txt is RunOnceEx.cmd which gets installed after first logon. Using your method, this line would have to be removed and added to the winnt.sif

I will give it a go and see how it works.

Link to comment
Share on other sites

  • 2 months later...

For a week now I have been trying to get RIS to work correctly with a DELL PowerEdge 2950. Windows Server 2003 SP1 or SP2.

The two issues I have are with the NIC drivers and the RAID drivers. Since I have not gotten the NIC drivers to load as part of the base load, I figured that I would use either cmdlines.txt or the UserExecute command to install them. Nothing I tried seemed to have any affect, so I tried something just to see if either of the commands where actually executing. UserExecute="cmd.exe /c c:\drivers\d7.bat"

d7.bat contains one line: echo d7 > c:\temp\d7.txt

Tried the same concept with cmdlines.txt.

In neither case does it appear that anything ran. After the system booted I even searched the registry for anything that contained the string d7.bat. Nothing there.

Anyone have any ideas? Thanks.

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