Skip to content

Commit

Permalink
Update .NET Framework and NuGet Packages (#480)
Browse files Browse the repository at this point in the history
Updates the .NET framework to 4.8 to get rid of the requirement to install 4.6.1 in during workflow execution, and also updates the NuGet packages being referenced.

By removing the need for .NET 4.6.1, the time for the workflow to execute has been reduced considerably.
  • Loading branch information
DanTheMan827 authored Nov 8, 2024
1 parent b7e01df commit 52f784e
Show file tree
Hide file tree
Showing 18 changed files with 45 additions and 52 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,6 @@ jobs:
with:
nsis-version: '3.10'

- name: Install .NET Framework 4.6.1
shell: powershell
run: |
# Download the .NET Framework 4.6.1 installer
$url = "https://go.microsoft.com/fwlink/?linkid=2099470"
$outputPath = "$env:TEMP\dotnet461-installer.exe"
Invoke-WebRequest -Uri "$url" -OutFile "$outputPath"
# Install silently
Start-Process -FilePath $outputPath -ArgumentList "/quiet", "/norestart" -Wait
# Clean up the installer
Remove-Item -Path $outputPath
- name: Set up .NET Core SDK 3.0
uses: actions/setup-dotnet@v4
with:
Expand All @@ -70,25 +56,26 @@ jobs:
Set-Content -Path "${{ github.workspace }}\hakchi_gui\ApiKeys\TheGamesDB.txt" -Value $env:GamesDBApiKey -NoNewLine
env:
GamesDBApiKey: ${{ secrets.GAMESDB_API_KEY }}

- name: Build solution
run: |
msbuild "Installer/Installer.vcxproj" /p:SolutionDir="${{ github.workspace }}\" /p:SolutionPath="${{ github.workspace }}\${{ env.solution }}" "/p:Platform=${{ env.buildPlatform }}"
- name: Run Hakchi Version Script
run: |
$exePath = "${{ github.workspace }}\hakchi_gui\bin\Debug\net461\hakchi.exe"
$exePath = "${{ github.workspace }}\hakchi_gui\bin\Debug\net48\hakchi.exe"
$versionPath = "${{ github.workspace }}\displayVersion.txt"
& $exePath --versionFormat "{0}" --versionFile "$versionPath"
Start-Process -FilePath $exePath -ArgumentList @("--versionFormat", "{0}", "--versionFile", $versionPath) -Wait
$version = Get-Content -Path $versionPath | Out-String
Remove-Item -Path $versionPath
Add-Content -Path $ENV:GITHUB_ENV -Value "displayVersion=$version"
Write-Output $version
- name: Upload Artifacts (Portable)
uses: actions/upload-artifact@v4
with:
name: hakchi2-ce-${{ env.displayVersion }}-portable
path: ${{ github.workspace }}\hakchi_gui\bin\Debug\net461\
path: ${{ github.workspace }}\hakchi_gui\bin\Debug\net48\

- name: Upload Artifacts (Installer)
uses: actions/upload-artifact@v4
Expand Down
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "driver/source"]
path = driver/source
url = https://github.com/TeamShinkansen/libwdi.git
[submodule "Libraries/SSH.NET"]
path = Libraries/SSH.NET
url = https://github.com/TeamShinkansen/SSH.NET.git
Expand All @@ -7,7 +10,7 @@
url = https://github.com/TeamShinkansen/ProgressODoom.git
[submodule "Libraries/tiny7z"]
path = Libraries/tiny7z
url = https://github.com/daPhie79/tiny7z.git
url = https://github.com/TeamShinkansen/tiny7z.git
[submodule "Libraries/LibUsbDotNet"]
path = Libraries/LibUsbDotNet
url = https://github.com/TeamShinkansen/LibUsbDotNet.git
Expand Down
12 changes: 6 additions & 6 deletions Installer/Installer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,25 @@
<NMakeBuildCommandLine>msbuild.exe "$(SolutionDir)NSI\nsi-helper\nsi-helper.csproj" /p:Configuration=Release
msbuild.exe "$(SolutionDir)Zipper\Zipper.csproj" /p:Configuration=Release

del /S /Q "$(SolutionDir)hakchi_gui\bin\Debug\net461"
rmdir /S /Q "$(SolutionDir)hakchi_gui\bin\Debug\net461"
del /S /Q "$(SolutionDir)hakchi_gui\bin\Debug\net48"
rmdir /S /Q "$(SolutionDir)hakchi_gui\bin\Debug\net48"

msbuild.exe "$(SolutionPath)" /p:Configuration=Debug /target:hakchi_gui

"$(SolutionDir)NSI\nsi-helper\bin\Release\nsi-helper.exe" "$(SolutionDir)hakchi_gui\bin\Debug\net461" "$(SolutionDir)NSI\debug-uninstall.nsh"
"$(SolutionDir)NSI\nsi-helper\bin\Release\nsi-helper.exe" "$(SolutionDir)hakchi_gui\bin\Debug\net48" "$(SolutionDir)NSI\debug-uninstall.nsh"

makensis.exe "$(SolutionDir)NSI\Installer.nsi"

del "$(SolutionDir)NSI\debug-uninstall.nsh"</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>msbuild.exe "$(SolutionDir)NSI\nsi-helper\nsi-helper.csproj" /p:Configuration=Release
msbuild.exe "$(SolutionDir)Zipper\Zipper.csproj" /p:Configuration=Release

del /S /Q "$(SolutionDir)hakchi_gui\bin\Debug\net461"
rmdir /S /Q "$(SolutionDir)hakchi_gui\bin\Debug\net461"
del /S /Q "$(SolutionDir)hakchi_gui\bin\Debug\net48"
rmdir /S /Q "$(SolutionDir)hakchi_gui\bin\Debug\net48"

msbuild.exe "$(SolutionPath)" /p:Configuration=Debug /target:hakchi_gui

"$(SolutionDir)NSI\nsi-helper\bin\Release\nsi-helper.exe" "$(SolutionDir)hakchi_gui\bin\Debug\net461" "$(SolutionDir)NSI\debug-uninstall.nsh"
"$(SolutionDir)NSI\nsi-helper\bin\Release\nsi-helper.exe" "$(SolutionDir)hakchi_gui\bin\Debug\net48" "$(SolutionDir)NSI\debug-uninstall.nsh"

makensis.exe "$(SolutionDir)NSI\Installer.nsi"

Expand Down
2 changes: 1 addition & 1 deletion Libraries/CueSharp
2 changes: 1 addition & 1 deletion Libraries/ProgressODoom
2 changes: 1 addition & 1 deletion Libraries/SSH.NET
6 changes: 3 additions & 3 deletions NSI/Installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
!include "FileFunc.nsh"

; Display Version
!system '..\hakchi_gui\bin\Debug\net461\hakchi.exe --versionFormat "!define DisplayVersion {0}" --versionFile version.nsh'
!system '..\hakchi_gui\bin\Debug\net48\hakchi.exe --versionFormat "!define DisplayVersion {0}" --versionFile version.nsh'
!include ".\version.nsh"
!system 'del version.nsh'

; Create zip files
!system '..\Zipper\bin\Release\Zipper.exe ..\hakchi_gui\bin\Debug\net461 ..\hakchi_gui\bin\hakchi2-ce-${DisplayVersion}-portable.zip'
!system '..\Zipper\bin\Release\Zipper.exe ..\hakchi_gui\bin\Debug\net48 ..\hakchi_gui\bin\hakchi2-ce-${DisplayVersion}-portable.zip'

; The icon of the installer
Icon "..\hakchi_gui\icon_app.ico"
Expand Down Expand Up @@ -73,7 +73,7 @@ SectionEnd
Section "Hakchi2 CE ${DisplayVersion} (required)" section_main
SectionIn RO
SetOutPath $INSTDIR
File /r "..\hakchi_gui\bin\Debug\net461\*"
File /r "..\hakchi_gui\bin\Debug\net48\*"
AccessControl::GrantOnFile "$INSTDIR\" "(BU)" "GenericRead + GenericWrite"
SectionEnd

Expand Down
6 changes: 3 additions & 3 deletions NSI/nsi-helper/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1"/>
</startup>
</configuration>
</configuration>
3 changes: 2 additions & 1 deletion NSI/nsi-helper/nsi-helper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
<OutputType>Exe</OutputType>
<RootNamespace>nsi_helper</RootNamespace>
<AssemblyName>nsi-helper</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down
2 changes: 1 addition & 1 deletion Scrapers/Scrapers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

</Project>
8 changes: 4 additions & 4 deletions ZIP Files/ZIP Files.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@
<NMakeBuildCommandLine>msbuild.exe "$(SolutionDir)Zipper\Zipper.csproj" /p:Configuration=Release

del /S /Q "$(SolutionDir)hakchi_gui\bin\Debug"
rmdir /S /Q "$(SolutionDir)hakchi_gui\bin\Debug\net461"
rmdir /S /Q "$(SolutionDir)hakchi_gui\bin\Debug\net48"

msbuild.exe "$(SolutionPath)" /p:Configuration=Debug /target:hakchi_gui

"$(SolutionDir)Zipper\bin\Release\Zipper.exe" "$(SolutionDir)hakchi_gui\bin\Debug\net461" "$(SolutionDir)hakchi_gui\bin\hakchi2-ce-debug.zip"</NMakeBuildCommandLine>
"$(SolutionDir)Zipper\bin\Release\Zipper.exe" "$(SolutionDir)hakchi_gui\bin\Debug\net48" "$(SolutionDir)hakchi_gui\bin\hakchi2-ce-debug.zip"</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>msbuild.exe "$(SolutionDir)Zipper\Zipper.csproj" /p:Configuration=Release

del /S /Q "$(SolutionDir)hakchi_gui\bin\Debug"
rmdir /S /Q "$(SolutionDir)hakchi_gui\bin\Debug\net461"
rmdir /S /Q "$(SolutionDir)hakchi_gui\bin\Debug\net48"

msbuild.exe "$(SolutionPath)" /p:Configuration=Debug /target:hakchi_gui

"$(SolutionDir)Zipper\bin\Release\Zipper.exe" "$(SolutionDir)hakchi_gui\bin\Debug\net461" "$(SolutionDir)hakchi_gui\bin\hakchi2-ce-debug.zip"</NMakeReBuildCommandLine>
"$(SolutionDir)Zipper\bin\Release\Zipper.exe" "$(SolutionDir)hakchi_gui\bin\Debug\net48" "$(SolutionDir)hakchi_gui\bin\hakchi2-ce-debug.zip"</NMakeReBuildCommandLine>
</PropertyGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
Expand Down
6 changes: 3 additions & 3 deletions Zipper/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
</configuration>
3 changes: 2 additions & 1 deletion Zipper/Zipper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
<OutputType>Exe</OutputType>
<RootNamespace>Zipper</RootNamespace>
<AssemblyName>Zipper</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down
2 changes: 1 addition & 1 deletion ce-data/ce-data.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<TargetFramework>net48</TargetFramework>
<RootNamespace>ce_data</RootNamespace>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions driver/source
Submodule source added at f6ee18
10 changes: 5 additions & 5 deletions hakchi_gui/hakchi_gui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net461</TargetFramework>
<TargetFramework>net48</TargetFramework>
<AssemblyName>hakchi</AssemblyName>
<RootNamespace>com.clusterrr.hakchi_gui</RootNamespace>
<UseWindowsForms>true</UseWindowsForms>
Expand Down Expand Up @@ -85,17 +85,17 @@ Gert Driesen for SSH.NET.</Description>

<ItemGroup>
<PackageReference Include="ArxOne.Ftp" Version="1.41.4" />
<PackageReference Include="Autoupdater.NET.Official" Version="1.4.11" />
<PackageReference Include="Autoupdater.NET.Official" Version="1.9.2" />
<PackageReference Include="CommonMark.NET" Version="0.15.1" />
<PackageReference Include="Costura.Fody" Version="5.7.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="LibUsbDotNet" Version="2.2.29" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="nQuant" Version="1.0.3" />
<PackageReference Include="SharpCompress" Version="0.32.2" />
<PackageReference Include="Tmds.MDns" Version="0.7.1" />
<PackageReference Include="SharpCompress" Version="0.38.0" />
<PackageReference Include="Tmds.MDns" Version="0.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 52f784e

Please sign in to comment.