diff options
Diffstat (limited to 'Duplicati/Library/Backend/Tardigrade')
-rw-r--r-- | Duplicati/Library/Backend/Tardigrade/Duplicati.Library.Backend.Tardigrade.csproj | 14 | ||||
-rw-r--r-- | Duplicati/Library/Backend/Tardigrade/TardigradeBackend.cs | 24 | ||||
-rw-r--r-- | Duplicati/Library/Backend/Tardigrade/storj_uplink.dylib | bin | 0 -> 16654056 bytes | |||
-rw-r--r-- | Duplicati/Library/Backend/Tardigrade/storj_uplink.so | bin | 0 -> 17074528 bytes | |||
-rw-r--r-- | Duplicati/Library/Backend/Tardigrade/win-x64/storj_uplink.dll | bin | 0 -> 10642432 bytes | |||
-rw-r--r-- | Duplicati/Library/Backend/Tardigrade/win-x86/storj_uplink.dll | bin | 0 -> 9273344 bytes |
6 files changed, 38 insertions, 0 deletions
diff --git a/Duplicati/Library/Backend/Tardigrade/Duplicati.Library.Backend.Tardigrade.csproj b/Duplicati/Library/Backend/Tardigrade/Duplicati.Library.Backend.Tardigrade.csproj index 158277fc5..dd777e6b0 100644 --- a/Duplicati/Library/Backend/Tardigrade/Duplicati.Library.Backend.Tardigrade.csproj +++ b/Duplicati/Library/Backend/Tardigrade/Duplicati.Library.Backend.Tardigrade.csproj @@ -73,6 +73,20 @@ </ItemGroup> <ItemGroup> <None Include="packages.config" /> + <None Include="storj_uplink.dylib"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="storj_uplink.so"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + </ItemGroup> + <ItemGroup> + <Content Include="win-x64\storj_uplink.dll"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="win-x86\storj_uplink.dll"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="..\..\..\..\packages\uplink.NET.2.3.1\build\net40\uplink.NET.targets" Condition="Exists('..\..\..\..\packages\uplink.NET.2.3.1\build\net40\uplink.NET.targets')" /> diff --git a/Duplicati/Library/Backend/Tardigrade/TardigradeBackend.cs b/Duplicati/Library/Backend/Tardigrade/TardigradeBackend.cs index 071c1f9b1..c74092344 100644 --- a/Duplicati/Library/Backend/Tardigrade/TardigradeBackend.cs +++ b/Duplicati/Library/Backend/Tardigrade/TardigradeBackend.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Linq.Expressions; +using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -44,6 +45,26 @@ namespace Duplicati.Library.Backend.Tardigrade { "Access grant", "Access grant" }, }; + [DllImport("kernel32.dll")] + protected static extern IntPtr LoadLibrary(string filename); + + private static bool _libraryLoaded = false; + private static void InitStorjLibrary() + { + if (_libraryLoaded) + return; + + if(System.Environment.Is64BitProcess) + { + var res = LoadLibrary("win-x64/storj_uplink.dll"); + } + else + { + var res = LoadLibrary("win-x86/storj_uplink.dll"); + } + _libraryLoaded = true; + } + static Tardigrade() { Access.SetTempDirectory(Library.Utility.TempFolder.SystemTempPath); @@ -59,6 +80,9 @@ namespace Duplicati.Library.Backend.Tardigrade // This constructor is needed by the BackendLoader. public Tardigrade(string url, Dictionary<string, string> options) { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + InitStorjLibrary(); //We need to init only on Windows to distinguish between x64 and x86 + var auth_method = options[TARDIGRADE_AUTH_METHOD]; if (auth_method == "Access grant") { diff --git a/Duplicati/Library/Backend/Tardigrade/storj_uplink.dylib b/Duplicati/Library/Backend/Tardigrade/storj_uplink.dylib Binary files differnew file mode 100644 index 000000000..4f0190dea --- /dev/null +++ b/Duplicati/Library/Backend/Tardigrade/storj_uplink.dylib diff --git a/Duplicati/Library/Backend/Tardigrade/storj_uplink.so b/Duplicati/Library/Backend/Tardigrade/storj_uplink.so Binary files differnew file mode 100644 index 000000000..7c307a134 --- /dev/null +++ b/Duplicati/Library/Backend/Tardigrade/storj_uplink.so diff --git a/Duplicati/Library/Backend/Tardigrade/win-x64/storj_uplink.dll b/Duplicati/Library/Backend/Tardigrade/win-x64/storj_uplink.dll Binary files differnew file mode 100644 index 000000000..29863308c --- /dev/null +++ b/Duplicati/Library/Backend/Tardigrade/win-x64/storj_uplink.dll diff --git a/Duplicati/Library/Backend/Tardigrade/win-x86/storj_uplink.dll b/Duplicati/Library/Backend/Tardigrade/win-x86/storj_uplink.dll Binary files differnew file mode 100644 index 000000000..6f1cc9e95 --- /dev/null +++ b/Duplicati/Library/Backend/Tardigrade/win-x86/storj_uplink.dll |