Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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();
like image 707
Jess Chan Avatar asked Nov 08 '22 00:11

Jess Chan


1 Answers

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.

like image 173
DigheadsFerke Avatar answered Nov 14 '22 21:11

DigheadsFerke