hi guys ! need some help. im developing an enterprize deployment appplication which install client softwares on remote machines in a LAN . I m using WMI win32_product class's install() Method for this.. the problem is i want to create a installation log file for the installed software on client machine .. .. how can i do this install() method sample code:
ConnectionOptions options = new ConnectionOptions();
ManagementScope scope = new ManagementScope("\\\\\\\\" + sRemoteMachine + "\\\\root\\\\cimv2", options);
scope.Connect();
ManagementPath mp = new ManagementPath("Win32\_Product");
ManagementClass classInstance = new ManagementClass(scope, mp, null);
// Obtain in-parameters for the method
ManagementBaseObject inParams = classInstance.GetMethodParameters("Install");
inParams\["AllUsers"\] = true;
//inParams\["Options"\] = installationParameters; // problem lies here
inParams\["PackageLocation"\] = sourceFilePath ; //source file must be on the remote machine
// Execute the method and obtain the return values.
ManagementBaseObject outParams = classInstance.InvokeMethod("Install", inParams, null);
how to options[] param for creating the log file .. or any other method..
abhinav