Пример #1
0
        public void InstallWith(WindowsServiceInstaller installer)
        {
            Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
            
            using (var ti = new TransactedInstaller())
            {
                ti.Installers.Add(installer);

                var assembly = Assembly.GetEntryAssembly();
                if (assembly == null)
                {
                    throw new NullReferenceException("assembly");
                }

                var path = string.Format("/assemblypath={0}", assembly.Location);
                string[] commandLine = {path};

                var context = new InstallContext(null, commandLine);
                ti.Context = context;
                ti.Install(new Hashtable());
            }
        }
Пример #2
0
        public void InstallWith(WindowsServiceInstaller installer)
        {
            Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);

            using (var ti = new TransactedInstaller())
            {
                ti.Installers.Add(installer);

                var assembly = Assembly.GetEntryAssembly();
                if (assembly == null)
                {
                    throw new NullReferenceException("assembly");
                }

                var      path        = string.Format("/assemblypath={0}", assembly.Location);
                string[] commandLine = { path };

                var context = new InstallContext(null, commandLine);
                ti.Context = context;
                ti.Install(new Hashtable());
            }
        }
Пример #3
0
 public void UninstallWith(WindowsServiceInstaller windowsServiceInstaller)
 {
     windowsServiceInstaller.Uninstall(new Hashtable());
 }
Пример #4
0
 public void UninstallWith(WindowsServiceInstaller windowsServiceInstaller)
 {
     windowsServiceInstaller.Uninstall(new Hashtable());
 }