Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Skovhede <kenneth@hexad.dk>2016-09-23 15:11:53 +0300
committerKenneth Skovhede <kenneth@hexad.dk>2016-09-23 15:11:53 +0300
commit3441bdb1c56171cd1381b868b46b9d80f2c77dd0 (patch)
treec4e9d40764ee5ae0e5d14044e27709faf2063275 /Duplicati/WindowsService
parent51e0ff3614d3056640b31af41254eb772e68e9e2 (diff)
Tabs-to-spaces fix
Diffstat (limited to 'Duplicati/WindowsService')
-rw-r--r--Duplicati/WindowsService/Program.cs78
-rw-r--r--Duplicati/WindowsService/ProjectInstaller.cs36
-rw-r--r--Duplicati/WindowsService/ServiceControl.cs6
-rw-r--r--Duplicati/WindowsService/ServiceProcessInstaller.cs20
4 files changed, 70 insertions, 70 deletions
diff --git a/Duplicati/WindowsService/Program.cs b/Duplicati/WindowsService/Program.cs
index 17483528a..ee0fc6ca9 100644
--- a/Duplicati/WindowsService/Program.cs
+++ b/Duplicati/WindowsService/Program.cs
@@ -13,48 +13,48 @@ namespace Duplicati.WindowsService
{
public static void Main(string[] args)
{
- var install = args != null && args.Where(x => string.Equals("install", x, StringComparison.OrdinalIgnoreCase)).Any();
- var uninstall = args != null && args.Where(x => string.Equals("uninstall", x, StringComparison.OrdinalIgnoreCase)).Any();
- var help = args != null && args.Where(x => string.Equals("help", x, StringComparison.OrdinalIgnoreCase)).Any();
+ var install = args != null && args.Where(x => string.Equals("install", x, StringComparison.OrdinalIgnoreCase)).Any();
+ var uninstall = args != null && args.Where(x => string.Equals("uninstall", x, StringComparison.OrdinalIgnoreCase)).Any();
+ var help = args != null && args.Where(x => string.Equals("help", x, StringComparison.OrdinalIgnoreCase)).Any();
- if (help)
- {
- Console.WriteLine("This is a Windows Service wrapper tool that hosts the Duplicati.Server.exe process, letting it run as a windows service.");
- Console.WriteLine("|To run from a console, run the Duplicati.Server.exe instead of Duplicati.WindowsService.exe");
- Console.WriteLine();
- Console.WriteLine("Supported commands:");
- Console.WriteLine(" install:\r\n Installs the service");
- Console.WriteLine(" uninstall:\r\n Uninstalls the service");
- Console.WriteLine();
- Console.WriteLine("Supported options for the install command:");
- Console.WriteLine(" /localuser:\r\n Installs the service as a local user");
- Console.WriteLine();
- Console.WriteLine("It is possible to pass arguments to Duplicati.Server.exe, simply add them to the commandline:");
- Console.WriteLine(" Duplicati.WindowsService.exe install --webservice-interface=loopback --log-retention=3M");
- Console.WriteLine();
- Console.WriteLine("To see supported options, run Duplicati.Server.exe:");
- Console.WriteLine(" Duplicati.Server.exe help");
- Console.WriteLine();
- Console.WriteLine("To debug the WindowsService setup, add the --debug-service:");
- Console.WriteLine(" Duplicati.WindowsService.exe install --debug-service");
- }
- else if (install || uninstall)
- {
- // Remove the install and uninstall flags if they are present
- var commandline = string.Join(" ", args.Where(x => !(string.Equals("install", x, StringComparison.OrdinalIgnoreCase) || string.Equals("uninstall", x, StringComparison.OrdinalIgnoreCase))));
- var selfexec = Assembly.GetExecutingAssembly().Location;
+ if (help)
+ {
+ Console.WriteLine("This is a Windows Service wrapper tool that hosts the Duplicati.Server.exe process, letting it run as a windows service.");
+ Console.WriteLine("|To run from a console, run the Duplicati.Server.exe instead of Duplicati.WindowsService.exe");
+ Console.WriteLine();
+ Console.WriteLine("Supported commands:");
+ Console.WriteLine(" install:\r\n Installs the service");
+ Console.WriteLine(" uninstall:\r\n Uninstalls the service");
+ Console.WriteLine();
+ Console.WriteLine("Supported options for the install command:");
+ Console.WriteLine(" /localuser:\r\n Installs the service as a local user");
+ Console.WriteLine();
+ Console.WriteLine("It is possible to pass arguments to Duplicati.Server.exe, simply add them to the commandline:");
+ Console.WriteLine(" Duplicati.WindowsService.exe install --webservice-interface=loopback --log-retention=3M");
+ Console.WriteLine();
+ Console.WriteLine("To see supported options, run Duplicati.Server.exe:");
+ Console.WriteLine(" Duplicati.Server.exe help");
+ Console.WriteLine();
+ Console.WriteLine("To debug the WindowsService setup, add the --debug-service:");
+ Console.WriteLine(" Duplicati.WindowsService.exe install --debug-service");
+ }
+ else if (install || uninstall)
+ {
+ // Remove the install and uninstall flags if they are present
+ var commandline = string.Join(" ", args.Where(x => !(string.Equals("install", x, StringComparison.OrdinalIgnoreCase) || string.Equals("uninstall", x, StringComparison.OrdinalIgnoreCase))));
+ var selfexec = Assembly.GetExecutingAssembly().Location;
- // --uninstall + --install = reinstall
- if (uninstall)
- ManagedInstallerClass.InstallHelper(new string[] { "/u", selfexec });
- if (install)
- ManagedInstallerClass.InstallHelper(new string[] { "/commandline=" + commandline, selfexec });
- }
- else
- {
- ServiceBase.Run(new ServiceBase[] { new ServiceControl(args) });
- }
+ // --uninstall + --install = reinstall
+ if (uninstall)
+ ManagedInstallerClass.InstallHelper(new string[] { "/u", selfexec });
+ if (install)
+ ManagedInstallerClass.InstallHelper(new string[] { "/commandline=" + commandline, selfexec });
+ }
+ else
+ {
+ ServiceBase.Run(new ServiceBase[] { new ServiceControl(args) });
+ }
}
}
}
diff --git a/Duplicati/WindowsService/ProjectInstaller.cs b/Duplicati/WindowsService/ProjectInstaller.cs
index eec0bf56b..24c5df53c 100644
--- a/Duplicati/WindowsService/ProjectInstaller.cs
+++ b/Duplicati/WindowsService/ProjectInstaller.cs
@@ -20,27 +20,27 @@ namespace Duplicati.WindowsService
});
}
- public override void Install(IDictionary stateSaver)
- {
- var commandline = Context.Parameters["commandline"];
- if (!string.IsNullOrWhiteSpace(commandline))
- {
- var rawpath = Context.Parameters["assemblypath"];
- var path = new StringBuilder(rawpath);
- if (!rawpath.StartsWith("\"", StringComparison.Ordinal) || !rawpath.EndsWith("\"", StringComparison.Ordinal))
- {
- path.Insert(0, '"');
- path.Append('"');
- }
+ public override void Install(IDictionary stateSaver)
+ {
+ var commandline = Context.Parameters["commandline"];
+ if (!string.IsNullOrWhiteSpace(commandline))
+ {
+ var rawpath = Context.Parameters["assemblypath"];
+ var path = new StringBuilder(rawpath);
+ if (!rawpath.StartsWith("\"", StringComparison.Ordinal) || !rawpath.EndsWith("\"", StringComparison.Ordinal))
+ {
+ path.Insert(0, '"');
+ path.Append('"');
+ }
- path.Append(" ");
- path.Append(commandline);
+ path.Append(" ");
+ path.Append(commandline);
- Context.Parameters["assemblypath"] = path.ToString();
- }
+ Context.Parameters["assemblypath"] = path.ToString();
+ }
- base.Install(stateSaver);
- }
+ base.Install(stateSaver);
+ }
}
}
diff --git a/Duplicati/WindowsService/ServiceControl.cs b/Duplicati/WindowsService/ServiceControl.cs
index b6eddc9e0..5395d12f4 100644
--- a/Duplicati/WindowsService/ServiceControl.cs
+++ b/Duplicati/WindowsService/ServiceControl.cs
@@ -34,9 +34,9 @@ namespace Duplicati.WindowsService
m_eventLog.Source = LOG_SOURCE;
m_eventLog.Log = LOG_NAME;
m_verbose_messages = args != null && args.Any(x => string.Equals("--debug-service", x, StringComparison.OrdinalIgnoreCase));
- m_cmdargs = (args ?? new string[0]).Where(x => !string.Equals("--debug-service", x, StringComparison.OrdinalIgnoreCase)).ToArray();
+ m_cmdargs = (args ?? new string[0]).Where(x => !string.Equals("--debug-service", x, StringComparison.OrdinalIgnoreCase)).ToArray();
- }
+ }
protected override void OnStart(string[] args)
{
@@ -55,7 +55,7 @@ namespace Duplicati.WindowsService
private void DoStart(string[] args)
{
- var startargs = (args ?? new string[0]).Union(m_cmdargs ?? new string[0]).ToArray();
+ var startargs = (args ?? new string[0]).Union(m_cmdargs ?? new string[0]).ToArray();
if (m_verbose_messages)
m_eventLog.WriteEntry("Starting...");
diff --git a/Duplicati/WindowsService/ServiceProcessInstaller.cs b/Duplicati/WindowsService/ServiceProcessInstaller.cs
index cc90447ab..9b76e3407 100644
--- a/Duplicati/WindowsService/ServiceProcessInstaller.cs
+++ b/Duplicati/WindowsService/ServiceProcessInstaller.cs
@@ -13,17 +13,17 @@ namespace Duplicati.WindowsService
this.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
}
- public override void Install(System.Collections.IDictionary stateSaver)
- {
- var localuser = Context.Parameters["localuser"];
- if (localuser != null)
- {
- this.Account = System.ServiceProcess.ServiceAccount.User;
- this.Username = localuser;
- }
+ public override void Install(System.Collections.IDictionary stateSaver)
+ {
+ var localuser = Context.Parameters["localuser"];
+ if (localuser != null)
+ {
+ this.Account = System.ServiceProcess.ServiceAccount.User;
+ this.Username = localuser;
+ }
- base.Install(stateSaver);
- }
+ base.Install(stateSaver);
+ }
}
}