MSFN Forum: "auto detect" RunOnceEx? - MSFN Forum

Jump to content



Unattended CD/DVD Guide Homepage · MSFN Forum Rules

Welcome to the Applications Installs forum. Make sure you read the forum rules before you start posting.

Links/Requests to warez and/or any illegal material (porn, cracks, serials, etc..) will not be tolerated. Discussion of circumventing WGA/activation/timebombs/keygens or any other illegal activity will also not be tolerated.

We try our best to keep this forum clean of illegal content. If you see any illegal activity use the "report" button you find in every post to report the specific post to the moderators. If you ignore any of the rules you will be banned without notice.

Read Forum Rules
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

"auto detect" RunOnceEx? is it possible? Rate Topic: -----

#1 User is offline   Orsi 

  • Hasta la Windows Vista, baby
  • PipPip
  • Group: Members
  • Posts: 263
  • Joined: 09-October 03
  • OS:Windows 7 x64
  • Country: Country Flag

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.


#2 User is offline   Nologic 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 461
  • Joined: 07-October 03

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 User is offline   Orsi 

  • Hasta la Windows Vista, baby
  • PipPip
  • Group: Members
  • Posts: 263
  • Joined: 09-October 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 16 December 2005 - 12:47 PM

maybe it's a stupid question but... how can I make this? :)

#4 User is offline   Nologic 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 461
  • Joined: 07-October 03

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

[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 User is offline   MHz 

  • SendToA3X v1.7
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,634
  • Joined: 02-August 04

  Posted 17 December 2005 - 03:09 AM

View PostNologic, 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 User is offline   Nologic 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 461
  • Joined: 07-October 03

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.

#7 User is offline   Orsi 

  • Hasta la Windows Vista, baby
  • PipPip
  • Group: Members
  • Posts: 263
  • Joined: 09-October 03
  • OS:Windows 7 x64
  • Country: Country Flag

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?

#8 User is offline   MHz 

  • SendToA3X v1.7
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,634
  • Joined: 02-August 04

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 User is offline   Orsi 

  • Hasta la Windows Vista, baby
  • PipPip
  • Group: Members
  • Posts: 263
  • Joined: 09-October 03
  • OS:Windows 7 x64
  • Country: Country Flag

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

#10 User is offline   MHz 

  • SendToA3X v1.7
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,634
  • Joined: 02-August 04

Posted 19 December 2005 - 09:07 AM

View PostOrsi, on Dec 20 2005, 12:57 AM, said:

I found the problem
rundll32.exe iernonce.dll,RunOnceExProcess was missing in the Runonce files
now everything works perfectly :)

tks again

Good to hear. :thumbup

#11 User is offline   Nologic 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 461
  • Joined: 07-October 03

Posted 19 December 2005 - 02:01 PM

Good to hear it works as expected. :)

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy