Jump to content

Software Install based on text file...


Recommended Posts

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.

Link to comment
Share on other sites

  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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