root / trunk / Pithos.ShellExtensions / ProjectInstaller.cs @ d78cbf09
History | View | Annotate | Download (2.1 kB)
1 |
/********************************** Module Header **********************************\ |
---|---|
2 |
Module Name: ProjectInstaller.cs |
3 |
Project: CSShellExtContextMenuHandler |
4 |
Copyright (c) Microsoft Corporation. |
5 |
|
6 |
The installer class defines the custom actions in the setup. We use the custom |
7 |
actions to register and unregister the COM-visible classes in the current managed |
8 |
assembly. |
9 |
|
10 |
This source is subject to the Microsoft Public License. |
11 |
See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL. |
12 |
All other rights reserved. |
13 |
|
14 |
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER |
15 |
EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
16 |
MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. |
17 |
\***********************************************************************************/ |
18 |
|
19 |
#region Using directives |
20 |
|
21 |
using System.Collections; |
22 |
using System.ComponentModel; |
23 |
using System.Runtime.InteropServices; |
24 |
|
25 |
#endregion |
26 |
|
27 |
|
28 |
namespace Pithos.ShellExtensions |
29 |
{ |
30 |
[RunInstaller(true), ComVisible(false)] |
31 |
public partial class ProjectInstaller : System.Configuration.Install.Installer |
32 |
{ |
33 |
public ProjectInstaller() |
34 |
{ |
35 |
InitializeComponent(); |
36 |
} |
37 |
|
38 |
public override void Install(IDictionary stateSaver) |
39 |
{ |
40 |
base.Install(stateSaver); |
41 |
|
42 |
// Call RegistrationServices.RegisterAssembly to register the classes in |
43 |
// the current managed assembly to enable creation from COM. |
44 |
RegistrationServices regService = new RegistrationServices(); |
45 |
regService.RegisterAssembly( |
46 |
this.GetType().Assembly, |
47 |
AssemblyRegistrationFlags.SetCodeBase); |
48 |
} |
49 |
|
50 |
public override void Uninstall(IDictionary savedState) |
51 |
{ |
52 |
base.Uninstall(savedState); |
53 |
|
54 |
// Call RegistrationServices.UnregisterAssembly to unregister the classes |
55 |
// in the current managed assembly. |
56 |
RegistrationServices regService = new RegistrationServices(); |
57 |
regService.UnregisterAssembly(this.GetType().Assembly); |
58 |
} |
59 |
} |
60 |
} |