473,406 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Problem with Win32_Product - Upgrade method -1636 error code

53
Hi all,

I am trying to do Software upgradation using Win32_Product -Upgrade method in C#.Net.

Here is the code.

using System;
using System.Management;
using System.Windows.Forms;

namespace WMISample
{
public class CallWMIMethod
{
public static void Main()
{
try
{
ManagementObject classInstance =
new ManagementObject("root\\CIMV2",
"Win32_Product.IdentifyingNumber='{AC76BA86-7AD7-1033-7B44-A00000000001}',Name='Adobe Reader 6.0.1',Version='006.000.001'",
null);

// Obtain in-parameters for the method
ManagementBaseObject inParams =
classInstance.GetMethodParameters("Upgrade");

// Add the input parameters.
inParams["PackageLocation"] = @"D:\softwares\upgradePatch.msi";

// Execute the method and obtain the return values.
ManagementBaseObject outParams =
classInstance.InvokeMethod("Upgrade", inParams, null);

// List outParams
Console.WriteLine("Out parameters:");
Console.WriteLine("ReturnValue: " + outParams["ReturnValue"]);
}
catch(ManagementException err)
{
MessageBox.Show("An error occurred while trying to execute the WMI method: " + err.Message);
}
}
}
}

When I run this code , I am getting 1636 error code, means the patch file is not correct.
But when I manually do the upgradation by double clicking on that msi file, upgradation is success. Then what is problem in this code. How to do it programatically. any suggessions plz........
Mar 21 '08 #1
0 1538

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Salisha Khan | last post by:
I have an instance method that takes an ansi string. Dim foo As Object foo(String a) The problem is Strings in VB .NET are unicode while in order for the method to work it must accept an...
1
by: cpchan | last post by:
According the documentation from Metalink, the following files are required for the Oracle Upgrade from 8.1.6 to 8.1.7 : u0801060.sql c0801060.sql a0801060.sql i0801060.sql utlip.sql ...
4
by: Dave Harney | last post by:
Hi Newsgroup, I'm currently using VS Ver 7.0.9466 with an OS of Server 2000 (domain controller) Ver 5.0.2195 (Build 2195) SP4. I have MSDN Universal and would like to upgrade my development...
1
by: yasaswi | last post by:
I have MySQL server 4.0.12-standard installation. How can I upgrade to 4.1.10-standard version? Of course I can always build a brand new server with a new 4.1.10 install. But other than that final...
4
by: Mark | last post by:
I am preparing to upgrade a VS.NET ASP.NET project from version 1 to version 1.1. 1. Is it as simple as opening the project in VS.NET 2003? 2. Are there any issues to be aware of aside from not...
3
by: Robby | last post by:
Hello I posted this to vb.upgrade but I have had no response for three days so I am giving this forum a try. I have almost completed Francesco Balena's "Programming Microsoft Visual Basic...
5
by: Brian Henry | last post by:
I have this script Dim query As New ManagementObjectSearcher("Select * from Select * from Win32_Product") Debug.Write(query.Get().Count) For Each mo As ManagementObject In query.Get ...
0
by: Yellowfin pty ltd | last post by:
Announcing Yellowfin Version 2.5 upgrade release. (www.yellowfin.com.au) Existing DB2 based users can take advantage of this upgrade as soon as convenient. Downloads are available through the...
11
by: Don | last post by:
QUESTIONS: 1. Has anyone figured out how to successfully install the Office 97 Pro Service Release 2 patch in Vista? 2. Has anyone successfully installed an Office 97 Pro CD (SR2 version) in...
1
by: | last post by:
I need to upgrade from vb6 to dotnet. In vb6 I use Picture1.cls How do I upgrade this? Thanks in advance
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.