本文整理汇总了C#中System.Configuration.Install.Installer类的典型用法代码示例。如果您正苦于以下问题:C# Installer类的具体用法?C# Installer怎么用?C# Installer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Installer类属于System.Configuration.Install命名空间,在下文中一共展示了Installer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Fill
public void Fill(Installer installer)
{
foreach (Installer installer2 in this.CreateInstallers(this.InstrumentedTypes))
{
installer.Installers.Add(installer2);
}
}
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:7,代码来源:AbstractInstallerBuilder.cs
示例2: SetUp
public void SetUp ()
{
ins = new Installer ();
state = new Hashtable ();
sub1 = new MyInstaller ();
sub2 = new MyInstaller ();
BfInstEvt = new CallInfo ();
AfInstEvt = new CallInfo ();
CommittingEvt = new CallInfo ();
CommittedEvt = new CallInfo ();
BfRbackEvt = new CallInfo ();
AfRbackEvt = new CallInfo ();
BfUninsEvt = new CallInfo ();
AfUninsEvt = new CallInfo ();;
ins.Installers.Add (sub1);
ins.Installers.Add (sub2);
ins.BeforeInstall += new InstallEventHandler (onBeforeInstall);
ins.AfterInstall += new InstallEventHandler (onAfterInstall);
ins.Committing += new InstallEventHandler (onCommitting);
ins.Committed += new InstallEventHandler (onCommitted);
ins.BeforeRollback += new InstallEventHandler (onBeforeRollback);
ins.AfterRollback += new InstallEventHandler (onAfterRollback);
ins.BeforeUninstall += new InstallEventHandler (onBeforeUninstall);
ins.AfterUninstall += new InstallEventHandler (onAfterUninstall);
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:28,代码来源:InstallerTest.cs
示例3: SetUp
public void SetUp ()
{
ins = new TransactedInstaller ();
state = new Hashtable ();
sub1 = new SucceedInstaller ();
sub2 = new FailureInstaller ();
sub3 = new SucceedInstaller ();
BfInstEvt = new CallInfo ();
AfInstEvt = new CallInfo ();
CommittingEvt = new CallInfo ();
CommittedEvt = new CallInfo ();
BfRbackEvt = new CallInfo ();
AfRbackEvt = new CallInfo ();
BfUninsEvt = new CallInfo ();
AfUninsEvt = new CallInfo ();
ins.Installers.Add (sub1);
string [] cmdLine = new string [] { "/logToConsole=false" };
ins.Context = new InstallContext ("", cmdLine); // no log file
ins.BeforeInstall += new InstallEventHandler (onBeforeInstall);
ins.AfterInstall += new InstallEventHandler (onAfterInstall);
ins.Committing += new InstallEventHandler (onCommitting);
ins.Committed += new InstallEventHandler (onCommitted);
ins.BeforeRollback += new InstallEventHandler (onBeforeRollback);
ins.AfterRollback += new InstallEventHandler (onAfterRollback);
ins.BeforeUninstall += new InstallEventHandler (onBeforeUninstall);
ins.AfterUninstall += new InstallEventHandler (onAfterUninstall);
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:30,代码来源:TransactedInstallerTest.cs
示例4: SpHostServiceInstaller
public SpHostServiceInstaller(HostSettings settings, HostConfigurator configurator)
{
_hostConfigurator = configurator;
_installer = CreateInstaller(settings);
_transactedInstaller = CreateTransactedInstaller(_installer);
}
开发者ID:r1pper,项目名称:Topshelf.StartParameters,代码行数:8,代码来源:SpHostServiceInstaller.cs
示例5: TypeWithNoEventLogsReturnsUnchangedInstaller
public void TypeWithNoEventLogsReturnsUnchangedInstaller()
{
Installer parentInstaller = new Installer();
EventLogInstallerBuilder builder = new EventLogInstallerBuilder(new Type[] { typeof(NoLogsType) });
builder.Fill(parentInstaller);
Assert.AreEqual(0, parentInstaller.Installers.Count);
}
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:8,代码来源:EventLogInstallerBuilderFixture.cs
示例6: DBForm
public DBForm(Installer pInstallerP)
{
InitializeComponent();
LoadProvider();
normalClose = false;
pInstaller = pInstallerP;
dbName = "";
}
开发者ID:salimci,项目名称:Legacy-Remote-Recorder,代码行数:8,代码来源:DBForm.cs
示例7: ProjectInstaller
public ProjectInstaller(Assembly appAssembly)
{
_installer = new Installer();
_appAssembly = appAssembly;
CreateSubInstallers();
SetInstallerContext();
}
开发者ID:arisoyang,项目名称:ncron,代码行数:8,代码来源:ProjectInstaller.cs
示例8: TypeWithNoCountersReturnsEmptyInstallers
public void TypeWithNoCountersReturnsEmptyInstallers()
{
Installer parentInstaller = new Installer();
PerformanceCounterInstallerBuilder builder
= new PerformanceCounterInstallerBuilder(new Type[] { typeof(NoCountersType) });
builder.Fill(parentInstaller);
Assert.AreEqual(0, parentInstaller.Installers.Count);
}
开发者ID:jmeckley,项目名称:Enterprise-Library-5.0,代码行数:9,代码来源:PerformanceCounterInstallerBuilderFixture.cs
示例9: uninstallService
/// <summary>
/// UnInstalls the Windows service with the given "installer" object.
/// </summary>
/// <param name="pi"></param>
/// <param name="pathToService"></param>
public static void uninstallService(Installer pi, string pathToService)
{
TransactedInstaller ti = new TransactedInstaller ();
ti.Installers.Add (pi);
string[] cmdline = {pathToService};
InstallContext ctx = new InstallContext ("Uninstall.log", cmdline );
ti.Context = ctx;
ti.Uninstall ( null );
}
开发者ID:abhishek-kumar,项目名称:AIGA,代码行数:14,代码来源:ServiceHelper.cs
示例10: Fill
/// <summary>
/// Fills the given installer with other, more specific kinds of installers that have been
/// filled with the appropriate kinds of installable resources
/// </summary>
/// <param name="installer">Outer installer to be filled with nested installers for specific resources</param>
public void Fill(Installer installer)
{
ICollection<Installer> installers = CreateInstallers(InstrumentedTypes);
foreach (Installer childInstaller in installers)
{
installer.Installers.Add(childInstaller);
}
}
开发者ID:modulexcite,项目名称:Transformalize,代码行数:14,代码来源:AbstractInstallerBuilder.cs
示例11: InstallService
/// <summary>
/// Installs the Windows service with the given "installer" object.
/// </summary>
/// <param name="installer">The installer.</param>
/// <param name="pathToService">The path to service.</param>
public static void InstallService(Installer installer, string pathToService)
{
TransactedInstaller ti = new TransactedInstaller();
ti.Installers.Add(installer);
string[] cmdline = { pathToService };
InstallContext ctx = new InstallContext("Install.log", cmdline);
ti.Context = ctx;
ti.Install(new Hashtable());
}
开发者ID:JamesTryand,项目名称:alchemi,代码行数:14,代码来源:ServiceHelper.cs
示例12: BuildInstallers
public static Installer[] BuildInstallers(WinServiceSettings settings)
{
var result = new Installer[]
{
ConfigureServiceInstaller(settings),
ConfigureServiceProcessInstaller(settings)
};
return result;
}
开发者ID:abombss,项目名称:Topshelf,代码行数:9,代码来源:WinServiceHelper.cs
示例13: AddRange
public void AddRange(Installer[] value)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
for (int i = 0; i < value.Length; i++)
{
this.Add(value[i]);
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:InstallerCollection.cs
示例14: AddRange
// Add a range of installers to this collection.
public void AddRange(Installer[] value)
{
if(value == null)
{
throw new ArgumentNullException("value");
}
foreach(Installer inst in value)
{
Add(inst);
}
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:12,代码来源:InstallerCollection.cs
示例15: AddRange
public void AddRange (Installer[] value) {
if (value == null)
{
throw new ArgumentNullException ("value");
}
for (int counter = 0; counter < value.Length; counter++)
{
Add (value[counter]);
}
}
开发者ID:nlhepler,项目名称:mono,代码行数:11,代码来源:InstallerCollection.cs
示例16: InitializeComponent
private void InitializeComponent()
{
this.serviceProcessInstaller1 = new ServiceProcessInstaller();
this.serviceInstaller1 = new ServiceInstaller();
this.serviceProcessInstaller1.Password = null;
this.serviceProcessInstaller1.Username = null;
this.serviceInstaller1.ServiceName = "Service1";
InstallerCollection installers = base.Installers;
Installer[] installerArray = new Installer[] { this.serviceProcessInstaller1, this.serviceInstaller1 };
installers.AddRange(installerArray);
}
开发者ID:kailer89,项目名称:AlienFXTest,代码行数:11,代码来源:ProjectInstaller.Designer.cs
示例17: BuilderWillFillInstallerWithCreatedChildInstallers
public void BuilderWillFillInstallerWithCreatedChildInstallers()
{
Type[] candidateTypes = new Type[] {
typeof(InstrumentedTypeWithAAttribute),
typeof(InstrumentedTypeWithAAndBAttributes)
};
MockInstallerBuilder builder = new MockInstallerBuilder(candidateTypes, typeof(InstrumentationAAttribute));
Installer parentInstaller = new Installer();
}
开发者ID:bnantz,项目名称:NCS-V2-0,代码行数:11,代码来源:AbstractInstallerBuilderFixture.cs
示例18: CreateUninstaller
protected override Installer CreateUninstaller(HostSettings settings, string commandLine)
{
var baseInstallers = new Installer[]
{
CreateServiceInstaller(settings, new string[] {}, HostStartMode.Automatic),
CreateServiceProcessInstaller(ServiceAccount.LocalService, "", "")
};
var mainInstaller = new HostInstaller(settings, commandLine, baseInstallers);
return CreateTransactedInstaller(mainInstaller);
}
开发者ID:geffzhang,项目名称:Topshelf.Unix,代码行数:12,代码来源:WindowsHostServiceInstallerImpl.cs
示例19: WillFindSingleEventLogTypeInListOfTypes
public void WillFindSingleEventLogTypeInListOfTypes()
{
Installer parentInstaller = new Installer();
EventLogInstallerBuilder builder = new EventLogInstallerBuilder(new Type[] { typeof(NoLogsType), typeof(SimpleLogType) });
builder.Fill(parentInstaller);
Assert.AreEqual(1, parentInstaller.Installers.Count);
Assert.AreSame(typeof(EventLogInstaller), parentInstaller.Installers[0].GetType());
EventLogInstaller installer = (EventLogInstaller)parentInstaller.Installers[0];
Assert.AreEqual("FooLog", installer.Log);
}
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:13,代码来源:EventLogInstallerBuilderFixture.cs
示例20: installService
internal static void installService()
{
ServiceInstaller serviceInstaller = null;
ServiceProcessInstaller serviceProcessInstaller = null;
Installer projectInstaller = null;
TransactedInstaller transactedInstaller = null;
try
{
serviceInstaller = new ServiceInstaller();
serviceInstaller.ServiceName = "OpenVPNManager";
serviceInstaller.StartType = ServiceStartMode.Automatic;
serviceProcessInstaller = new ServiceProcessInstaller();
serviceProcessInstaller.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
serviceProcessInstaller.Password = null;
serviceProcessInstaller.Username = null;
projectInstaller = new Installer();
projectInstaller.Installers.Add(serviceInstaller);
projectInstaller.Installers.Add(serviceProcessInstaller);
transactedInstaller = new TransactedInstaller();
transactedInstaller.Installers.Add(projectInstaller);
transactedInstaller.Context = new InstallContext();
transactedInstaller.Context.Parameters["assemblypath"] = Assembly.GetExecutingAssembly().Location + "\" \"/EXECUTESERVICE";
transactedInstaller.Install(new Hashtable());
}
catch (InvalidOperationException e)
{
if (e.InnerException != null && e.InnerException is Win32Exception)// Probably: "Service already exists."
MessageBox.Show("Error: " + e.InnerException.Message);
else if (e.InnerException != null && e.InnerException is InvalidOperationException && e.InnerException.InnerException != null && e.InnerException.InnerException is Win32Exception)// Probably: "Permission denied"
{
String MSG_ServiceInstallPermissionErrorAdvice = Program.res.GetString("MSG_ServiceInstallPermissionErrorAdvice");
MessageBox.Show("Error: " + e.InnerException.InnerException.Message + "\r\n\r\n" + MSG_ServiceInstallPermissionErrorAdvice);
}
else
throw;
}
finally
{
if (serviceInstaller != null)
serviceInstaller.Dispose();
if (serviceProcessInstaller != null)
serviceProcessInstaller.Dispose();
if (projectInstaller != null)
projectInstaller.Dispose();
if (transactedInstaller != null)
transactedInstaller.Dispose();
}
}
开发者ID:gwww,项目名称:openvpn-manager,代码行数:51,代码来源:ServiceHelper.cs
注:本文中的System.Configuration.Install.Installer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论