Help - Search - Members - Calendar
Full Version: "auto detect" RunOnceEx?
MSFN Forums > Unattended Windows Discussion & Support > Application Installs

   


Google Internet Forums Unattended CD/DVD Guide
Orsi
Hey there, I'm build an AIODVD with XP 32bits, XP 64 bits e so on, now I need to know if its possible to write a RunOnceEx.cmd file which automatically detects what OS I am installing.

I need to know this 'cause some software are not Win x64 compatible, like NIS 2006.
Nologic
You could use an AutoIt script to detect what OS is installed and then to launch the nessary runonce list.
Orsi
maybe it's a stupid question but... how can I make this? smile.gif
Nologic
Oh man your going to make me have to reply to this...s***.

Been out of the loop for a while.

Okay you'll need to make an entry into your WinNT.sif file, in your I386 folder

CODE
[GuiRunOnce]
"%systemdrive%\Install\RunOnce.exe"


Now the RunOnce.exe or what ever you wish to call it...is your yet to be compiled AutoIt script.

The compiled script will be placed in "$OEM$\$1\Install\" folder on your CD\DVD.

Now I'm guessing...but ether the AutoIt macro @OSVersion or @OSBuild should return a value that will tell you whether or not you have XP32 or XP64 installed...you'll have to test...but your compiled script should look some thing like so:

CODE
If @OSVersion = "WIN_XP" Then
    Run ( @COMSPEC " /c Start " & @HomeDrive & "\Install\RunOnce32.cmd" )
Else
    Run ( @COMSPEC " /c Start " & @HomeDrive & "\Install\RunOnce64.cmd" )
EndIf

Exit


Both RunOnce32.cmd & RunOnce64.cmd files would be of course placed in your "$OEM$\$1\Install\" folder on your CD\DVD.

Both files would be written like so:

CODE
cmdow @ /HID
@echo off

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

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

REG ADD %KEY%\005 /VE /D "Adobe Reader 6" /f
REG ADD %KEY%\005 /V 1 /D "%systemdrive%\install\AdobeReader6\AR6.msi /qn" /f

REG ADD %KEY%\010 /VE /D "Alcohol 120" /f
REG ADD %KEY%\010 /V 1 /D "%systemdrive%\install\alcohol\setup.exe /qn" /f
REG ADD %KEY%\010 /V 2 /D "REGEDIT /S %systemdrive%\install\alcohol\register.reg" /f

REG ADD %KEY%\015 /VE /D "Diskeeper 8" /f
...

rundll32.exe iernonce.dll,RunOnceExProcess


Tho of course with only the files you want to install per OS.

The important part is:

CODE
rundll32.exe iernonce.dll,RunOnceExProcess


Since the base cmd file will populate the RunOnce reg entry...and the line above will then force every thing thats been entered into the entry to then run at that point.

My self I would keep it all AutoIt...hence no cmd files what so ever...but that makes things some what more complex to explain...even tho over all working code is simpler...and just one compiled file.

Thats me tho. smile.gif

If your interested you should be able to search the forum for posts done by my self and Mhz on the subject of replacing RunOnce with AutoIt...tho my primary in depth post about it I think...I may have nuked on a bad hair day.

Any ways the above code samples should get you well on your way.
MHz
QUOTE (Nologic @ Dec 17 2005, 05:23 PM) *
CODE
If @OSVersion = "WIN_XP" Then
    Run ( @COMSPEC " /c Start " & @HomeDrive & "\Install\RunOnce32.cmd" )
Else
    Run ( @COMSPEC " /c Start " & @HomeDrive & "\Install\RunOnce64.cmd" )
EndIf

Exit

Nice extensive explaination, Nologic.
Would recommend hiding those cmd file windows for better presentation ?
CODE
If @OSVersion = "WIN_XP" Then
    Run ( @HomeDrive & "\Install\RunOnce32.cmd", "", @SW_HIDE )
Else
    Run ( @HomeDrive & "\Install\RunOnce64.cmd", "", @SW_HIDE )
EndIf

Exit

The more up to date AutoIt Beta has @ProcessorArch which returns one of the following: "X86", "IA64", "X64". That could be also an option.

A 64 bit OS also has a WOW64 key in registry that could be checked for existance.

Perhaps for a DOS solution is %OS% ? XP 32 here is set at "Windows_NT". I do not know the XP 64 value atm. Type set in a command window to find out on a XP 64 OS.
Nologic
Hehe there you go, some cleaner and more professional code. smile.gif

Thanks MHz for the input and suggested tweaks.
Orsi
tks guys but I can't make it work sad.gif

Here's the AutoIt code:

If @OSVersion = "WIN_2003" Then
Run (@HomeDrive & "\Install\RunOnce64.cmd")
Else
Run (@HomeDrive & "\Install\RunOnce32.cmd" )
EndIf

Exit

(WIN_2003 is the XP 64's @OSVersion)
the script runs without any error message but the RunOnce code isn't added to the registry
what am I doing wrong?
MHz
If the cmd files did not exist then an AutoIt fatal error would occur as you have taken no steps to suppress it. The code you display is working code so you must have a mistake in your cmd file which is not adding the registry entries ? Perhaps if you want to attach or post your cmd scripts, then the problem could be recognized.
Orsi
I found the problem
rundll32.exe iernonce.dll,RunOnceExProcess was missing in the Runonce files
now everything works perfectly smile.gif

tks again
MHz
QUOTE (Orsi @ Dec 20 2005, 12:57 AM) *
I found the problem
rundll32.exe iernonce.dll,RunOnceExProcess was missing in the Runonce files
now everything works perfectly smile.gif

tks again

Good to hear. thumbup.gif
Nologic
Good to hear it works as expected. smile.gif




Google Internet Forums Unattended CD/DVD Guide

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.