I have the following C# code:
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
Process.Start("cmd.exe", "/c" + desktopPath + "" + "MyInstaller_7.1.51.14.exe –s –v –qn");
The first line gets the path of my desktop where the .exe is located. The string desktopPath
is used in the second line.
The second line is supposed to start the installer in silent mode, so that the process runs in the background and the installation wizard does NOT appear at all. Running the string result of desktopPath + "" + "MyInstaller_7.1.51.14.exe –s –v –qn"
in the command prompt works just fine, and the installer runs in silent mode. In case anyone is wondering, the string result of
desktopPath + "" + "MyInstaller_7.1.51.14.exe –s –v –qn"
is
C:UsersMEDesktopMyInstaller_7.1.51.14.exe -s -v -qn
and running this in the command prompt runs the installation in silent mode.
Unfortunately, triggering the same command in C# code as this:
Process.Start("cmd.exe", "/c" + desktopPath + "" + "MyInstaller_7.1.51.14.exe –s –v –qn");
does not run the installer in silent mode. Instead, the wizard comes up, visible to the user.
Does anyone know how I can modify this:
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
Process.Start("cmd.exe", "/c" + desktopPath + "" + "MyInstaller_7.1.51.14.exe –s –v –qn");
so that the installer actually runs in silent mode, without the installer UI showing??
SIDE NOTE: –s –v –qn are switches for running in silent mode.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…