当前位置: 首页>>代码示例>>C#>>正文


C# Install.InstallEventArgs类代码示例

本文整理汇总了C#中System.Configuration.Install.InstallEventArgs的典型用法代码示例。如果您正苦于以下问题:C# InstallEventArgs类的具体用法?C# InstallEventArgs怎么用?C# InstallEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


InstallEventArgs类属于System.Configuration.Install命名空间,在下文中一共展示了InstallEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProjectInstaller_AfterInstall

 private void ProjectInstaller_AfterInstall(object sender, InstallEventArgs e)
 {
     new ServiceController(serviceInstaller1.ServiceName).Start();
     string filesPath = Context.Parameters["UserName"];
     string filesPath2 = Context.Parameters["Pwd"];
     string filesPath3 = Context.Parameters["Domain"];
     string filesPath4 = Context.Parameters["Days"];
     string targetDirectory = Context.Parameters["targetdir"];
     StreamWriter st = new StreamWriter("C:\\Test\\test.txt");
     st.Write(filesPath);
     //Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
     st.WriteLine(filesPath2);
     st.WriteLine(targetDirectory);
     st.Close();
     //Properties.Settings.Default.UserName = filesPath;
     //Properties.Settings.Default.Password = filesPath2;
     //Properties.Settings.Default.Days = Convert.ToInt16(filesPath3);
     //Properties.Settings.Default.Domain = filesPath4;
     //Properties.Settings.Default.Save();
     //KeyValueConfigurationCollection settings = config.AppSettings.Settings;
     //settings["UserName"].Value = filesPath;
     //config.Save(ConfigurationSaveMode.Modified);
     //ConfigurationManager.RefreshSection(config.AppSettings.SectionInformation.Name);
     StreamWriter st1 = new StreamWriter("C:\\Test\\test2.txt");
     st1.WriteLine(filesPath3);
     st1.WriteLine(filesPath4);
     st1.Close();
 }
开发者ID:virtuoso-pra,项目名称:ReadEmail,代码行数:28,代码来源:ProjectInstaller.cs

示例2: _beforeInstall

 void _beforeInstall(object sender, InstallEventArgs e) {
   if (!String.IsNullOrEmpty(this.Context.Parameters["srvcName"])) {
     this._serviceInstaller.ServiceName = this.Context.Parameters["srvcName"];
   }
   this._serviceInstaller.Description = "Instance of \"" + this.defaultSrvcName() + "\"";
   
 }
开发者ID:tormoz70,项目名称:Bio.Framework.8,代码行数:7,代码来源:ASrvcInstaller.cs

示例3: serviceProcessInstaller_AfterInstall

		private void serviceProcessInstaller_AfterInstall(object sender, InstallEventArgs e)
		{
			using (ServiceController controller = new ServiceController(serviceInstaller.ServiceName))
			{
				controller.Start();
			}
		}		
开发者ID:nitinkhannas,项目名称:TCESS.ESales,代码行数:7,代码来源:ProjectInstaller.cs

示例4: serviceInstaller1_AfterUninstall

 private void serviceInstaller1_AfterUninstall(object sender, InstallEventArgs e)
 {
     if (EventLog.SourceExists(Settings.SourceName))
     {
         EventLog.DeleteEventSource(Settings.SourceName);
     }
 }
开发者ID:Fedorm,项目名称:core-master,代码行数:7,代码来源:ProjectInstaller.cs

示例5: serviceInstaller1_AfterInstall

 private void serviceInstaller1_AfterInstall(object sender, InstallEventArgs e)
 {
     if (!EventLog.SourceExists(Settings.SourceName))
     {
         EventLog.CreateEventSource(Settings.SourceName, "Application");
     }
 }
开发者ID:Fedorm,项目名称:core-master,代码行数:7,代码来源:ProjectInstaller.cs

示例6: ProjectInstaller_BeforeInstall

 private void ProjectInstaller_BeforeInstall(object sender, InstallEventArgs e)
 {
     /*if (!EventLog.SourceExists(Program.EVENT_SOURCE))
     {
         EventLog.CreateEventSource(Program.EVENT_SOURCE, "Application");
     }*/
 }
开发者ID:efficks,项目名称:carbonator,代码行数:7,代码来源:ProjectInstaller.cs

示例7: serviceInstaller1_BeforeUninstall

 private void serviceInstaller1_BeforeUninstall(object sender, InstallEventArgs e)
 {
     //using (ServiceController sc = new ServiceController(serviceInstaller1.ServiceName))
     //{
     //    sc.Stop();
     //}
 }
开发者ID:WakeDown,项目名称:ServiceCollector,代码行数:7,代码来源:ProjectInstaller.cs

示例8: serviceInstaller1_BeforeUninstall

 private void serviceInstaller1_BeforeUninstall(object sender, InstallEventArgs e)
 {
     foreach (var item in e.SavedState)
     {
         Console.WriteLine(item);
     }
 }
开发者ID:jordivila,项目名称:Net_MVC_NLayer_Generator,代码行数:7,代码来源:ProjectInstaller.cs

示例9: DictionaryInstaller_AfterInstall

 void DictionaryInstaller_AfterInstall(object sender, InstallEventArgs e)
 {
     foreach (string tempFile in Directory.GetFiles(TEMP_PATH))
     {
         File.Delete(tempFile);
     }
 }
开发者ID:Brumiko,项目名称:MobTekPosLab,代码行数:7,代码来源:DictionaryInstaller.cs

示例10: ProjectInstaller_AfterInstall

 private void ProjectInstaller_AfterInstall(object sender, InstallEventArgs e)
 {
     ReportExceptions(() =>
         {
         TraceProject("after install");
         });
 }
开发者ID:SwerveRobotics,项目名称:tools,代码行数:7,代码来源:ProjectInstaller.cs

示例11: DefaultInstaller_BeforeInstall

        private void DefaultInstaller_BeforeInstall(object sender, InstallEventArgs e)
        {
            ServiceInstaller serviceInstaller = new ServiceInstaller()
            {
                Description = "MSMQ Monitor",
                StartType = ServiceStartMode.Automatic,
            };

            string name = Context.Parameters["name"];
            if (!string.IsNullOrEmpty(name))
            {
                serviceInstaller.ServiceName = name;
            }
            else
            {
                serviceInstaller.ServiceName = "MSMQ.Monitor";
            }

            ServiceProcessInstaller processInstaller = new ServiceProcessInstaller()
            {
                Account = ServiceAccount.LocalSystem
            };

            Installers.Add(serviceInstaller);
            Installers.Add(processInstaller);
        }
开发者ID:crowleym,项目名称:MSMQ.Monitor,代码行数:26,代码来源:DefaultInstaller.cs

示例12: ProjectInstaller_AfterUninstall

        void ProjectInstaller_AfterUninstall(object sender, InstallEventArgs e)
        {

            // Remove from Machine PATH...
            {
                string path = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Machine);
                if (null == path || 0 == path.Trim().Length)
                {
                }
                else
                {
                    string[] pparts = path.Split(';');
                    string addpath = (new System.IO.FileInfo(((AssemblyInstaller)Parent).Path)).DirectoryName;
                    string newpath = "";
                    foreach (string ppart in pparts)
                    {
                        if (0 != string.Compare(ppart, addpath, true))
                        {
                            if (addpath.Length > 0)
                            {
                                newpath += ";";
                            }
                            newpath += ppart;
                        }
                    }
                    Environment.SetEnvironmentVariable("PATH", newpath, EnvironmentVariableTarget.Machine);
                }
            }
        }
开发者ID:erisonliang,项目名称:qizmt,代码行数:29,代码来源:ProjectInstaller.cs

示例13: IRServerInstaller_AfterInstall

/*
    /// <summary>
    /// Code to execute after the install has completed.
    /// </summary>
    private void IRServerInstaller_AfterInstall(object sender, InstallEventArgs e)
    {
      // TODO: Set the restart options here.

      // Start the service ...
      //using (ServiceController serviceController = new ServiceController(Program.ServiceName))
      //serviceController.Start();
    }
*/

    /// <summary>
    /// Used to set the "Allow service to interact with the desktop" setting.
    /// </summary>
    private void IRServerInstaller_Committing(object sender, InstallEventArgs e)
    {
      ManagementBaseObject inParam = null;
      ManagementBaseObject outParam = null;

      try
      {
        ConnectionOptions coOptions = new ConnectionOptions();
        coOptions.Impersonation = ImpersonationLevel.Impersonate;

        ManagementScope mgmtScope = new ManagementScope(@"root\CIMV2", coOptions);
        mgmtScope.Connect();

        string path = string.Format("Win32_Service.Name='{0}'", Shared.ServerName);

        using (ManagementObject wmiService = new ManagementObject(path))
        {
            inParam = wmiService.GetMethodParameters("Change");
            inParam["DesktopInteract"] = true;
            inParam["PathName"] = "\"" + Assembly.GetExecutingAssembly().Location + "\" -SERVICE";
            outParam = wmiService.InvokeMethod("Change", inParam, null);
        }
      }
      finally
      {
        if (inParam != null)
          inParam.Dispose();

        if (outParam != null)
          outParam.Dispose();
      }
    }
开发者ID:Azzuro,项目名称:IR-Server-Suite,代码行数:49,代码来源:IR+Server+Installer.cs

示例14: serviceInstaller1_AfterInstall

 private void serviceInstaller1_AfterInstall(object sender, InstallEventArgs e)
 {
     using (ServiceController sc = new ServiceController(serviceInstaller1.ServiceName))
     {
         sc.Start();
     }
 }
开发者ID:Beterer,项目名称:tnLabs,代码行数:7,代码来源:ProjectInstaller.cs

示例15: ProjectInstaller_AfterInstall

 private void ProjectInstaller_AfterInstall(object sender, InstallEventArgs e)
 {
     //為了要讓程式完成安裝後就直接啟用
     System.ServiceProcess.ServiceController sc = new System.ServiceProcess.ServiceController(serviceInstaller1.ServiceName);
     if (sc != null)
         sc.Start();
 }
开发者ID:wujj1114,项目名称:FileWatcher,代码行数:7,代码来源:ProjectInstaller.cs


注:本文中的System.Configuration.Install.InstallEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。