• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Install.InstallEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: ServiceInstaller_AfterInstall

        void ServiceInstaller_AfterInstall(object sender, InstallEventArgs e)
        {
            this.CheckUserPathVariable();

            ServiceController sc = new ServiceController("MySQL Backup Service");
            sc.Start();
        }
开发者ID:night-king,项目名称:MySQL-Backup-Manager,代码行数:7,代码来源:ProjectInstaller.cs


示例17: TicketEvolutionServiceProjectInstallerAfterInstall

        private void TicketEvolutionServiceProjectInstallerAfterInstall(object sender, InstallEventArgs e)
        {
            var controller = new ServiceController(WindowServiceInstaller.ServiceName);
            try
            {
                controller.Start();
            }
            catch (Exception ex)
            {
                try
                {
                    var source = WindowServiceInstaller.ServiceName;
                    var log = WindowServiceInstaller.DisplayName;
                    if (!EventLog.SourceExists(source))
                        EventLog.CreateEventSource(source, log);

                    var eLog = new EventLog { Source = source };

                    eLog.WriteEntry(@"The service could not be started. Please start the service manually. Error: " + ex.Message, EventLogEntryType.Error);
                }
                catch
                {

                }

            }
        }
开发者ID:tccyp001,项目名称:ticketrevolution,代码行数:27,代码来源:ProjectInstaller.cs


示例18: CustomInstaller_AfterInstall

        private void CustomInstaller_AfterInstall(object sender, InstallEventArgs e)
        {
            string serverName = this.Context.Parameters["SERVERNAME"];
            string userName = this.Context.Parameters["USERNAME"];
            string conferenceNumber = this.Context.Parameters["CONFERENCENUMBER"];
            string pinNumber = this.Context.Parameters["PINNUMBER"];
            string isDefaultLoc = this.Context.Parameters["ISDEFAULTLOCATION"];

            Microsoft.Win32.RegistryKey key;

            key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(Constants.REG_KEY_NAME_ADDIN_SETTING);

            key.SetValue(Constants.REG_ATTR_NAME_CTI_SERVER_NAME, serverName, Microsoft.Win32.RegistryValueKind.String);
            key.SetValue(Constants.REG_ATTR_NAME_USERNAME, userName, Microsoft.Win32.RegistryValueKind.String);
            key.SetValue(Constants.REG_ATTR_NAME_CONFERENCE_NUMBER, conferenceNumber, Microsoft.Win32.RegistryValueKind.String);
            key.SetValue(Constants.REG_ATTR_NAME_CONFERENCE_ACCESS_CODE, pinNumber, Microsoft.Win32.RegistryValueKind.String);

            if (isDefaultLoc == "1")
            {
                key.SetValue(Constants.REG_ATTR_NAME_ISDEFAULTLOCATION, 1, Microsoft.Win32.RegistryValueKind.DWord);
            }
            else
            {
                key.SetValue(Constants.REG_ATTR_NAME_ISDEFAULTLOCATION, 0, Microsoft.Win32.RegistryValueKind.DWord);
            }

            key.Close();
        }
开发者ID:kingservice,项目名称:sipxecs,代码行数:28,代码来源:CustomInstaller.cs


示例19: ProjectInstaller_BeforeInstall

        void ProjectInstaller_BeforeInstall(object sender, InstallEventArgs e)
        {
            //System.Windows.Forms.MessageBox.Show("Already installed: " + DoesServiceExist("SmokeSignal").ToString());

            //EventLog elog = new EventLog("Application");
            //elog.Source = "SmokeSignal";
            //elog.WriteEntry(string.Format("ProjectInstaller_BeforeInstall, exists:{0}", DoesServiceExist("SmokeSignal")));

            if (!ServiceManager.DoesServiceExist("SmokeSignalSrvc"))
            {
                //System.Windows.Forms.MessageBox.Show("!DoesServiceExist(SmokeSignal) == true");
                return;
            }
            try
            {
                ServiceManager.StopService("SmokeSignalSrvc");

                //elog.WriteEntry(string.Format("ProjectInstaller_BeforeInstall, Stopped"));
                //System.Windows.Forms.MessageBox.Show("After Stop");

                ServiceManager.UnInstallService("localhost", "SmokeSignalSrvc");
            }
            catch (System.ServiceProcess.TimeoutException ex)
            {
                //System.Windows.Forms.MessageBox.Show("TimeoutException");
                //elog.WriteEntry(string.Format("ProjectInstaller_BeforeInstall, TimeoutException"));
            }
        }
开发者ID:potrebic,项目名称:smokesignal.net,代码行数:28,代码来源:ProjectInstaller.cs


示例20: Installer_Handler

 private void Installer_Handler(object sender, InstallEventArgs e)
 {
     if (!String.IsNullOrEmpty(this.Context.Parameters["ServiceName"]))
     {
         this.BunnyBotInstaller.ServiceName = this.BunnyBotInstaller.DisplayName = this.Context.Parameters["ServiceName"];
     }
 }
开发者ID:thegecko,项目名称:bunnybot,代码行数:7,代码来源:ProjectInstaller.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Install.Installer类代码示例发布时间:2022-05-26
下一篇:
C# Install.InstallContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap