Sat32 Posted January 25, 2006 Share Posted January 25, 2006 My Guide to Hardware based application installs using RunOnceEx. The reason for this issimple example: You have 3 computers that you are trying to create a install disk for.One computer has a TV card that requires special software to use, two of the computers have Atibased GPU's the other one Nvidia GPU. So you are left to create three specialized install disksor install the specialized software needed later after setup has been completed. Here is my solution to solve this problem.To do this I use a Technique in my RunOnceEx file I call "Cascading Install" I don't count theapplication list from 001 to 999, but from 999 to 001.Example: RunOnceEx.cmd===============================================================================cmdow @ /HID@echo offSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY%\930 /VE /D "Welcome To Setup" /fREG ADD %KEY%\930 /V 01 /D "%systemdrive%\Install\setupfiles.exe" /fREG ADD %KEY%\930 /V 02 /D "%systemdrive%\Install\sysfiles\welcome.exe" /fREG ADD %KEY%\940 /VE /D "Installing Hotfix KB885835" /fREG ADD %KEY%\940 /V 01 /D "%systemdrive%\Install\Hotfix\KB885835.exe /passive /noreboot" /fREG ADD %KEY%\960 /VE /D "Installing .Net framework 1.1" /fREG ADD %KEY%\960 /V 01 /D "%systemdrive%\Install\dotnet1.1\install.exe /qb" /fREG ADD %KEY%\970 /VE /D "Installing .Net framework 2.0" /fREG ADD %KEY%\970 /V 01 /D "%systemdrive%\Install\dotnet2.0\install.exe /qb" /fREG ADD %KEY%\980 /VE /D "Reconfiguring System Componets" /fREG ADD %KEY%\980 /V 01 /D "REGEDIT /S %systemdrive%\Install\Reg\WFP.reg" /fREG ADD %KEY%\980 /V 02 /D "REGEDIT /S %systemdrive%\Install\Reg\Welcome.reg" /fREG ADD %KEY%\980 /V 03 /D "REGEDIT /S %systemdrive%\Install\Reg\DDPrint.reg" /fREG ADD %KEY%\980 /V 04 /D "REGEDIT /S %systemdrive%\Install\Reg\ErrorReport.reg" /fREG ADD %KEY%\980 /V 05 /D "REGEDIT /S %systemdrive%\Install\Reg\Network.reg" /fREG ADD %KEY%\980 /V 06 /D "%systemdrive%\Install\Sysfiles\Boot.cmd" /fREG ADD %KEY%\990 /VE /D "Rebooting System For Changes To Take Effect" /fREG ADD %KEY%\990 /V 01 /D "REGEDIT /S %systemdrive%\Install\Reg\autologin.reg" /fREG ADD %KEY%\990 /V 02 /D "%systemdrive%\Install\Sysfiles\Setup1.cmd" /fREG ADD %KEY%\990 /V 03 /D "shutdown -r -f -t 01 -d up:125:1" /fEXIT===============================================================================Most of it is pretty basic stuff, if you notice the last entry: "shutdown -r -f -t 01 -d up:125:1" This is telling the computerto do a planned restart and the entry right before shutdown: "Setup1.cmd" this is nothing more then a RunOnceEx.cmdwith a different name.Here is what Setup1.cmd looks like================================================================================cmdow @ /HID@echo offSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY%\800 /VE /D "Cleaning up Windows" /fREG ADD %KEY%\800 /V 01 /D "REGEDIT /S %systemdrive%\Install\Reg\Xplite.reg" /fREG ADD %KEY%\800 /V 02 /D "%Windir%\Xplite\Xplite_Setup.exe" /fREG ADD %KEY%\805 /VE /D "Installing Mozilla Firefox" /fREG ADD %KEY%\805 /V 01 /D "%systemdrive%\Install\FireFox\Firefox_Setup.exe -ms" /fREG ADD %KEY%\805 /V 02 /D "%systemdrive%\Install\FireFox\Ext_Themes\Firefox.cmd" /fREG ADD %KEY%\810 /VE /D "Installing Mozilla ThunderBird" /fREG ADD %KEY%\810 /V 01 /D "%systemdrive%\Install\Thunderbird\Thunderbird_Setup.exe -ms" /fREG ADD %KEY%\815 /VE /D "Installing Ad-Aware Personal" /fREG ADD %KEY%\815 /V 01 /D "%systemdrive%\Install\Ad-Aware\aawsepersonal.exe /s" /fREG ADD %KEY%\820 /VE /D "Installing MacroMedia Plugins" /fREG ADD %KEY%\820 /V 01 /D "%systemdrive%\Install\MacroMedia\Shockwave_Installer_Slim.exe /S" /fREG ADD %KEY%\820 /V 02 /D "%systemdrive%\Install\MacroMedia\install_flash_player.exe /S" /fREG ADD %KEY%\825 /VE /D "Installing Nero Burning ROM 6" /fREG ADD %KEY%\825 /V 1 /D "REGEDIT /S %systemdrive%\Install\Nero\nero.reg" /fREG ADD %KEY%\825 /V 2 /D "%systemdrive%\Install\Nero\Nero-6.6.0.18.exe /SILENT /NOREBOOT" /fREG ADD %KEY%\830 /VE /D "Installing Alcohol 120" /fREG ADD %KEY%\830 /V 01 /D "REGEDIT /S %systemdrive%\Install\Alcohol\Alcohol.reg" /fREG ADD %KEY%\830 /V 02 /D "%systemdrive%\Install\Alcohol\Alcohol_Setup.exe" /fREG ADD %KEY%\830 /V 03 /D "%systemdrive%\Install\Alcohol\blistfix.exe /silent" /fREG ADD %KEY%\835 /VE /D "Installing WinRAR" /fREG ADD %KEY%\835 /V 01 /D "%systemdrive%\Install\WinRAR\wrar290.exe /S" /fREG ADD %KEY%\835 /V 02 /D "%systemdrive%\Install\WinRAR\WinRAR.exe" /fREG ADD %KEY%\895 /VE /D "Update Will Resume After Reboot" /fREG ADD %KEY%\895 /V 01 /D "%systemdrive%\Install\Sysfiles\CD_Change.cmd" /fREG ADD %KEY%\895 /V 02 /D "REGEDIT /S %systemdrive%\Install\Reg\autologin.reg" /fREG ADD %KEY%\895 /V 03 /D "%systemdrive%\Install\Sysfiles\Shutdown.cmd" /fEXIT================================================================================Notice how the numbering goes Windows runs RunOnceEx counts up from the Lowest group to the highest.When Setup1.cmd is run Windows can't see the entrys untill a reboot happens because it will only count up to a highernumber. By using this technique you can have Windows restart when ever you need then continue right along with the next part of your install. The one trade off to this is you cannot name the RunOnceEx window title.Now how do we to install our specialized software, for this we turn to AutoIt here is my .au3 script=======================================================================$VidCard = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000","ProviderName")Select Case $VidCard ="ATI Technologies Inc."RunWait("IS_ATI.cmd") Case $VidCard = "NVIDIA"RunWait("IS_NVIDIA.cmd")EndSelect$TvCard = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E96C-E325-11CE-BFC1-08002BE10318}\0029","ProviderName")Select Case $TVCard = "Hauppauge"RunWait("IS_TVCARD.cmd")EndSelectRunWait("REMOVE_CHECK.cmd")Run("shutdown -r -f -t 00 -d up:125:1")===============================================================================A very simple script all it does is read the registry looking for certain keys when a key is found a .cmd file is run.IS_ATI.cmd, IS_NVIDIA.cmd, or IS_TVCARD.cmd these are nothing more the RunOnceEx files with different names.On my Setup1.cmd file you'll notice I've left a large numbering gap 835 then to 895 thats where hardware specific software entrys will goexample IS_ATI.cmd==================================================================================================cmdow @ /HID@echo offSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY%\880 /VE /D "Installing ATI Control Panel" /fREG ADD %KEY%\880 /V 01 /D "%systemdrive%\Install\AtiCP\Setup.exe -S" /fREG ADD %KEY%\885 /VE /D "Installing ATI Tool" /fREG ADD %KEY%\885 /V 01 /D "%systemdrive%\Install\ATiTool\ATITool.exe /S" /fEXIT=====================================================================================================/So when setup is run on a computer with a ATI video card, ATI's control panel and a overclocking utility are also installed. If a Nvidia card is in thecomputer the Coolbits registry entry will be added. The computer with a TV Card will get the TV viewer application.What gets installed and what hardware triggers that install is simply a matter of searching the registry for the correct keys then writing RunOnceEx commands.Now getting it all to work this is the tricky part after you compile your AutoIt script to a excutable place it in folder with all your *.cmd filesmine is /"ChkHrd.exe"/. The big problem ChkHrd.exe WILL NOT RUN from a /RunOnceEx.cmd./ So to solve this we run it from Windows startup folder.To do this create a shortcut to /"ChkHrd.exe"/ name it /"ChkHrd.lnk" {note: the .lnk extension will not be seen}./ Edit the path to the lnk so it corresponds to where the excutable will be during install mine is Target:/"%systemdrive%\Install\Chkhrd\ChkHrd.exe"/ {Note when editing the properties of the shortcut you will need to have the file where your telling windows to find it}/Getting ChkHrd.lnk to the Windows Startup folder to do this I use a SFX archive. Since you can't compress a *.lnk with WinRAR. Create a folder namedStartup and drop the short cut into it then compress that folder. Use comment tags to make sure goes where it supposed to.My WinRAR comments:Overwrite=1Silent=1Path=%userprofile%\Start Menu\ProgramsI name my SFX archive "SetHrdChk.exe" and insert it in to my RunOnceEx file like this:=========================================================================================================REG ADD %KEY%\990 /VE /D "Booting to Desktop for Analysis" /fREG ADD %KEY%\990 /V 01 /D "REGEDIT /S %systemdrive%\Install\Reg\autologin.reg" /fREG ADD %KEY%\990 /V 02 /D "%systemdrive%\Install\Sysfiles\Setup1.cmd" /fREG ADD %KEY%\990 /V 03 /D "%systemdrive%\Install\ChkHrd\SetChkHrd.exe" /fEXIT=============================================================================================================/The last thing but _Very Very Important_ on my *.au3 script you should noticed a line "Run("Remove_Check.cmd")"This removes the ChkHrd.lnk from the startup so it only runs once.Example: my "Remove_Check.cmd"/cmdow @ /HID@echo offDel "%USERPROFILE%\Start Menu\Programs\Startup\ChkHrd.lnk" /fEXIT===========================================================================================Thanksany comments or opinions please?? Link to comment Share on other sites More sharing options...
mickmack Posted January 25, 2006 Share Posted January 25, 2006 i think that use of Bashrats' driver packs is more suitable for machines with different specs. the only good thing i see in your guide is that you can easily use in your setup, new drivers at the same day when they come out. Link to comment Share on other sites More sharing options...
Sat32 Posted January 25, 2006 Author Share Posted January 25, 2006 MickmaskI haven't really used Baskrats driver packs, but I think you missed the advantage of this.Or I am just a bad writer probably a combo or both.Baskrats driver packs use the winnt.sif oempnpdriver methodso I don't believe ATi's SmartGart feature would work.But with this technique it would, because driver setup could be run fromfrom the RunOnceEx stage based on hardware not a driver.Also the companion software could be installed ATi's Mediacenter, Creative's Media Playerall based on the hardware in the computer.Another example you have two computers one is used for email & web browsing the otheris for Video Editing and has a capture card installed in it. Using Winnt.sif to install the capture card driver then you could use my technique to install Vegas Pro, Ulead or whatever you want.and the computer that was just used for email and web browsing wouldn't need that software and wouldn'tget that softwareI don't believe Baskrats can do that???Thanks Link to comment Share on other sites More sharing options...
RogueSpear Posted January 25, 2006 Share Posted January 25, 2006 I don't believe Baskrats can do that???The short answer is yes it can. The longer answer is that it's not quite perfect at the moment. BTS has decided to migrate away from the older ATI control panel to the new one (forget what it's called). Anyway, in my experience installs for either ATI or nVidia video adapters has worked very well with the driver packs.He does support all of the various control panels for sound and video adapters. Link to comment Share on other sites More sharing options...
Sat32 Posted January 26, 2006 Author Share Posted January 26, 2006 I don't believe Baskrats can do that???The short answer is yes it can. The longer answer is that it's not quite perfect at the moment. BTS has decided to migrate away from the older ATI control panel to the new one (forget what it's called). Anyway, in my experience installs for either ATI or nVidia video adapters has worked very well with the driver packs.He does support all of the various control panels for sound and video adapters.This is not a direct replacement for baskrats in fact using this and baskrats together may workrather well. Because IT DOES NOT INSTALL DRIVERS. In fact for this to work Windows has to be able toreconize the hardware (Have Drivers)!!!It associate's hardware to software and if set to associate a panel install to a piece of hardware it will!but your not limited to just driver software or control panels you can install anything.I could have my computer with a Ati card get firefox, thunderbird and my computers with Nvidia cardsget outlook and excel. Please show me where baskrats says it will do something like that???And it does it perfectly!!!! Link to comment Share on other sites More sharing options...
mickmack Posted January 26, 2006 Share Posted January 26, 2006 hey, we don' say your method is wrong or bad. theres easyer solution to that, WPI & Bashrat's DP do that all. Link to comment Share on other sites More sharing options...
RogueSpear Posted January 26, 2006 Share Posted January 26, 2006 I could have my computer with a Ati card get firefox, thunderbird and my computers with Nvidia cardsget outlook and excel.I did something a little similar. In the VBscripts that I've posted here, an example is that I install the Cisco VPN client only if the script determines that it's running on a laptop computer. Or the one I use daily is determining if the computer is actually a VM by reading the BIOS strings and then if so, install VMware Tools. 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