Skip to content

Commit

Permalink
Added .NET Core support (2.1 and 3.1)
Browse files Browse the repository at this point in the history
- Now builds for NET Core (2.1 & 3.1) and NET Framework (4.5 & 4.6)
  • Loading branch information
mullak99 committed Aug 30, 2020
1 parent e8e63a1 commit 0f14bbe
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 114 deletions.
112 changes: 38 additions & 74 deletions FileAES-CLI/FileAES-CLI.csproj
Original file line number Diff line number Diff line change
@@ -1,85 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AE1C86EC-831A-4A44-96AE-CC2CAA585B51}</ProjectGuid>
<OutputType>Exe</OutputType>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<PublishSingleFile>false</PublishSingleFile>
<PublishTrimmed>true</PublishTrimmed>
<TargetFrameworks>net45;net46;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<RootNamespace>FileAES_CLI</RootNamespace>
<AssemblyName>FileAES-CLI</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<Version>1.1.0</Version>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<PackageReleaseNotes>- Added progress reporting (--progress)
- Added ability to toggle the overwriting (-o)
- Added ability to toggle the deletion of the original files (-po)
- Added ability to change the FAES CryptoStream buffer with '-buffer '
- Added ability to show all metadata (--metadata)
- Added ability to get raw metadata in decoded UTF8
- Updated help text
- Changed verbose mode to now enable FAES' Verbose Logging mode</PackageReleaseNotes>
<Authors>mullak99</Authors>
<Description>A CLI application for encrypting and decrypting files using FAES.</Description>
<FileVersion>1.1.0.0</FileVersion>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<RepositoryUrl>https://github.com/fileaes/FileAES-CLI</RepositoryUrl>
<Copyright>Copyright © 2019 | mullak99</Copyright>
<ApplicationIcon>Icon.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<Reference Include="Costura, Version=4.1.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Logging.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Update.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<None Include="FodyWeavers.xml" />
<ProjectReference Include="..\..\FAES\FAES\FAES.csproj" />
</ItemGroup>

<ItemGroup>
<Content Include="Icon.ico" />
<Folder Include="Properties\" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\FAES\FAES\FAES.csproj">
<Project>{6489d5bc-b847-499e-9ce9-53f702bb892c}</Project>
<Name>FAES</Name>
</ProjectReference>
<PackageReference Include="Costura.Fody" Version="4.1.0" />
<PackageReference Include="Fody" Version="6.2.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NuGet.CommandLine" Version="5.7.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.6.0.0\build\Fody.targets" Condition="Exists('..\packages\Fody.6.0.0\build\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.6.0.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.0.0\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props'))" />
</Target>
</Project>

</Project>
1 change: 1 addition & 0 deletions FileAES-CLI/FodyWeavers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Costura>
<IncludeAssemblies>
FAES
SharpCompress
</IncludeAssemblies>
</Costura>
</Weavers>
12 changes: 9 additions & 3 deletions FileAES-CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Program

private const bool _isDevBuild = true;
private const bool _isBetaBuild = false;
private const string _devBuildTag = "v1.1.0-DEV191010-1";
private const string _devBuildTag = "BETA_3";

static void Main(string[] args)
{
Expand Down Expand Up @@ -526,7 +526,9 @@ static void Main(string[] args)
}
catch (Exception e)
{
#if NETFRAMEWORK
progressThread.Abort();
#endif
HandleException(e);
}
});
Expand All @@ -536,8 +538,9 @@ static void Main(string[] args)

while (eThread.ThreadState == ThreadState.Running)
{ }

#if NETFRAMEWORK
progressThread.Abort();
#endif
}
else
{
Expand Down Expand Up @@ -576,7 +579,9 @@ static void Main(string[] args)
}
catch (Exception e)
{
#if NETFRAMEWORK
progressThread.Abort();
#endif
HandleException(e);
}
});
Expand All @@ -586,8 +591,9 @@ static void Main(string[] args)

while (dThread.ThreadState == ThreadState.Running)
{ }

#if NETFRAMEWORK
progressThread.Abort();
#endif
}
}
}
Expand Down
36 changes: 0 additions & 36 deletions FileAES-CLI/Properties/AssemblyInfo.cs

This file was deleted.

8 changes: 8 additions & 0 deletions FileAES-CLI/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"FileAES-CLI": {
"commandName": "Project",
"commandLineArgs": "Test.txt -p pass"
}
}
}
8 changes: 7 additions & 1 deletion FileAES-CLI/Update.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,12 @@ public void UpdateSelf(bool doCleanUpdate = false, string version = "latest")
}
catch (UnauthorizedAccessException)
{
#if NETFRAMEWORK
RunAsAdmin();
#else
Logging.Log(String.Format("The program needs to be ran with administrator privilages to update!"), Severity.WARN);
#endif

}
catch (Exception e)
{
Expand Down Expand Up @@ -318,7 +323,7 @@ private string ConvertVersionToNonFormatted(string formattedVersion)
Logging.Log(String.Format("ToNonFormatted: Converted '{0}' to '{1}'.", formattedVersion, nonFormattedVersion), Severity.DEBUG);
return nonFormattedVersion;
}

#if NETFRAMEWORK
internal static bool IsRunAsAdmin()
{
WindowsIdentity id = WindowsIdentity.GetCurrent();
Expand Down Expand Up @@ -347,5 +352,6 @@ private static void RunAsAdmin()
Environment.Exit(0);
}
}
#endif
}
}

0 comments on commit 0f14bbe

Please sign in to comment.