mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-22 09:14:25 +08:00
fix. 试验性的修复了轻量版的Dotnet问题
This commit is contained in:
45
.github/workflows/release.yml
vendored
45
.github/workflows/release.yml
vendored
@@ -109,21 +109,36 @@ jobs:
|
|||||||
$selfContained = "${{ matrix.self_contained }}" -eq "true"
|
$selfContained = "${{ matrix.self_contained }}" -eq "true"
|
||||||
$publishDir = if ($selfContained) { "publish/windows-${{ matrix.arch }}" } else { "publish/windows-${{ matrix.arch }}-lite" }
|
$publishDir = if ($selfContained) { "publish/windows-${{ matrix.arch }}" } else { "publish/windows-${{ matrix.arch }}-lite" }
|
||||||
|
|
||||||
dotnet publish LanMountainDesktop/LanMountainDesktop.csproj `
|
if ($selfContained) {
|
||||||
-c Release `
|
dotnet publish LanMountainDesktop/LanMountainDesktop.csproj `
|
||||||
-o ./$publishDir `
|
-c Release `
|
||||||
--self-contained:$selfContained `
|
-o ./$publishDir `
|
||||||
-r win-${{ matrix.arch }} `
|
--self-contained `
|
||||||
-p:PublishSingleFile=false `
|
-r win-${{ matrix.arch }} `
|
||||||
-p:SelfContained=$selfContained `
|
-p:PublishSingleFile=false `
|
||||||
-p:DebugType=none `
|
-p:DebugType=none `
|
||||||
-p:DebugSymbols=false `
|
-p:DebugSymbols=false `
|
||||||
-p:PublishTrimmed=false `
|
-p:PublishTrimmed=false `
|
||||||
-p:PublishReadyToRun=false `
|
-p:PublishReadyToRun=false `
|
||||||
-p:Version=${{ needs.prepare.outputs.version }} `
|
-p:Version=${{ needs.prepare.outputs.version }} `
|
||||||
-p:AssemblyVersion=${{ needs.prepare.outputs.assembly_version }} `
|
-p:AssemblyVersion=${{ needs.prepare.outputs.assembly_version }} `
|
||||||
-p:FileVersion=${{ needs.prepare.outputs.assembly_version }} `
|
-p:FileVersion=${{ needs.prepare.outputs.assembly_version }} `
|
||||||
-p:InformationalVersion=${{ needs.prepare.outputs.informational_version }}
|
-p:InformationalVersion=${{ needs.prepare.outputs.informational_version }}
|
||||||
|
} else {
|
||||||
|
dotnet publish LanMountainDesktop/LanMountainDesktop.csproj `
|
||||||
|
-c Release `
|
||||||
|
-o ./$publishDir `
|
||||||
|
--self-contained:false `
|
||||||
|
-p:PublishSingleFile=false `
|
||||||
|
-p:DebugType=none `
|
||||||
|
-p:DebugSymbols=false `
|
||||||
|
-p:PublishTrimmed=false `
|
||||||
|
-p:PublishReadyToRun=false `
|
||||||
|
-p:Version=${{ needs.prepare.outputs.version }} `
|
||||||
|
-p:AssemblyVersion=${{ needs.prepare.outputs.assembly_version }} `
|
||||||
|
-p:FileVersion=${{ needs.prepare.outputs.assembly_version }} `
|
||||||
|
-p:InformationalVersion=${{ needs.prepare.outputs.informational_version }}
|
||||||
|
}
|
||||||
|
|
||||||
Write-Host "Published to: $publishDir"
|
Write-Host "Published to: $publishDir"
|
||||||
Write-Host "Self-contained: $selfContained"
|
Write-Host "Self-contained: $selfContained"
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
<RollForward>LatestMajor</RollForward>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<Version>1.0.0</Version>
|
<Version>1.0.0</Version>
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
<ApplicationIcon>Assets\logo_nightly.ico</ApplicationIcon>
|
<ApplicationIcon>Assets\logo_nightly.ico</ApplicationIcon>
|
||||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||||
<SelfContained Condition="'$(RuntimeIdentifier)' != ''">true</SelfContained>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Keep Release defaults compatibility-first for desktop dependencies (WebView/interop/reflection). -->
|
<!-- Keep Release defaults compatibility-first for desktop dependencies (WebView/interop/reflection). -->
|
||||||
|
|||||||
@@ -454,21 +454,73 @@ begin
|
|||||||
RegQueryStringValue(HKCU32, WebView2RuntimeKeyPath, 'pv', VersionValue);
|
RegQueryStringValue(HKCU32, WebView2RuntimeKeyPath, 'pv', VersionValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// Checks whether a .NET 10.x shared framework is installed under the given
|
||||||
|
// base path by enumerating version sub-directories and looking for one that
|
||||||
|
// starts with '10.'.
|
||||||
|
function IsDotNet10RuntimePresent(const BasePath: String): Boolean;
|
||||||
|
var
|
||||||
|
FindRec: TFindRec;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
if not DirExists(BasePath) then
|
||||||
|
begin
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if FindFirst(BasePath + '\*', FindRec) then
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
repeat
|
||||||
|
if (FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY <> 0) and
|
||||||
|
(Length(FindRec.Name) >= 3) and
|
||||||
|
(Copy(FindRec.Name, 1, 3) = '10.') then
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
until not FindNext(FindRec);
|
||||||
|
finally
|
||||||
|
FindClose(FindRec);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Returns True when the .NET 10 Desktop Runtime (or the .NET 10 Core Runtime
|
||||||
|
// which is sufficient for Avalonia apps) is found on the system.
|
||||||
|
// We check both Microsoft.WindowsDesktop.App and Microsoft.NETCore.App because
|
||||||
|
// the runtimeconfig.json may reference either framework depending on the
|
||||||
|
// publish mode and the app only needs the one it actually references.
|
||||||
function IsDotNetDesktopRuntimeInstalled(): Boolean;
|
function IsDotNetDesktopRuntimeInstalled(): Boolean;
|
||||||
var
|
var
|
||||||
RuntimePath: String;
|
BasePath: String;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
|
||||||
RuntimePath := ExpandConstant('{commonpf64}\dotnet\shared\Microsoft.WindowsDesktop.App');
|
// Check 64-bit Program Files
|
||||||
if DirExists(RuntimePath) then
|
BasePath := ExpandConstant('{commonpf64}\dotnet\shared\Microsoft.WindowsDesktop.App');
|
||||||
|
if IsDotNet10RuntimePresent(BasePath) then
|
||||||
begin
|
begin
|
||||||
Result := True;
|
Result := True;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
RuntimePath := ExpandConstant('{commonpf}\dotnet\shared\Microsoft.WindowsDesktop.App');
|
BasePath := ExpandConstant('{commonpf64}\dotnet\shared\Microsoft.NETCore.App');
|
||||||
if DirExists(RuntimePath) then
|
if IsDotNet10RuntimePresent(BasePath) then
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Check 32-bit Program Files
|
||||||
|
BasePath := ExpandConstant('{commonpf}\dotnet\shared\Microsoft.WindowsDesktop.App');
|
||||||
|
if IsDotNet10RuntimePresent(BasePath) then
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
BasePath := ExpandConstant('{commonpf}\dotnet\shared\Microsoft.NETCore.App');
|
||||||
|
if IsDotNet10RuntimePresent(BasePath) then
|
||||||
begin
|
begin
|
||||||
Result := True;
|
Result := True;
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
Reference in New Issue
Block a user