forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEngineInstaller.cs
More file actions
83 lines (77 loc) · 2.68 KB
/
Copy pathEngineInstaller.cs
File metadata and controls
83 lines (77 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
using System.IO;
using System.Management.Automation;
namespace Microsoft.PowerShell
{
/// <summary>
///
/// EngineInstaller is a class for facilitating registry of necessary
/// information for monad engine.
///
/// This class will be built with monad console host dll
/// (System.Management.Automation.dll).
///
/// At install time, installation utilities (like InstallUtil.exe) will
/// call install this engine assembly based on the implementation in
/// this class.
///
/// This class derives from base class PSInstaller. PSInstaller will
/// handle the details about how information got written into registry.
/// Here, the information about registry content is provided.
///
/// </summary>
[RunInstaller(true)]
public sealed class EngineInstaller : PSInstaller
{
/// <summary>
/// Constructor
/// </summary>
public EngineInstaller()
: base()
{
}
/// <summary>
///
/// </summary>
internal sealed override string RegKey
{
get
{
return RegistryStrings.MonadEngineKey;
}
}
private static string EngineVersion
{
get
{
return PSVersionInfo.FeatureVersionString;
}
}
private Dictionary<String, object> _regValues = null;
/// <summary>
///
/// </summary>
internal sealed override Dictionary<String, object> RegValues
{
get
{
if (_regValues == null)
{
_regValues = new Dictionary<String, object>();
_regValues[RegistryStrings.MonadEngine_MonadVersion] = EngineVersion;
_regValues[RegistryStrings.MonadEngine_ApplicationBase] = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
_regValues[RegistryStrings.MonadEngine_ConsoleHostAssemblyName] = Assembly.GetExecutingAssembly().FullName;
_regValues[RegistryStrings.MonadEngine_ConsoleHostModuleName] = Assembly.GetExecutingAssembly().Location;
_regValues[RegistryStrings.MonadEngine_RuntimeVersion] = Assembly.GetExecutingAssembly().ImageRuntimeVersion;
}
return _regValues;
}
}
}
}