Page 1 of 1
"auto detect" RunOnceEx? is it possible?
#1
Posted 15 December 2005 - 08:53 PM
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.
I need to know this 'cause some software are not Win x64 compatible, like NIS 2006.
#2
Posted 16 December 2005 - 11:43 AM
You could use an AutoIt script to detect what OS is installed and then to launch the nessary runonce list.
#3
Posted 16 December 2005 - 12:47 PM
maybe it's a stupid question but... how can I make this?
#4
Posted 17 December 2005 - 01:23 AM
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
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:
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:
Tho of course with only the files you want to install per OS.
The important part is:
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.
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.
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" ) 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:
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:
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.
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.
#5
Posted 17 December 2005 - 03:09 AM
Nologic, on Dec 17 2005, 05:23 PM, said:
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 ?
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.
#6
Posted 17 December 2005 - 10:32 AM
Hehe there you go, some cleaner and more professional code. 
Thanks MHz for the input and suggested tweaks.
Thanks MHz for the input and suggested tweaks.
#7
Posted 18 December 2005 - 09:07 PM
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" )
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?
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?
#8
Posted 19 December 2005 - 12:15 AM
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.
#9
Posted 19 December 2005 - 08:57 AM
I found the problem
rundll32.exe iernonce.dll,RunOnceExProcess was missing in the Runonce files
now everything works perfectly
tks again
rundll32.exe iernonce.dll,RunOnceExProcess was missing in the Runonce files
now everything works perfectly
tks again
#10
Posted 19 December 2005 - 09:07 AM
Share this topic:
Page 1 of 1



Help

Back to top








