本文整理汇总了C#中System.Configuration.Install.Installer类的典型用法代码示例。如果您正苦于以下问题:C# Installer类的具体用法?C# Installer怎么用?C# Installer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Installer类属于System.Configuration.Install命名空间,在下文中一共展示了Installer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Fill
public void Fill(Installer installer)
{
foreach (Installer installer2 in this.CreateInstallers(this.InstrumentedTypes))
{
installer.Installers.Add(installer2);
}
}
示例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);
}
示例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);
}
示例4: SpHostServiceInstaller
public SpHostServiceInstaller(HostSettings settings, HostConfigurator configurator)
{
_hostConfigurator = configurator;
_installer = CreateInstaller(settings);
_transactedInstaller = CreateTransactedInstaller(_installer);
}
示例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);
}
示例6: DBForm
public DBForm(Installer pInstallerP)
{
InitializeComponent();
LoadProvider();
normalClose = false;
pInstaller = pInstallerP;
dbName = "";
}
示例7: ProjectInstaller
public ProjectInstaller(Assembly appAssembly)
{
_installer = new Installer();
_appAssembly = appAssembly;
CreateSubInstallers();
SetInstallerContext();
}
示例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);
}
示例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 );
}
示例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);
}
}
示例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());
}
示例12: BuildInstallers
public static Installer[] BuildInstallers(WinServiceSettings settings)
{
var result = new Installer[]
{
ConfigureServiceInstaller(settings),
ConfigureServiceProcessInstaller(settings)
};
return result;
}
示例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]);
}
}
示例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);
}
}
示例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]);
}
}