Jess Chan
Jess Chan

Reputation: 439

How do I create a silent install, where I don't need to press the next button?

I'm trying to make a silent install of an .exe that I'm downloading. The download method is irrelevant since it has nothing to do with the install.

However, when it's done downloading and I've started the process, instead of installing it the way I want it (Not having to press the next button) it just opens the UAC asking for administrative privileges. When I press YES it opens the .exe and I have to install it manually.

Is there a way to install it the way I want to?

Process process = new Process();
process.StartInfo.FileName = @"C:\PATH\Setup.exe";
process.StartInfo.Arguments = "/quiet";
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.Start();
process.WaitForExit();

Upvotes: 6

Views: 13967

Answers (3)

Mahdi Ataollahi
Mahdi Ataollahi

Reputation: 5202

If your installer is InstallShield you can use this command: setup.exe /s /v/qb for silent install with basic MSI UI or setup.exe /s /v/qn for silent installation without any UI. Take a look at this question https://stackoverflow.com/a/39047467/5675763 It may help.

Upvotes: 0

Rawns
Rawns

Reputation: 875

If you can't package the origional installer into an MSI, then you could always take a look at Auto IT (https://www.autoitscript.com/site/autoit/)

AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying “runtimes” required!

Using this you could play around and get the 'Next' button to be clicked automatically in essence, achieving your goal.

Upvotes: 0

DigheadsFerke
DigheadsFerke

Reputation: 307

Silent installation of an exe is not easy. The easiest way is using an msi package to achieve this. Therefore you have to extract the msi from the exe and call it with one of these parameters:

  • full UI: /qf (this is the default parameter)
  • reduced UI: /qr (the user interface does not show any wizard dialogs)
  • basic UI: /qb, /passive (only a progress bar will be shown during the installation)
  • no UI: /qn, /quiet (no UI will be showed during the installation)

On Windows Vista and above, in order the install the package silently the installation package should run elevated. Therefore the parent process calling the setup.exe have to run as administrator.

If you want to install an exe silently then there is lot more that you have to do. But it depends what type of installation package you are trying to install. Find out what was the installer software that the package was created with, then look up the documentation specified to the package. You need to look for the command line arguments within the documentation that allows to run the exe silently, if it is possible. As well as you have to find out whether the package install as per user or as per machine, because various permissions determine the elevation type.

Upvotes: 1

Related Questions