#pragma autorecover

// =====================
// This code is duplicated in the Remove.Microsoft.AppV.AppVClientWmi.mof file. If any changes are made in the delete
// section of this file they must also be made in the Remove.Microsoft.AppV.AppVClientWmi.mof.
//
// Remove any existing WMI classes before adding below. This will ensure that classes and instances are cleaned up
// and not left around.
//

#pragma namespace("\\\\.\\root\\Appv")

//NOFAIL means continue if the class is not found

// Delete the classes
#pragma deleteclass("AppvClientApplication",NOFAIL) 
#pragma deleteclass("AppvClientAsset",NOFAIL) 
#pragma deleteclass("AppvClientPackage",NOFAIL) 
#pragma deleteclass("AppvClientConnectionGroup",NOFAIL) 
#pragma deleteclass("AppvPublishingServer",NOFAIL)

// Delete the provider
#pragma deleteinstance("__Win32Provider.Name='Microsoft.AppV.AppVClientWmi'",NOFAIL)

#pragma namespace("\\\\.\\root")

// Delete the Appv namespace
#pragma deleteinstance("__Namespace.Name='Appv'",NOFAIL)

//
// End of delete section
// =====================


//
// Install new WMI classes
//

#pragma namespace("\\\\.\\root")

instance of __Namespace
{
  Name = "Appv";
};

#pragma namespace("\\\\.\\root\\Appv")

class WMI_extension : __Win32Provider
{
	string Name = NULL;
	string CLSID = "{2A7B042D-578A-4366-9A3D-154C0498458E}";
	uint32 Version = 1;
	string HostingModel = "Decoupled:COM";
	string SecurityDescriptor = NULL;
	string AssemblyPath;
	string AssemblyName;
	string CLRVersion;
};

instance of WMI_extension
{
	AssemblyName = "Microsoft.AppV.AppVClientWmi, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
	CLRVersion = "v4.0.30319";
	CLSID = "{2A7B042D-578A-4366-9A3D-154C0498458E}";
	HostingModel = "NetworkServiceHost:CLR";
	Name = "Microsoft.AppV.AppVClientWmi, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
};

instance of __InstanceProviderRegistration
{
	provider = "__win32provider.Name=\"Microsoft.AppV.AppVClientWmi, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\"";
	SupportsDelete = TRUE;
	SupportsEnumeration = TRUE;
	SupportsGet = TRUE;
	SupportsPut = TRUE;
};

instance of __MethodProviderRegistration
{
	provider = "__win32provider.Name=\"Microsoft.AppV.AppVClientWmi, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\"";
};
[dynamic(TRUE) : ToInstance , provider("Microsoft.AppV.AppVClientWmi, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")]
class AppvClientApplication
{
	[read(TRUE) , key(TRUE)] string PackageId;
	[read(TRUE) , key(TRUE)] string PackageVersionId;
	[read(TRUE) , key(TRUE)] string ApplicationId;
	[read(TRUE)] string Name;
	[read(TRUE)] string Version;
	[read(TRUE)] string TargetPath;
	[read(TRUE)] boolean EnabledForUser;
	[read(TRUE)] boolean EnabledGlobally;
};
[dynamic(TRUE) : ToInstance , provider("Microsoft.AppV.AppVClientWmi, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")]
class AppvClientAsset
{
	[read(TRUE) , key(TRUE)] string PackageId;
	[read(TRUE) , key(TRUE)] string PackageVersionId;
	[read(TRUE) , key(TRUE)] string SoftwareCode;
	[read(TRUE)] string ProductName;
	[read(TRUE)] string ProductVersion;
	[read(TRUE)] string Publisher;
	[read(TRUE)] string ProductID;
	[read(TRUE)] string Language;
	[read(TRUE)] string ChannelCode;
	[read(TRUE)] string InstallDate;
	[read(TRUE)] string RegisteredUser;
	[read(TRUE)] string InstalledLocation;
	[read(TRUE)] string CM_DSLID;
	[read(TRUE)] string VersionMajor;
	[read(TRUE)] string VersionMinor;
	[read(TRUE)] string ServicePack;
	[read(TRUE)] string UpgradeCode;
	[read(TRUE)] string OsComponent;
};
[dynamic(TRUE) : ToInstance , provider("Microsoft.AppV.AppVClientWmi, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")]
class AppvClientPackage
{
	[read(TRUE) , key(TRUE)] string PackageId;
	[read(TRUE) , key(TRUE)] string VersionId;
	[read(TRUE)] string Name;
	[read(TRUE)] string Version;
	[read(TRUE)] string Path;
	[read(TRUE)] boolean IsPublishedToUser;
	[read(TRUE)] boolean UserPending;
	[read(TRUE)] boolean IsPublishedGlobally;
	[read(TRUE)] boolean GlobalPending;
	[read(TRUE)] boolean InUse;
	[read(TRUE)] uint64 PackageSize;
	[read(TRUE)] uint16 PercentLoaded;
	[read(TRUE)] boolean HasAssetIntelligence;
	[read(TRUE)] string DeploymentMachineData;
	[read(TRUE)] string DeploymentUserData;
	[read(TRUE)] string UserConfigurationData;
	[read(TRUE)] string Assets[];
};
[dynamic(TRUE) : ToInstance , provider("Microsoft.AppV.AppVClientWmi, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")]
class AppvClientConnectionGroup
{
	[read(TRUE) , key(TRUE)] string GroupId;
	[read(TRUE) , key(TRUE)] string VersionId;
	[read(TRUE)] string Name;
	[read(TRUE)] boolean IsEnabledToUser;
	[read(TRUE)] boolean UserPending;
	[read(TRUE)] boolean IsEnabledGlobally;
	[read(TRUE)] boolean GlobalPending;
	[read(TRUE)] boolean InUse;
	[read(TRUE)] uint16 PercentLoaded;
	[read(TRUE)] uint32 Priority;
	[read(TRUE)] string CustomData;
	[read(TRUE)] string Packages[];
};
[dynamic(TRUE) : ToInstance , provider("Microsoft.AppV.AppVClientWmi, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")]
class AppvPublishingServer
{
	[read(TRUE) , key(TRUE)] uint32 ID;
	[read(TRUE)] boolean SetByGroupPolicy;
	[read(TRUE)] string Url;
	[read(TRUE)] boolean GlobalRefreshEnabled;
	[read(TRUE)] boolean GlobalRefreshOnLogon;
	[read(TRUE)] uint32 GlobalRefreshInterval;
	[read(TRUE)] string GlobalRefreshIntervalUnit;
	[read(TRUE)] boolean UserRefreshEnabled;
	[read(TRUE)] boolean UserRefreshOnLogon;
	[read(TRUE)] uint32 UserRefreshInterval;
	[read(TRUE)] string UserRefreshIntervalUnit;
};

