Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Snapit - MMC Installer, things
using Microsoft.ManagementConsole;
using System.ComponentModel;
using System;
using System.Security.Permissions;
using System.Collections;
/*
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /target:library /reference:C:\Windows\assembly\GAC_MSIL\microsoft.managementconsole\3.0.0.0__31bf3856ad364e35\microsoft.managementconsole.dll .\Snapit.cs
C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe SnapIt.dll
*/
[assembly: PermissionSetAttribute(SecurityAction.RequestMinimum, Unrestricted = true)]
namespace Microsoft.ManagementConsole.Samples
{
/// <summary>
/// The RunInstaller attribute allows the .Net framework to install the assembly.
/// </summary>
[RunInstaller(true)]
public class InstallUtilSupport : SnapInInstaller
{
public override void Install( IDictionary stateSaver ) {
Console.WriteLine("BoomTown! INSTALL");
}
public override void Uninstall( IDictionary savedState ) {
Console.WriteLine("BoomTown! UNINSTALL");
}
}
/// <summary>
/// The main entry point for the creation of the snap-in.
/// </summary>
[SnapInSettings("{CFAA3895-4B02-4431-A168-A6416013C3DD}",
DisplayName = "- Simple SnapIn Sample",
Description = "Simple Hello World SnapIn")]
public class SimpleSnapIn : SnapIn
{
/// <summary>
/// The constructor.
/// </summary>
public SimpleSnapIn()
{
// Update tree pane with a node in the tree
this.RootNode = new ScopeNode();
this.RootNode.DisplayName = "Hello World";
}
} // class
} // namespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment