Skip to content

Commit

Permalink
Common: Migrate to .NET 9.0 (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
julianxhokaxhiu authored Jan 2, 2025
1 parent 57b5aef commit bd2b3a3
Show file tree
Hide file tree
Showing 28 changed files with 76 additions and 266 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/main-4.2.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ jobs:
BUILDPATH: "${{ github.workspace }}"
run: "${{ github.workspace }}\\.iss\\build.ps1"
shell: pwsh
- name: Publish PR artifacts
if: env._IS_GITHUB_RELEASE == 'false' && success()
uses: actions/[email protected]
with:
name: "${{ env._RELEASE_NAME }}-${{ env._RELEASE_VERSION }}"
path: ".dist/*"
- name: VirusTotal Scan
id: vt-scan
if: env._IS_GITHUB_RELEASE == 'true' && success()
Expand All @@ -90,12 +96,6 @@ jobs:
console.log(ret);
return ret;
- name: Publish PR artifacts
if: env._IS_GITHUB_RELEASE == 'false' && success()
uses: actions/upload-artifact@v4
with:
name: "${{ env._RELEASE_NAME }}-${{ env._RELEASE_VERSION }}"
path: ".dist/*"
- name: Publish Canary release
uses: ncipollo/release-action@v1
if: env._IS_GITHUB_RELEASE == 'true' && env._IS_BUILD_CANARY == 'true' && success()
Expand Down
10 changes: 5 additions & 5 deletions .iss/CodeDependencies.iss
Original file line number Diff line number Diff line change
Expand Up @@ -249,22 +249,22 @@ begin
end;
end;
procedure Dependency_AddDotNet80Desktop;
procedure Dependency_AddDotNet90Desktop;
var
IsProductInstalled: Boolean;
begin
try
IsProductInstalled := Dependency_IsNetCoreInstalled('Microsoft.WindowsDesktop.App 8.0.11')
IsProductInstalled := Dependency_IsNetCoreInstalled('Microsoft.WindowsDesktop.App 9.0.0')
except
IsProductInstalled := False
end;
// https://dotnet.microsoft.com/download/dotnet/8.0
if not IsProductInstalled then begin
Dependency_Add('dotnet80desktop' + Dependency_ArchSuffix + '.exe',
Dependency_Add('dotnet90desktop' + Dependency_ArchSuffix + '.exe',
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart ' + Dependency_SilentParameter('', '/quiet'),
'.NET Desktop Runtime 8.0.11' + Dependency_ArchTitle,
Dependency_String('https://builds.dotnet.microsoft.com/dotnet/WindowsDesktop/8.0.11/windowsdesktop-runtime-8.0.11-win-x86.exe', 'https://builds.dotnet.microsoft.com/dotnet/WindowsDesktop/8.0.11/windowsdesktop-runtime-8.0.11-win-x64.exe'),
'.NET Desktop Runtime 9.0.0' + Dependency_ArchTitle,
Dependency_String('https://builds.dotnet.microsoft.com/dotnet/WindowsDesktop/9.0.0/windowsdesktop-runtime-9.0.0-win-x86.exe', 'https://builds.dotnet.microsoft.com/dotnet/WindowsDesktop/9.0.0/windowsdesktop-runtime-9.0.0-win-x64.exe'),
'', False, False);
end;
end;
Expand Down
6 changes: 3 additions & 3 deletions .iss/installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#endif

#ifndef MyAppTargetFramework
#define MyAppTargetFramework "net8.0-windows7.0"
#define MyAppTargetFramework "net9.0-windows7.0"
#endif

#define public Dependency_Path_NetCoreCheck ""
Expand Down Expand Up @@ -73,11 +73,11 @@ function InitializeSetup: Boolean;
begin
Dependency_ForceX86 := True;
Dependency_AddVC2015To2022;
Dependency_AddDotNet80Desktop;
Dependency_AddDotNet90Desktop;
Dependency_ForceX86 := False;
Dependency_AddVC2015To2022;
Dependency_AddDotNet80Desktop;
Dependency_AddDotNet90Desktop;
Result := True;
end;
2 changes: 1 addition & 1 deletion AppCore/AppCore.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows7.0</TargetFramework>
<TargetFramework>net9.0-windows7.0</TargetFramework>
<OutputType>Library</OutputType>
<RootNamespace>AppCore</RootNamespace>
<ReleaseVersion>1.56</ReleaseVersion>
Expand Down
11 changes: 8 additions & 3 deletions AppCore/FileDownloadTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ private set

public FileDownloadTask(string source, string destination, object userState = null, CookieContainer cookies = null, FileDownloadTaskMode fdtMode = default, int chunkSizeInBytes = 10000 /*Default to 0.01 mb*/)
{
System.Net.ServicePointManager.Expect100Continue = false; // ensure this is set to false
AllowedToRun = true;

_sourceUrl = source;
Expand Down Expand Up @@ -135,9 +134,15 @@ private async Task Start(long range)
if (IsPaused || IsCanceled)
return;

var handler = _cookies != null ? new HttpClientHandler() { CookieContainer = _cookies } : new HttpClientHandler();
var handler = new HttpClientHandler()
{
UseCookies = _cookies != null,
CookieContainer = _cookies != null ? _cookies : new CookieContainer(),
SslProtocols = System.Security.Authentication.SslProtocols.Tls12 | System.Security.Authentication.SslProtocols.Tls13
};
var client = new HttpClient(handler);
client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0");
client.DefaultRequestHeaders.ExpectContinue = false;
client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0");
if (Headers != null) client.DefaultRequestHeaders.Add("Referer", Headers["Referer"]);
var request = new HttpRequestMessage { RequestUri = new Uri(_sourceUrl) };
if (range > 0) request.Headers.Range = new RangeHeaderValue(0, range);
Expand Down
2 changes: 1 addition & 1 deletion AppCore/Install.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ private void ProcessDownload(object state)
int isig = 0;
using (var fs = new FileStream(source, FileMode.Open, FileAccess.Read))
{
fs.Read(sig, 0, 4);
fs.ReadExactly(sig, 0, 4);
isig = BitConverter.ToInt32(sig, 0);
fs.Close();
}
Expand Down
4 changes: 2 additions & 2 deletions AppLauncher/AppLauncher.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)\AppUI\bin\Release\net8.0-windows7.0\</OutDir>
<OutDir>$(SolutionDir)\AppUI\bin\Release\net9.0-windows7.0\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)\AppUI\bin\Debug\net8.0-windows7.0\</OutDir>
<OutDir>$(SolutionDir)\AppUI\bin\Debug\net9.0-windows7.0\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down
82 changes: 0 additions & 82 deletions AppLoader/.vcpkg/ports/nethost/0001-nethost-cmakelists.patch

This file was deleted.

81 changes: 0 additions & 81 deletions AppLoader/.vcpkg/ports/nethost/portfile.cmake

This file was deleted.

4 changes: 0 additions & 4 deletions AppLoader/.vcpkg/ports/nethost/usage

This file was deleted.

18 changes: 0 additions & 18 deletions AppLoader/.vcpkg/ports/nethost/vcpkg.json

This file was deleted.

4 changes: 0 additions & 4 deletions AppLoader/.vcpkg/versions/baseline.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"default": {
"nethost": {
"baseline": "8.0.11",
"port-version": 0
},
"stackwalker": {
"baseline": "1.2.1",
"port-version": 0
Expand Down
8 changes: 0 additions & 8 deletions AppLoader/.vcpkg/versions/n-/nethost.json

This file was deleted.

Loading

0 comments on commit bd2b3a3

Please sign in to comment.