Skip to content

Commit

Permalink
Merge pull request #14571 from iterate-ch/bugfix/GH-14566
Browse files Browse the repository at this point in the history
Use own preferences implementation
  • Loading branch information
dkocher authored Aug 28, 2023
2 parents dbad646 + f612d79 commit 75c00d2
Show file tree
Hide file tree
Showing 50 changed files with 1,197 additions and 893 deletions.
9 changes: 9 additions & 0 deletions Cyberduck.sln
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "i18n-gen", "core\i18n-gen\i18n-gen.csproj", "{ABB0D3AD-BCDA-4F73-88C3-C67B76AAB6FE}"
EndProject
Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "package", "windows\src\main\package\package.wapproj", "{55CDD736-9A8A-4091-AC99-60E2F9C73269}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Windows = Debug|Windows
Expand Down Expand Up @@ -108,6 +110,12 @@ Global
{ABB0D3AD-BCDA-4F73-88C3-C67B76AAB6FE}.Debug|Windows.Build.0 = Debug|Any CPU
{ABB0D3AD-BCDA-4F73-88C3-C67B76AAB6FE}.Release|Windows.ActiveCfg = Release|Any CPU
{ABB0D3AD-BCDA-4F73-88C3-C67B76AAB6FE}.Release|Windows.Build.0 = Release|Any CPU
{55CDD736-9A8A-4091-AC99-60E2F9C73269}.Debug|Windows.ActiveCfg = Debug|x64
{55CDD736-9A8A-4091-AC99-60E2F9C73269}.Debug|Windows.Build.0 = Debug|x64
{55CDD736-9A8A-4091-AC99-60E2F9C73269}.Debug|Windows.Deploy.0 = Debug|x64
{55CDD736-9A8A-4091-AC99-60E2F9C73269}.Release|Windows.ActiveCfg = Release|x64
{55CDD736-9A8A-4091-AC99-60E2F9C73269}.Release|Windows.Build.0 = Release|x64
{55CDD736-9A8A-4091-AC99-60E2F9C73269}.Release|Windows.Deploy.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -129,6 +137,7 @@ Global
{F6975079-F730-4A31-9909-DE536E524764} = {457F1D6D-8AEC-42E2-9211-2A8405C95019}
{D1286C4A-9D6A-4904-B9AD-CB7688483EDB} = {72B4BA09-65D8-4C49-930E-B14104B2AB1B}
{ABB0D3AD-BCDA-4F73-88C3-C67B76AAB6FE} = {72B4BA09-65D8-4C49-930E-B14104B2AB1B}
{55CDD736-9A8A-4091-AC99-60E2F9C73269} = {7D32EE61-B6F0-4978-B500-45172B181283}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {289E6003-15D5-4377-ADA6-2E7093785BCD}
Expand Down
2 changes: 1 addition & 1 deletion bonjour/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@

<Project>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.Props', $(MSBuildThisFileDirectory)../))" />
<Import Project="../Directory.Build.props" />

</Project>
4 changes: 2 additions & 2 deletions bonjour/native/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<Project>

<PropertyGroup>
<ModulePath>$(MSBuildThisFileDirectory)</ModulePath>
<ModulePath Condition="'$(ModulePath)'==''">$(MSBuildThisFileDirectory)</ModulePath>
</PropertyGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.Props', $(MSBuildThisFileDirectory)../))" />
<Import Project="../Directory.Build.props" />

</Project>
4 changes: 2 additions & 2 deletions bonjour/src/main/csharp/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<Project>

<PropertyGroup>
<BasePath>$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)../', 'Directory.Build.props'))/</BasePath>
<_BonjourBasePath>$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)../', 'Directory.Build.props'))/</_BonjourBasePath>
</PropertyGroup>
<Import Project="$(BasePath)native/Directory.Build.props" />
<Import Project="$(_BonjourBasePath)native/Directory.Build.props" />

<PropertyGroup>
<Platforms>x64</Platforms>
Expand Down
4 changes: 2 additions & 2 deletions cli/src/main/csharp/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<Project>

<PropertyGroup>
<BasePath>$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)../', 'Directory.Build.props'))/</BasePath>
<_CliBasePath>$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)../', 'Directory.Build.props'))/</_CliBasePath>
</PropertyGroup>
<Import Project="$(BasePath)windows/Directory.Build.props" />
<Import Project="$(_CliBasePath)windows/Directory.Build.props" />

<PropertyGroup>
<Platforms>x64</Platforms>
Expand Down
66 changes: 66 additions & 0 deletions cli/src/main/csharp/ch/cyberduck/cli/TerminalRuntime.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
//
// Copyright (c) 2010-2017 Yves Langisch. All rights reserved.
// http://cyberduck.io/
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// Bug fixes, suggestions and comments should be sent to:
// feedback@cyberduck.io
//

using Ch.Cyberduck.Core.Preferences;
using System;

namespace Ch.Cyberduck.Cli
{
public record class TerminalRuntime(
string CompanyName,
string DataFolderName,
string Location,
bool Packaged,
string ProductName,
string ResourcesLocation,
Version Version) : IRuntime
{
public string CompanyName { get; } = CompanyName;

public string DataFolderName { get; } = DataFolderName;

public string Location { get; } = Location;

public string ProductName { get; } = ProductName;

public string ResourcesLocation { get; } = ResourcesLocation;

public bool Packaged { get; } = Packaged;

public string Revision { get; } = Version.Revision.ToString();

public Version Version { get; } = Version;

public string VersionString { get; } = Version.ToString(3);

public static TerminalRuntime Create()
{
var runtime = Runtime.CreateDefault();

return new TerminalRuntime(
runtime.CompanyName,
"Cyberduck",
runtime.Location,
runtime.Packaged,
runtime.ProductName,
runtime.ResourcesLocation,
runtime.Version);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

using ch.cyberduck.cli;
using ch.cyberduck.core.cryptomator;
using ch.cyberduck.core.preferences;
using Ch.Cyberduck.Core;
using Ch.Cyberduck.Core.Diagnostics;
using Ch.Cyberduck.Core.Editor;
Expand All @@ -33,7 +32,7 @@ namespace Ch.Cyberduck.Cli
{
internal class WindowsTerminalPreferences : TerminalPreferences
{
public WindowsTerminalPreferences() : base(new AppConfigPreferences(new WindowsTerminalLocales()))
public WindowsTerminalPreferences() : base(new ApplicationPreferences(new WindowsTerminalLocales(), TerminalRuntime.Create()))
{
}

Expand All @@ -43,12 +42,13 @@ public override void setProperty(string property, string v)
save();
}

public override string locale() => "en";

protected override void setDefaults()
{
base.setDefaults();

this.setDefault("application.language", "en");
this.setDefault("application.datafolder.name", "Cyberduck");

Security.addProvider(new SunMSCAPI());
this.setDefault("connection.ssl.keystore.type", "Windows-MY");
Expand Down
66 changes: 3 additions & 63 deletions cli/src/main/wix/Bundle/Cyberduck CLI-WiX.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
<File Source="$(var.CLI.TargetPath).config" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="license" Guid="DF374856-F6F7-4520-A332-803CB0826593">
<File Source="$(var.CLI.TargetDir)/License.txt" KeyPath="yes" Checksum="yes" />
<File Source="$(var.LicenseFile)" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="acknowledgments" Guid="95A3AF7B-D782-47C5-9AEE-398DEE02D222">
<File Source="$(var.CLI.TargetDir)/Acknowledgments.rtf" KeyPath="yes" Checksum="yes" />
<File Source="$(var.CyberduckDir)Acknowledgments.rtf" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="Cyberduck.Cli" Guid="811AEB4A-4751-428E-9116-9F7396C5C2C8">
<File Source="$(var.CLI.TargetDir)/Cyberduck.Cli.dll" KeyPath="yes" Checksum="yes"/>
Expand Down Expand Up @@ -151,69 +151,9 @@
</Component>
</ComponentGroup>

<ComponentGroup Id="profiles" Directory="PROFILES">
<Component Id="azure.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/Azure.cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="b2.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/B2.cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="dav.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/DAV.cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="davs.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/DAVS.cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="dracoon.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/DRACOON (OAuth).cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="dropbox.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/Dropbox.cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="file.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/File.cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="ftp.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/FTP.cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="ftps.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/FTPS.cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="googlecloudstorage.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/Google Cloud Storage.cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="googledrive.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/Google Drive.cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="onedrive.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/Microsoft OneDrive.cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="sharepoint.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/Microsoft SharePoint.cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="rackspace.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/Rackspace US.cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="s3.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/S3 (HTTPS).cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="sftp.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/SFTP.cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="swiftv2.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/Openstack Swift (Keystone 2).cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="swiftv3.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/Openstack Swift (Keystone 3).cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="box.cyberduckprofile">
<File Source="$(var.CLI.TargetDir)/profiles/Box.cyberduckprofile" KeyPath="yes" Checksum="yes" />
</Component>
</ComponentGroup>

<Feature Id="ProductFeature" Title="CLI_WiX" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="profiles" />
<ComponentGroupRef Id="ProfileComponents" />
<ComponentRef Id="setEnviroment" />
</Feature>
</Product>
Expand Down
18 changes: 17 additions & 1 deletion cli/src/main/wix/Bundle/duck.bundle.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,33 @@
<OutputName>duck-$(Version)</OutputName>
<OutputType>Package</OutputType>
<InstallerPlatform>x64</InstallerPlatform>
<DefineConstants>
CyberduckDir=$(CyberduckDir);
ProfilesDir=$(CyberduckDir)profiles\default\;
LicenseFile=$(CyberduckDir)i18n/src/main/resources/en.lproj/License.txt;
$(DefineConstants)
</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<SignOutput Condition=" '$(SignOutput)' == '' ">false</SignOutput>
<DefineConstants>Debug</DefineConstants>
<DefineConstants>Debug;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<SignOutput Condition=" '$(SignOutput)' == '' ">true</SignOutput>
</PropertyGroup>
<ItemGroup>
<Compile Include="Cyberduck CLI-WiX.wxs" />
</ItemGroup>

<ItemGroup>
<HarvestDirectory Include="$(CyberduckDir)profiles\default" SuppressRootDirectory="true" SuppressCom="true" SuppressRegistry="true">
<Link>Profiles</Link>
<DirectoryRefId>PROFILES</DirectoryRefId>
<ComponentGroupName>ProfileComponents</ComponentGroupName>
<PreprocessorVariable>var.ProfilesDir</PreprocessorVariable>
</HarvestDirectory>
</ItemGroup>

<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
Expand Down
4 changes: 2 additions & 2 deletions cli/src/main/wix/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<Project>

<PropertyGroup>
<BasePath>$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)../', 'Directory.Build.props'))/</BasePath>
<_CliBasePath>$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)../', 'Directory.Build.props'))/</_CliBasePath>
</PropertyGroup>
<Import Project="$(BasePath)windows/Directory.Build.props" />
<Import Project="$(_CliBasePath)windows/Directory.Build.props" />

<PropertyGroup>
<OutputPath>$(OutputPath)$(Configuration)</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion cli/windows/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Project>

<PropertyGroup>
<ModulePath>$(MSBuildThisFileDirectory)</ModulePath>
<ModulePath Condition="'$(ModulePath)'==''">$(MSBuildThisFileDirectory)</ModulePath>
</PropertyGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.Props', $(MSBuildThisFileDirectory)../))" />
Expand Down
2 changes: 1 addition & 1 deletion core/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<ModulePath Condition=" '$(ModulePath)' == '' ">$(MSBuildThisFileDirectory)</ModulePath>
</PropertyGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.Props', $(MSBuildThisFileDirectory)../))" />
<Import Project="../Directory.Build.props" />

</Project>
2 changes: 1 addition & 1 deletion core/native/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<ModulePath Condition=" '$(ModulePath)' == '' ">$(MSBuildThisFileDirectory)</ModulePath>
</PropertyGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.Props', $(MSBuildThisFileDirectory)../))" />
<Import Project="../Directory.Build.props" />

</Project>
2 changes: 1 addition & 1 deletion core/native/refresh/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<ModulePath Condition=" '$(ModulePath)' == '' ">$(MSBuildThisFileDirectory)</ModulePath>
</PropertyGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', $(MSBuildThisFileDirectory)../))" />
<Import Project="../Directory.Build.props" />

</Project>
10 changes: 10 additions & 0 deletions core/src/main/csharp/Cyberduck.Core.Native.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Update="ch\cyberduck\properties\SharedSettings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>SharedSettings.settings</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
Expand All @@ -61,5 +66,10 @@
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
<CustomToolNamespace>Ch.Cyberduck.Properties</CustomToolNamespace>
</None>
<None Update="ch\cyberduck\properties\SharedSettings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>SharedSettings.Designer.cs</LastGenOutput>
<CustomToolNamespace>Ch.Cyberduck.Properties</CustomToolNamespace>
</None>
</ItemGroup>
</Project>
5 changes: 3 additions & 2 deletions core/src/main/csharp/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<BasePath>$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)../', 'Directory.Build.props'))/</BasePath>
<_CoreBasePath>$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)../', 'Directory.Build.props'))/</_CoreBasePath>
</PropertyGroup>
<Import Project="$(BasePath)native/Directory.Build.props" />

<Import Project="$(_CoreBasePath)native/Directory.Build.props" />

<PropertyGroup>
<Platforms>x64</Platforms>
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/csharp/NativeMethods.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ CredRead
CredWrite
DefWindowProc
ExtractIconEx
FOLDERID_Downloads
GetCurrentPackageFullName
GetTokenInformation
GetWindowLong
Expand All @@ -25,6 +26,7 @@ IExtractIconW
ILCreateFromPath
IQueryAssociations
IShellItem
KNOWN_FOLDER_FLAG
LoadLibrary
LoadString
MESSAGEBOX_RESULT
Expand All @@ -47,6 +49,7 @@ SHCreateItemFromIDList
Shell_GetCachedImageIndex
ShellExecuteEx
SHGetFileInfo
SHGetKnownFolderPath
SHGFI_FLAGS
SHLoadIndirectString
SHOpenFolderAndSelectItems
Expand Down
Loading

0 comments on commit 75c00d2

Please sign in to comment.