Jump to content

Choosing apps to install from install.cmd


Recommended Posts

Well, I've been lurking around this forum since it was started, and I figure it's about time I contributed something useful to it. So here I'll explain the method I've been using for picking which programs to install from cmdlines.txt during setup. I know there are programs like WPI for this now, but well, WPI wasn't always around. So this isn't a 3rd party app, it's just a simple way to do this from the cmd files. I'm no expert on .cmd files though, so very likely there is an even better way to do this...

So here's the short version: install.cmd asks to delete a .txt file named after a program, you tell it yes, delete it, or no, don't delete it. If you don't delete it, then that program will be installed.

The long version:

Ok, first off, you will need a "dummy file" for each program (or program group) you want to install. The easiest way to do this is just to make an empty text file named after the program. For example, I have wmp10.txt for windows media player, and mediagroup1.txt for iTunes, whitecap, and mytunes. All these dummy files will go in xpcd\$OEM$\$1\install\ to get copied to %systemdrive%\install\ during setup.

Then you will need a "master" install file, which will be called from cmdlines.txt, and will ask the questions and install the programs (this is the only file you will need to interact with during setup). This command file will ask to delete programx.txt from %systemdrive%\install\. After you've said yes/no to all the deletions, it will go and run the setups of the programs you didn't delete.

here's an example "master" install file, where programx is just a program, and group1 is for programs X and Z:

CLS
@echo off
TITLE Install Programs
COLOR f0
ECHO.     When you continue, you will be asked whether or not to delete a file. These are the command files that will run the installation for the program, so, if you DO want to install the program (will be asked as program.txt, where program is the name of the program to be installed), then DO NOT delete the file.
ECHO.
PAUSE
ECHO.
DEL %systemdrive%\install\programx.txt /P
ECHO.
DEL %systemdrive%\install\group1.txt /P
ECHO.
ECHO.
ECHO.Installation of programs will now begin...
PAUSE
ECHO.
ECHO.
ECHO.Installing ProgramX
IF EXIST %\systemdrive%\install\programx.cmd. (start /wait %systemdrive%\install\programx\programxsetup.exe /s) ELSE (echo programx not installed)
ECHO.
ECHO.Installing Program Y
IF EXIST %\systemdrive%\install\group1.txt. (start /wait %systemdrive%\install\programy\programysetup.exe /s) ELSE (echo program y not installed)
ECHO.
ECHO.Installing Program Y
IF EXIST %\systemdrive%\install\group1.txt. (start /wait %systemdrive%\install\programz\programzsetup.exe /s) ELSE (echo program z not installed)
ECHO.
ECHO.
ECHO.Installation Complete
PAUSE
EXIT

So, the dummy files are just there to create a switch of sorts, since you can't ask yes/no on the "start" command, but you can have a prompt on the delete command. Really it makes no difference what these files are called or where they are, just so long as they are copied to the hard drive somewhere (leave them in $OEM$ like my dumb brain did the first time, and you will have no options, since $OEM$ is on the cd, and so you obviously cannot delete files from it!)

Hope this is useful!

Link to comment
Share on other sites


Maestro

Thanks for sharing. Speaking of the batch files... Here's another apporach

CLS 
@echo off
TITLE Software Installation

:POWERTOY
SET Choice=
SET /P Choice=Install TweakUI 2.10 Powertoy [y/n]?
IF /I '%Choice%'=='n' goto :NERO
IF /I '%Choice%'=='y' (
ECHO Installing TweakUI 2.10 Powertoy
ECHO Please wait...
start /wait %systemdrive%\Install\TweakUI.msi /qn
ECHO. ) else goto :POWERTOY


:NERO
SET Choice=
SET /P Choice=Install Nero Burning ROM v5.5.10.5.54 [y/n]?
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
IF /I '%Choice%'=='n' Goto :EXIT
IF /I '%Choice%'=='y' (
ECHO Installing Nero Burning ROM v5.5.10.5.54
ECHO Please wait...
start /wait %systemdrive%\Install\Nero551054.exe /silent /noreboot
ECHO.) else goto :NERO

:EXIT
EXIT

It'll prompt for y(es)/n(o) for every app. Same thing can be done with groups of apps.

Link to comment
Share on other sites

Wow, that is quite a batch file Vad! That's exactly the sort of thing I was originally trying to come up with, but it is a good deal beyond my expertise. But is there a way to make that ask all the questions first though, then do the installs? The one thing I like about my way is that you can decide which programs you want all at once, then leave while they install. I guess the best of both worlds would be to use the set choice to ask whether or not to install, and delete the dummy file if choice=no. (the advantage being you can ask "do you want to install...", instead of my more confusing question of "do you want to delete?" press "yes" to Not install...:blink: ) It'd be nice not to have those stupid dummy files at all though.

Link to comment
Share on other sites

Wow, that is quite a batch file Vad! That's exactly the sort of thing I was originally trying to come up with, but it is a good deal beyond my expertise.

Well, it is beyond my expertise too :) I never said I have come up with it. The question was asked at a Russian board, I forwarded it to another board, where I knew a guy who could make it... In fact, the CHOICE command is available in 98/Me (choice.com), but it's been removed in NT and higher. That's where I got stuck and requested assistance. Here's a similar discussion http://www.computing.net/dos/wwwboard/forum/13909.html

The one thing I like about my way is that you can decide which programs you want all at once, then leave while they install.

I think there's a program Installit or something like that... The web site is hosted on msfn, IIRC. It provides GUI and checkboxes, so you mark the apps you want to install and run the installation. MSFN gurus should know the URL.

Alternatively, instead of running an application you can run a batch file and install a group of applications from it at once. You can make groups like "Personal", "Office", "Dummy friend", "Smart friend", etc ;-)

Actually, since you need a choice for apps, you may need a choice for the registry tweaks too. It can be done the same way, except you cannot run them at T-13 and apply HKCU tweaks to all accounts created afterwards. The workaround is a multiboot, but this is another story :)

Link to comment
Share on other sites

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...