Orsi Posted December 16, 2005 Share Posted December 16, 2005 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. Link to comment Share on other sites More sharing options...
Nologic Posted December 16, 2005 Share Posted December 16, 2005 You could use an AutoIt script to detect what OS is installed and then to launch the nessary runonce list. Link to comment Share on other sites More sharing options...
Orsi Posted December 16, 2005 Author Share Posted December 16, 2005 maybe it's a stupid question but... how can I make this? Link to comment Share on other sites More sharing options...
Nologic Posted December 17, 2005 Share Posted December 17, 2005 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[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:If @OSVersion = "WIN_XP" Then Run ( @COMSPEC " /c Start " & @HomeDrive & "\Install\RunOnce32.cmd" )Else Run ( @COMSPEC " /c Start " & @HomeDrive & "\Install\RunOnce64.cmd" )EndIfExitBoth 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:cmdow @ /HID@echo offSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Installing Applications" /fREG ADD %KEY%\005 /VE /D "Adobe Reader 6" /fREG ADD %KEY%\005 /V 1 /D "%systemdrive%\install\AdobeReader6\AR6.msi /qn" /fREG ADD %KEY%\010 /VE /D "Alcohol 120" /fREG ADD %KEY%\010 /V 1 /D "%systemdrive%\install\alcohol\setup.exe /qn" /fREG ADD %KEY%\010 /V 2 /D "REGEDIT /S %systemdrive%\install\alcohol\register.reg" /fREG ADD %KEY%\015 /VE /D "Diskeeper 8" /f...rundll32.exe iernonce.dll,RunOnceExProcessTho of course with only the files you want to install per OS.The important part is:rundll32.exe iernonce.dll,RunOnceExProcessSince 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. 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. Link to comment Share on other sites More sharing options...
MHz Posted December 17, 2005 Share Posted December 17, 2005 If @OSVersion = "WIN_XP" Then Run ( @COMSPEC " /c Start " & @HomeDrive & "\Install\RunOnce32.cmd" )Else Run ( @COMSPEC " /c Start " & @HomeDrive & "\Install\RunOnce64.cmd" )EndIfExitNice extensive explaination, Nologic.Would recommend hiding those cmd file windows for better presentation ?If @OSVersion = "WIN_XP" Then Run ( @HomeDrive & "\Install\RunOnce32.cmd", "", @SW_HIDE )Else Run ( @HomeDrive & "\Install\RunOnce64.cmd", "", @SW_HIDE )EndIfExitThe 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. Link to comment Share on other sites More sharing options...
Nologic Posted December 17, 2005 Share Posted December 17, 2005 Hehe there you go, some cleaner and more professional code. Thanks MHz for the input and suggested tweaks. Link to comment Share on other sites More sharing options...
Orsi Posted December 19, 2005 Author Share Posted December 19, 2005 tks guys but I can't make it work Here's the AutoIt code:If @OSVersion = "WIN_2003" Then Run (@HomeDrive & "\Install\RunOnce64.cmd")Else Run (@HomeDrive & "\Install\RunOnce32.cmd" )EndIfExit(WIN_2003 is the XP 64's @OSVersion)the script runs without any error message but the RunOnce code isn't added to the registrywhat am I doing wrong? Link to comment Share on other sites More sharing options...
MHz Posted December 19, 2005 Share Posted December 19, 2005 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. Link to comment Share on other sites More sharing options...
Orsi Posted December 19, 2005 Author Share Posted December 19, 2005 I found the problemrundll32.exe iernonce.dll,RunOnceExProcess was missing in the Runonce files now everything works perfectly tks again Link to comment Share on other sites More sharing options...
MHz Posted December 19, 2005 Share Posted December 19, 2005 I found the problemrundll32.exe iernonce.dll,RunOnceExProcess was missing in the Runonce files now everything works perfectly tks againGood to hear. Link to comment Share on other sites More sharing options...
Nologic Posted December 19, 2005 Share Posted December 19, 2005 Good to hear it works as expected. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now