5

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();
hat
  • 781
  • 2
  • 14
  • 25
Jess Chan
  • 391
  • 2
  • 14
  • If you launch C:\PATH\Setup.exe /quiet from command line, will Setup proceed quietly after you press YES in UAC window? If the behavior persists, than probably there is no much you can do without lowering UAC security. – CodeFuller Apr 04 '17 at 15:27
  • Process from where you launch your installer runs evelated (with admin privileges)? – Evk Apr 04 '17 at 15:31
  • I guess, you need to look for a installer specific approach. A summary for silent installations for common installer can be found here: http://unattended.sourceforge.net/installers.php – stefan.seeland Apr 05 '17 at 12:36
  • It actually depends on the installer that is performing the installation. Without knowing it, there is no way to do it... So what is it ? Wise, Setup, InstallShield, MSI ? – Martin Verjans Apr 11 '17 at 07:06

3 Answers3

1

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.

DigheadsFerke
  • 307
  • 1
  • 8
0

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.

Rawns
  • 865
  • 4
  • 27
0

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.

Community
  • 1
  • 1
Mahdi Ataollahi
  • 4,544
  • 4
  • 30
  • 38