using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
using System.ServiceProcess;
using System.Threading.Tasks;

namespace Frame.TimerTask
{
    [RunInstaller(true)]
    public partial class ProjectInstaller : System.Configuration.Install.Installer
    {
        public ProjectInstaller()
        {
            InitializeComponent();
            serviceInstaller1.DisplayName = System.Configuration.ConfigurationManager.AppSettings["DisplayName"].ToString();
            serviceInstaller1.Description = System.Configuration.ConfigurationManager.AppSettings["Description"].ToString();
            serviceInstaller1.DelayedAutoStart = System.Configuration.ConfigurationManager.AppSettings["DelayedAutoStart"].ToString().ToLower() == "true" ? true : false;
            serviceInstaller1.ServiceName = System.Configuration.ConfigurationManager.AppSettings["ServiceName"].ToString();
            serviceInstaller1.StartType = (ServiceStartMode)(int.Parse(System.Configuration.ConfigurationManager.AppSettings["StartType"].ToString()));

            serviceProcessInstaller1.Account = (ServiceAccount)(int.Parse(System.Configuration.ConfigurationManager.AppSettings["Account"].ToString()));
        }
    }
}
