diff options
author | Kenneth Skovhede <kenneth@hexad.dk> | 2016-10-12 23:58:48 +0300 |
---|---|---|
committer | Kenneth Skovhede <kenneth@hexad.dk> | 2016-10-12 23:58:48 +0300 |
commit | ba94d36a80f7a1a195196f8cc19aa8247a0ce336 (patch) | |
tree | 6451491d4adaf633d484b769b766ec7787efbe11 /Duplicati | |
parent | 0f917bd8ff6eb5c5e5916264e3fbf0d6ca57bd3d (diff) |
Added auto-update for WindowsService and Service.experiment/autoupdate_service
Needs some work otherwise the service will auto-update with a new sub-folder instead of autoupdate from the source folder.
Diffstat (limited to 'Duplicati')
-rw-r--r-- | Duplicati/Service/Program.cs | 10 | ||||
-rw-r--r-- | Duplicati/WindowsService/Program.cs | 10 | ||||
-rw-r--r-- | Duplicati/WindowsService/WindowsService.csproj | 6 |
3 files changed, 22 insertions, 4 deletions
diff --git a/Duplicati/Service/Program.cs b/Duplicati/Service/Program.cs index a7fdc7ca6..17a01c82b 100644 --- a/Duplicati/Service/Program.cs +++ b/Duplicati/Service/Program.cs @@ -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();
diff --git a/Duplicati/WindowsService/Program.cs b/Duplicati/WindowsService/Program.cs index ee0fc6ca9..9decd6f4e 100644 --- a/Duplicati/WindowsService/Program.cs +++ b/Duplicati/WindowsService/Program.cs @@ -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();
diff --git a/Duplicati/WindowsService/WindowsService.csproj b/Duplicati/WindowsService/WindowsService.csproj index 8903bf209..0d0b15a46 100644 --- a/Duplicati/WindowsService/WindowsService.csproj +++ b/Duplicati/WindowsService/WindowsService.csproj @@ -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.
|