Win32Reg_AddRemovePrograms

  • Thread starter Thread starter msnews.microsoft.com
  • Start date Start date
M

msnews.microsoft.com

Hi,

Anyone may know why this class exists on some 2003 servers and does not
exist on others.
I have also tried on a machine installed with 2003 sp1 but the class does
not exist.



Thanks,
Yaniv
 
The win32Reg_AddRemovePrograms class comes from installing SMS Server 2003
onto that computer. You can get very similar information from the following
class definition note the name is "Products" in this definition and since
the namespace is not specified it will go to root\default, unfortunately you
have to compile the mof file below. As you can see both classes are looking
to the same registry key to retrieve their data. The command line to
compile this mof is "mofcomp thisFile.mof" save the file as a unicode file
with notepad.

qualifier dynamic:ToInstance;
qualifier ProviderClsid:ToInstance;
qualifier ClassContext:ToInstance;
qualifier propertycontext:ToInstance;

[dynamic, provider("RegProv"),
ProviderClsid("{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}"),ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall")]
class Products {
[key] string KeyName;
[read, propertycontext("DisplayName")] string DisplayName;
[read, propertycontext("DisplayVersion")] string DisplayVersion;
[read, propertycontext("InstallLocation")] string InstallLocation;
};
 
Thank you very much Scott, I will try it in the coming days.



Scott McNairy (MVP) said:
The win32Reg_AddRemovePrograms class comes from installing SMS Server 2003
onto that computer. You can get very similar information from the following
class definition note the name is "Products" in this definition and since
the namespace is not specified it will go to root\default, unfortunately you
have to compile the mof file below. As you can see both classes are looking
to the same registry key to retrieve their data. The command line to
compile this mof is "mofcomp thisFile.mof" save the file as a unicode file
with notepad.

qualifier dynamic:ToInstance;
qualifier ProviderClsid:ToInstance;
qualifier ClassContext:ToInstance;
qualifier propertycontext:ToInstance;

[dynamic, provider("RegProv"),
ProviderClsid("{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}"),ClassContext("local|
HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
)]
class Products {
[key] string KeyName;
[read, propertycontext("DisplayName")] string DisplayName;
[read, propertycontext("DisplayVersion")] string DisplayVersion;
[read, propertycontext("InstallLocation")] string InstallLocation;
};

--
Scott McNairy
Microsoft MVP - Windows Server Management Infrastructure

msnews.microsoft.com said:
Hi,

Anyone may know why this class exists on some 2003 servers and does not
exist on others.
I have also tried on a machine installed with 2003 sp1 but the class does
not exist.



Thanks,
Yaniv
 
Is there a way to compile the mof into the root\Cimv2 name sapce instead of
root\Deafult?




msnews.microsoft.com said:
Thank you very much Scott, I will try it in the coming days.



Scott McNairy (MVP) said:
The win32Reg_AddRemovePrograms class comes from installing SMS Server 2003
onto that computer. You can get very similar information from the following
class definition note the name is "Products" in this definition and since
the namespace is not specified it will go to root\default, unfortunately you
have to compile the mof file below. As you can see both classes are looking
to the same registry key to retrieve their data. The command line to
compile this mof is "mofcomp thisFile.mof" save the file as a unicode file
with notepad.

qualifier dynamic:ToInstance;
qualifier ProviderClsid:ToInstance;
qualifier ClassContext:ToInstance;
qualifier propertycontext:ToInstance;

[dynamic, provider("RegProv"),
ProviderClsid("{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}"),ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
)]
class Products {
[key] string KeyName;
[read, propertycontext("DisplayName")] string DisplayName;
[read, propertycontext("DisplayVersion")] string DisplayVersion;
[read, propertycontext("InstallLocation")] string InstallLocation;
};

--
Scott McNairy
Microsoft MVP - Windows Server Management Infrastructure

msnews.microsoft.com said:
Hi,

Anyone may know why this class exists on some 2003 servers and does not
exist on others.
I have also tried on a machine installed with 2003 sp1 but the class does
not exist.



Thanks,
Yaniv
 
This isn't recommended, however it is possible. but any object
interdependence (like a reference drawn from an association class to another
class in that original namespace could become broken), if you still want to
do it, you can use the Mofcomp.exe utility to do this with a mof file - you
may have to eliminate a #pragma namespace("\\\\.\\Root") declaration in the
file (usually these are at the top of the file) if it exists. The command
line arguments are like so:

mofcomp.exe /N:root\cimv2 yourCopy.mof

--
Scott McNairy
Microsoft MVP - Windows Server Management Infrastructure


msnews.microsoft.com said:
Is there a way to compile the mof into the root\Cimv2 name sapce instead
of
root\Deafult?




msnews.microsoft.com said:
Thank you very much Scott, I will try it in the coming days.



Scott McNairy (MVP) said:
The win32Reg_AddRemovePrograms class comes from installing SMS Server 2003
onto that computer. You can get very similar information from the following
class definition note the name is "Products" in this definition and since
the namespace is not specified it will go to root\default,
unfortunately you
have to compile the mof file below. As you can see both classes are looking
to the same registry key to retrieve their data. The command line to
compile this mof is "mofcomp thisFile.mof" save the file as a unicode file
with notepad.

qualifier dynamic:ToInstance;
qualifier ProviderClsid:ToInstance;
qualifier ClassContext:ToInstance;
qualifier propertycontext:ToInstance;

[dynamic, provider("RegProv"),
ProviderClsid("{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}"),ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
)]
class Products {
[key] string KeyName;
[read, propertycontext("DisplayName")] string DisplayName;
[read, propertycontext("DisplayVersion")] string DisplayVersion;
[read, propertycontext("InstallLocation")] string InstallLocation;
};

--
Scott McNairy
Microsoft MVP - Windows Server Management Infrastructure

Hi,

Anyone may know why this class exists on some 2003 servers and does not
exist on others.
I have also tried on a machine installed with 2003 sp1 but the class does
not exist.



Thanks,
Yaniv
 
Back
Top