4

I have had to reinstall my operating system today and there a ton of programs that I need to install, not to mention quite a few configurations to make after installing them!

I heard some people are using batch files to automate this process with unattended installers.

Is there a program that can generate a batch script for the executable files you hand to it? (If there isn't one, there should be.)

How would I go about writing a batch file for an unattended installer?

2

6 Answers 6

3

This is dependent on what programs you wish to install. There are various installer systems out there (NSIS, MSI, Installshield, ... off the top of my head) and each will usually have command-line switches you can use to perform a silent installation. For Microsoft Installer packages (MSI), there is the /q switch to perform an installation without a GUI. So a sample line may look like this:

"E:\Microsoft.NET\netfx.msi" /q

Instead of making batch scripts there are easier tools to make a custom, unattended Windows installation that will prepare all your software for you. NLite and the MSFN Unattended Guide come to mind.

Another alternative is to make a full backup after all your desired programs are installed and configured using Norton Ghost or Acronis True Image. I always end up kicking myself with this solution though. Right after I think everything's fine and I perform a backup, there's always 1 piece of software I forget to install.

3
  • WiX is just a build system for MSI.
    – Joey
    Aug 29, 2009 at 7:20
  • Knew it had something to do with it haha, theres tons of them.
    – user1931
    Aug 29, 2009 at 13:07
  • 1
    NOTE: Per superuser.com/questions/246639/… the /q switch can be disabled by MSI designers.
    – user66001
    Jul 31, 2013 at 4:47
4

I've had a lot of luck with Ninite - it has 95% of the programs I need and uses a single custom package to install them all.

2

This site has detailed, exhaustive information about unattended install of Windows. Specifically:

  • How to add 3rd party applications to the install
  • How to automate installers that don't have a "silent" switch
  • Plenty of examples and step-by-step instructions with illustrations

I have linked to the page specific to adding 3rd party apps, but be sure to check out the rest of the guide.

3
1

I like to use AutoIt. Usually I just use switches if the installer supports it. Universal Silent Switch Finder (USSF) is a good small tool to let you know which switches an installer takes. USSF can be found on SoftPedia.

With AutoIt what you would do is create a script that simulates key presses/mouse clicks. For example, in the script you would tell it to run ccleaner.exe, wait for the window to be active, select the next button/send "enter" key press, etc. (Or use /S switch)

If you only need one file (Like if you are making nLite addons) then I never successfully used AutoIt by itself, as there would be two files in the package. So I just use an SFX (Self Extracting Archive) to add the AutoIt script and setup file into one file.

By the way, AutoIt's help file is very informative. You will find great examples and explanations in it, if you should choose to use it. Hope this helps you

Edit: Also, you can compile AutoIt scripts to an .exe. That means no need to have AutoIt installed to use the scripts.

1
  • Universal Silent Switch Finder (USSF) sounds like a great tool - Do you have a homepage/download link for it?
    – user66001
    Jul 31, 2013 at 4:33
0

You can use Windows Post Installation (WPI) and integrate Autoit scipts into it.

For OS installation, Microsoft has WDS or RIS. For fully customizable OS installation, use a bootable disk with AutoIt and install OS through a distribution file server.

0

Batch files to automatically install software are best suited to supporting multiple workstations because the time and effort required to tweak installers, test systems for presence of current or older versions of software, command line switches to make installers run "quiet" or "silent", and clean-up commands to move or create shortcuts, remove autorun "helpers" or updaters make the maintenance of these batch files time-consuming. And saving and restoring individual settings are nigh impossible to manage with batch scripts, not because you can't do it, but because finding all the registry keys and %appdata% files is a daunting task.

I would suggest that you use ketarin.exe available from http://ketarin.canneverbe.com to keep your shareware/freeware programs and utilities up-to-date. Once you have configured Ketarin, you will be able to keep your existing system up-to-date on all your major and minor programs and if you have to rebuild your system, you can install Ketarin first, install your software database file, run Ketarin and download all your apps in one swell foop.

After that, you have to install your apps, but that process doesn't take as much time as finding all the downloads would take. And Ketarin is a useful tool for ongoing system maintenance, making the learning curve and effort to create your database worthwhile. There are templates available within Ketarin to download a large number of programs and you can create your own templates. I think you might get hooked and find the effort fun.

I haven't tried it yet, but Ketarin allows you to run commands before and after downloading apps, so you could in principle run tests, configure silent mode, and cleanup afterward by putting commands or references to batch files directly in Ketarin.

If you really are interested in writing scripts to do silent installs, http://www.msfn.org/, http://appdeploy.com, http://msdn.microsoft.com and http://www.installshield.com/ are sites worth visiting. I still use regular old cmd.exe batch files, but Microsoft has developed PowerShell to make things like this easier. It uses Windows Management Instrumentation to find out how your system is configured, so your scripts can make proper decisions on what to do.

There are also tools to allow you to modify or create .msi installers, which have standard ways to tweak (or "transform") the installers and make them run silently. You can also make standard installations from zip-packaged utilities that makes it easier to uninstall these installer-less programs. But I think this is suitable only if you are supporting a fairly large number of users, say, 20 or more.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .