Hi,
We have a requirement where in we have to be able to silently install any software component that is packaged as an EXE.
Please find below the code that we have written to accomplish this.
However, we notice that this is consistently not working with all EXE's.
For e.g. When trying to install Resharper, we were prompted with the "Install" button.
Please advice as to how we can bypass any prompts and carry on with the installation.
// Get the object on which the method will be invoked
ManagementClass processClass = new ManagementClass("Win32_Process");
// Get an input parameters object for this method
ManagementBaseObject inParams =processClass.GetMethodParameters("Create");
// Fill in input parameter values
inParams["CommandLine"]=@"c:\Users\User\Documents\JetBrains.ReSharperUltimate.2015.1.3.exe /L=1033 /S /NRC ";
// Execute the method
ManagementBaseObject outParams =processClass.InvokeMethod("Create",inParams, null);
// Display results
// Note: The return code of the method is provided in the "returnValue" property of the outParams object
String returnValue = outParams["returnValue"].ToString();
Console.WriteLine("Creation of process returned: " + outParams["returnValue"]);
Console.WriteLine("Process ID: " + outParams["processId"]);
Thanks,
Kalyani