Jump to content

Recommended Posts

Posted

This is just an informative post on how I figured out how to install software based on what PC I was installing it on. This method can be adapted in many ways.

I base this on the administrators username (so I have one set of programs and my g/f has another set)...

cmdlines.txt:

[commands]
"UserSetup.cmd"
"RunOnceEx.cmd"

UserSetup.cmd (snippets):

set /p NewAdmin="Enter a new administrator name: "

echo. > %systemdrive%\MSA\%NewAdmin%

RunOnceEx.cmd (snippets):

rundll32 setupapi,InstallHinfSection DefaultInstall 128 .\RunOnceEx.inf
if exist %systemdrive%\MSA\RaveRod rundll32 setupapi,InstallHinfSection RaveRodInstall 128 .\RunOnceEx.inf
if exist %systemdrive%\MSA\MissCath rundll32 setupapi,InstallHinfSection MissCathInstall 128 .\RunOnceEx.inf

That way you can have multiple PC configurations and be able to choose which one you want to install. Ofcourse, you could use this to select other things rather than administrator name. Any defining name would do.

Inside RunOnceEx.inf (snippets):

[RunOnceEx.Default]
HKLM,%RunOnceEx%\9000,1,%REG_SZ%,"%24%\MSA\regedits_glob.cmd"

[RunOnceEx.RaveRod]
HKLM,%RunOnceEx%\9000,2,%REG_SZ%,"%24%\MSA\regedits_rave.cmd"

[RunOnceEx.MissCath]
HKLM,%RunOnceEx%\9000,2,%REG_SZ%,"%24%\MSA\regedits_miss.cmd"

Then in each regedits_*.cmd I have this (snippets):

for %%i in (%systemdrive%\MSA\regedits\global_*.inf) do start /wait rundll32 setupapi,InstallHinfSection DefaultInstall 128 %%i

Ofcourse, change the global_*.inf to something like raverod_*.inf and misscath_*.inf for multiple configurations. This allows me to use nVidia display tweaks for my PC and Matrox tweaks for my g/f's.

This can also be adapted to install a specific set of programs for a certain PC. Using INF files also makes it much easier to manage the programs installed on each machine.

I hope someone finds this information as usefull as I have.

Edit: By placing the lines in UserSetup.cmd in UserSetup.bat, you can call this from DetachedProgram and then you don't have to be around for T-13... Only need to be there for T-39. Make sure it's a .bat file though and not a .cmd otherwise it won't work.

  • 2 weeks later...

Posted
if exist %systemdrive%\MSA\RaveRod rundll32 setupapi,InstallHinfSection RaveRodInstall 128 .\RunOnceEx.inf

What does .\ (just before RunOnceEx.inf) do?

Is that up a directory or down?

Thanks

]Bonkers[

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...