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();
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With