CODYQX4 Posted May 16, 2008 Posted May 16, 2008 I have set up a unattended XP SP2 disk, with several components installed at runonceex. I have done it all by inf and it seems to work. I just have one issue with it. Many of the things I am installing use other inf files and open up copy boxes. How can I hide and disable these so that my runonceex cannot be canceled?
_nightw0lf^ Posted May 16, 2008 Posted May 16, 2008 Hey there, Good afternoon.You should attach a file called "cmdow.exe" in this location -> \$OEM$\$$\System32.After you've done this, in your RunOnceEx.cmd file you should start it with such option: cmdow @ /HID@echo offGood luck!
CODYQX4 Posted May 16, 2008 Author Posted May 16, 2008 Hey there, Good afternoon.You should attach a file called "cmdow.exe" in this location -> \$OEM$\$$\System32.After you've done this, in your RunOnceEx.cmd file you should start it with such option: cmdow @ /HID@echo offGood luck!Sorry, but I'm doing it by INF, not cmd. I also did try that before and it does hide the command window but not anything else. I am using RunonceEx to install TabletPC and MediaCenter Components, and it does work (This is referred to XP Ultimate in this forum). The INF's copy files from CMPNENTS on disk 2 of XP, but they open copy progress dialog boxes that can be closed by clicking the cancel button or the red X. I wanted to be able to hide these copy boxes but am not sure how to do so, or at least make the cancel and X buttons disappear. I do have the CMDOW if it can be done to hide the copy boxes.
devil270975 Posted May 18, 2008 Posted May 18, 2008 you could write a simple program in vb that blocks user input and start it at the beginning of RunOnceEX and performs a loop to see when the last but 1 key has completed then allows input again and then your last key should reboot the computer.cmdlines.cmd - Modify this to your INF file, make sure you start BlockInput using %COMSPEC% /C or RunOnceEX will not continueSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx REG ADD %KEY% /V TITLE /D "Installing Additional Applications" /f REG ADD %KEY% /V FLAGS /D "dword:0x00000110" /f REG ADD %KEY%\000 /VE /D "Blocking User Input" /f REG ADD %KEY%\000 /V 1 /D "%COMSPEC% /C START <PATH>\BlockInput.exe" /f REG ADD %KEY%\019 /VE /D "WHATEVER YOU WANT" /f <---This is the key to check has completed, When it has it gets deleted REG ADD %KEY%\019/V 1 /D "WHATEVER YOU WANT.exe" /f so Result = 0 and continues to run REG ADD %KEY%\020 /VE /D "Restarting The Computer" /f REG ADD %KEY%\020 /V 1 /D "Shutdown -f -r -t 60" /fBlockInput.exeConst HKEY_LOCAL_MACHINE = &H80000002Const STANDARD_RIGHTS_ALL = &H1F0000Const SYNCHRONIZE = &H100000Const KEY_CREATE_LINK = &H20Const KEY_CREATE_SUB_KEY = &H4Const KEY_ENUMERATE_SUB_KEYS = &H8Const KEY_NOTIFY = &H10Const KEY_QUERY_VALUE = &H1Const KEY_SET_VALUE = &H2Const KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL Or KEY_QUERY_VALUE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY Or KEY_CREATE_LINK) And (Not SYNCHRONIZE))Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As LongPrivate Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal samDesired As Long, phkResult As Long) As LongPrivate Sub Form_Load()Dim Result As Long BlockInput True Do While Result <> 0 DoEvents RegOpenKeyEx HKEY_LOCAL MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\019", 0, KEY_ALL_ACCESS, Result Sleep 10000 Loop BlockInput False Unload MeEnd Subyou can modify the code to enumerate all the subkeys under RunOnceEX and the deduct 1 from it or use a simple text file with the number to check for as the only entry in it so that you dont have to recompile every time you make a change.the alternative crude approach is to just block input and allow windows to shut it when you reboot, with this approach you dont need to start it using %COMSPEC% as it blocks input then exits so gives an exit code to RunOnceEX and continuesPrivate Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As LongPrivate Sub Form_Load() BlockInput True Unload MeEnd SubPlease be aware though i have not tested that either of these work, on paper they do, if i get time i might compile them and modify it to try and fit as many peoples needs as possible, but don't hold your breath, i am very busy on modifying something for work.if you don't have vb6 installed or any programming experience i am sure someone on here has, perhaps the moderators will pass it onto the dev team and they will examine the code and put it on here for the whole community.i myself prefer to compile myself then i know exactly what it does and whats in itHope This Helps.Lee.
CODYQX4 Posted May 18, 2008 Author Posted May 18, 2008 (edited) you could write a simple program in vb that blocks user input and start it at the beginning of RunOnceEX and performs a loop to see when the last but 1 key has completed then allows input again and then your last key should reboot the computer.cmdlines.cmd - Modify this to your INF file, make sure you start BlockInput using %COMSPEC% /C or RunOnceEX will not continueSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx REG ADD %KEY% /V TITLE /D "Installing Additional Applications" /f REG ADD %KEY% /V FLAGS /D "dword:0x00000110" /f REG ADD %KEY%\000 /VE /D "Blocking User Input" /f REG ADD %KEY%\000 /V 1 /D "%COMSPEC% /C START <PATH>\BlockInput.exe" /f REG ADD %KEY%\019 /VE /D "WHATEVER YOU WANT" /f <---This is the key to check has completed, When it has it gets deleted REG ADD %KEY%\019/V 1 /D "WHATEVER YOU WANT.exe" /f so Result = 0 and continues to run REG ADD %KEY%\020 /VE /D "Restarting The Computer" /f REG ADD %KEY%\020 /V 1 /D "Shutdown -f -r -t 60" /fBlockInput.exeConst HKEY_LOCAL_MACHINE = &H80000002Const STANDARD_RIGHTS_ALL = &H1F0000Const SYNCHRONIZE = &H100000Const KEY_CREATE_LINK = &H20Const KEY_CREATE_SUB_KEY = &H4Const KEY_ENUMERATE_SUB_KEYS = &H8Const KEY_NOTIFY = &H10Const KEY_QUERY_VALUE = &H1Const KEY_SET_VALUE = &H2Const KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL Or KEY_QUERY_VALUE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY Or KEY_CREATE_LINK) And (Not SYNCHRONIZE))Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As LongPrivate Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal samDesired As Long, phkResult As Long) As LongPrivate Sub Form_Load()Dim Result As Long BlockInput True Do While Result <> 0 DoEvents RegOpenKeyEx HKEY_LOCAL MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\019", 0, KEY_ALL_ACCESS, Result Sleep 10000 Loop BlockInput False Unload MeEnd Subyou can modify the code to enumerate all the subkeys under RunOnceEX and the deduct 1 from it or use a simple text file with the number to check for as the only entry in it so that you dont have to recompile every time you make a change.the alternative crude approach is to just block input and allow windows to shut it when you reboot, with this approach you dont need to start it using %COMSPEC% as it blocks input then exits so gives an exit code to RunOnceEX and continuesPrivate Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As LongPrivate Sub Form_Load() BlockInput True Unload MeEnd SubPlease be aware though i have not tested that either of these work, on paper they do, if i get time i might compile them and modify it to try and fit as many peoples needs as possible, but don't hold your breath, i am very busy on modifying something for work.if you don't have vb6 installed or any programming experience i am sure someone on here has, perhaps the moderators will pass it onto the dev team and they will examine the code and put it on here for the whole community.i myself prefer to compile myself then i know exactly what it does and whats in itHope This Helps.Lee.Not really sure how to do that . Is there any way I could disable the mouse and keyboard during runonceex?If it helps, this is my runonceex.inf file[Version]Signature=$CHICAGO$[DefaultInstall]AddReg = RunXP[XP]AddReg = RunXP[RunXP];http://support.microsoft.com/?kbid=232509HKLM,"%RunOnceEx%\",Title,0,"Installing Windows XP Ultimate"HKLM,"%RunOnceEx%\",Flags,0x00010001,20HKLM,"%RunOnceEx%\install01",,,".NET Framework AIO"HKLM,"%RunOnceEx%\install01",1,,"%24%\Install\DOTNETAIO\dotnetfx.exe"HKLM,"%RunOnceEx%\install01",2,,"%24%\Install\DOTNETAIO\SP3.exe /Q"HKLM,"%RunOnceEx%\install01",3,,"%24%\Install\DOTNETAIO\dotnet11SP1.exe"HKLM,"%RunOnceEx%\install01",4,,"%24%\Install\DOTNETAIO\netfxAIO.exe"HKLM,"%RunOnceEx%\install02",,,"Media Center Edition 2005 Components"HKLM,"%RunOnceEx%\install02",1,,"rundll32 setupapi.dll,InstallHinfSection Freestyle 128 medctroc.inf"HKLM,"%RunOnceEx%\install03",,,"Windows Digital Media Enhancements"HKLM,"%RunOnceEx%\install03",1,,"%24%\Install\Batch\Plus.cmd" HKLM,"%RunOnceEx%\install04",,,"Sonic CD and DVD Burning Engine"HKLM,"%RunOnceEx%\install04",1,,"rundll32 setupapi.dll,InstallHinfSection SonicDVDandCDBurning 128 sonic.inf"HKLM,"%RunOnceEx%\install05",,,"Tablet PC Edition 2005 Components"HKLM,"%RunOnceEx%\install05",1,,"rundll32 setupapi.dll,InstallHinfSection TPG 128 tabletpc.inf"HKLM,"%RunOnceEx%\install05",2,,"rundll32 setupapi.dll,InstallHinfSection System 128 tabletpc.inf"HKLM,"%RunOnceEx%\install05",3,,"rundll32 setupapi.dll,InstallHinfSection OOBE 128 tabletpc.inf"HKLM,"%RunOnceEx%\install05",4,,"rundll32 setupapi.dll,InstallHinfSection Notebook 128 tabletpc.inf"HKLM,"%RunOnceEx%\install05",5,,"rundll32 setupapi.dll,InstallHinfSection StickyNotes 128 tabletpc.inf"HKLM,"%RunOnceEx%\install05",6,,"rundll32 setupapi.dll,InstallHinfSection AllShortcuts 128 tabletpc.inf"HKLM,"%RunOnceEx%\install05",7,,"rundll32 setupapi.dll,InstallHinfSection SRInstall 128 tabletpc.inf"HKLM,"%RunOnceEx%\install05",8,,"rundll32 setupapi.dll,InstallHinfSection AllReg 128 tabletpc.inf"HKLM,"%RunOnceEx%\install06",,,"Repairing Components"HKLM,"%RunOnceEx%\install06",1,,"%24%\Install\Batch\TabFix.cmd"HKLM,"%RunOnceEx%\ZZCleanup",,,"Cleaning up And Rebooting"HKLM,"%RunOnceEx%\ZZCleanup",1,,"%11%\cmd.exe /c rd /S /Q %24%\Install\"HKLM,"%RunOnceEx%\ZZCleanup",2,,"%11%\cmd.exe /c shutdown -r -t 00"[Strings]RunOnceEx = "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx"It follows the method here to the letter (http://gosh.msfn.org/using_runonceex.htm)This inf successfully installs Media Center and TabletPC components on XP Pro, as long as the proper reg entries are added. (XP Ultimate) Edited May 18, 2008 by CODYQX4
devil270975 Posted May 19, 2008 Posted May 19, 2008 I will compile the crude method for you and rewrite your inf to suit, hope this helps, gimme a few hours though, pm me and i will send you it.
CODYQX4 Posted May 20, 2008 Author Posted May 20, 2008 Here Ya Go...BlockInput.zipHope This HelpsLee.Thanks, I'll try it asap!
CODYQX4 Posted May 20, 2008 Author Posted May 20, 2008 (edited) The program ran, but unfortunately, it didn't block user input while installing in virtualbox, however, if executed on my real PC it does block everything except CTRL + ALT + DEL combination, so maybe it's just a virtualbox issue? Also I suppose CTRL + ALT + DEL working is a good thing as it could be used as a failsafe, and not let a typical user cancel runonceex, as they might not think of it. Edited May 20, 2008 by CODYQX4
devil270975 Posted May 21, 2008 Posted May 21, 2008 I'm glad it fits your needs. If someone really wanted to cancel setup they would find a way to do it no matter what you do to stop them, try ctrl + shift + esc and see if it brings up task manager.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now