mirror of
https://github.com/duplicati/duplicati.git
synced 2026-05-06 23:29:31 -04:00
Added auto-update for WindowsService and Service.
Needs some work otherwise the service will auto-update with a new sub-folder instead of autoupdate from the source folder.
This commit is contained in:
@@ -19,9 +19,15 @@ using System;
|
||||
|
||||
namespace Duplicati.Service
|
||||
{
|
||||
class MainClass
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
[STAThread]
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
return Duplicati.Library.AutoUpdater.UpdaterManager.RunFromMostRecent(typeof(Program).GetMethod("RealMain"), args, Duplicati.Library.AutoUpdater.AutoUpdateStrategy.Never);
|
||||
}
|
||||
|
||||
public static void RealMain(string[] args)
|
||||
{
|
||||
using(var runner = new Runner(args))
|
||||
runner.Wait();
|
||||
|
||||
@@ -9,9 +9,15 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Duplicati.WindowsService
|
||||
{
|
||||
class Program
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
[STAThread]
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
return Duplicati.Library.AutoUpdater.UpdaterManager.RunFromMostRecent(typeof(Program).GetMethod("RealMain"), args, Duplicati.Library.AutoUpdater.AutoUpdateStrategy.Never);
|
||||
}
|
||||
|
||||
public static void RealMain(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();
|
||||
|
||||
@@ -73,6 +73,12 @@
|
||||
<None Include="App.config" />
|
||||
<None Include="Duplicati.snk" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Library\AutoUpdater\Duplicati.Library.AutoUpdater.csproj">
|
||||
<Project>{7E119745-1F62-43F0-936C-F312A1912C0B}</Project>
|
||||
<Name>Duplicati.Library.AutoUpdater</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
Reference in New Issue
Block a user