Skip to content

Commit

Permalink
towards arm (#690)
Browse files Browse the repository at this point in the history
- support arm on publish profiles
- arch display on info
  • Loading branch information
Spiritreader committed Feb 5, 2024
1 parent 0469520 commit b636592
Show file tree
Hide file tree
Showing 19 changed files with 185 additions and 84 deletions.
10 changes: 10 additions & 0 deletions AutoDarkModeApp/AutoDarkModeApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Platforms>AnyCPU;ARM64</Platforms>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>FF582FA313E61B77B0FD3885AB6473A39A74DBA9</ManifestCertificateThumbprint>
Expand Down Expand Up @@ -61,11 +62,20 @@
<OutputPath>..\bin\Debug\adm-app</OutputPath>
<NoWarn>1701;1702;CA1416</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<OutputPath>..\bin\Debug\adm-app</OutputPath>
<NoWarn>1701;1702;CA1416</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\bin\Release\adm-app</OutputPath>
<WarningLevel>0</WarningLevel>
<NoWarn>1701;1702;CA1416</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<OutputPath>..\bin\Release\adm-app</OutputPath>
<WarningLevel>0</WarningLevel>
<NoWarn>1701;1702;CA1416</NoWarn>
</PropertyGroup>
<ItemGroup>
<Resource Include="Resources\Kofi_Logo.png" />
<Resource Include="Resources\telegram.png" />
Expand Down
13 changes: 13 additions & 0 deletions AutoDarkModeApp/Pages/PageAbout.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />

</Grid.RowDefinitions>

Expand Down Expand Up @@ -226,6 +227,18 @@
Margin="20,5,0,0"
FontSize="14" />

<!-- Architecture -->
<TextBlock Grid.Column="0"
Grid.Row="6"
Text="Arch"
Margin="0,5,0,0"
FontSize="14" />
<TextBlock Grid.Column="1"
Grid.Row="6"
Name="TextBlockArch"
Margin="20,5,0,0"
FontSize="14" />

</Grid>
</Grid>

Expand Down
8 changes: 8 additions & 0 deletions AutoDarkModeApp/Pages/PageAbout.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
Expand All @@ -27,6 +28,7 @@
using AutoDarkModeApp.Handlers;
using AutoDarkModeLib;
using SourceChord.FluentWPF;

using AdmExtensions = AutoDarkModeLib.Helper;

namespace AutoDarkModeApp.Pages;
Expand Down Expand Up @@ -64,6 +66,7 @@ private void UpdateVersionNumbers()
TextBlockShellVersion.Text = versionInfo.Shell;
TextBlockNetCoreVersion.Text = versionInfo.NetCore;
TextBlockWindowsVersion.Text = versionInfo.WindowsVersion;
TextBlockArch.Text = versionInfo.Arch;
}

private void SystemTheme_ThemeChanged(object sender, EventArgs e)
Expand Down Expand Up @@ -432,6 +435,9 @@ private async void ButtonCopyVersionInfo_Click(object sender, RoutedEventArgs e)
.AppendLine("`")
.Append("- Windows: `")
.Append(versionInfo.WindowsVersion)
.AppendLine("`")
.Append("- Arch: `")
.Append(versionInfo.Arch)
.AppendLine("`");
for (int i = 0; i < 10; i++)
{
Expand Down Expand Up @@ -547,6 +553,7 @@ public VersionInfo()
FileVersionInfo.GetVersionInfo(currentDirectory + @"\AutoDarkModeShell.exe").FileVersion);
NetCore = ValueOrNotFound(() => Environment.Version.ToString());
WindowsVersion = ValueOrNotFound(() => $"{Environment.OSVersion.Version.Build}.{RegistryHandler.GetUbr()}");
Arch = RuntimeInformation.ProcessArchitecture.ToString();

static string ValueOrNotFound(Func<string> value)
{
Expand All @@ -568,6 +575,7 @@ static string ValueOrNotFound(Func<string> value)
public string Shell { get; }
public string NetCore { get; }
public string WindowsVersion { get; }
public string Arch { get; }
}

private void Card_PreviewMouseDown(object sender, MouseButtonEventArgs e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<PublishDir>..\bin\Publish\adm-app</PublishDir>
<PublishDir>..\bin\Publish\x86\adm-app</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
Expand Down
18 changes: 18 additions & 0 deletions AutoDarkModeApp/Properties/PublishProfiles/AppPublishARM64.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<PublishDir>..\bin\Publish\ARM64\adm-app</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<PublishReadyToRun>false</PublishReadyToRun>
<PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>
</Project>
11 changes: 11 additions & 0 deletions AutoDarkModeComms/AutoDarkModeComms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,29 @@
<ApplicationIcon>AutoDarkModeIcon.ico</ApplicationIcon>
<StartupObject></StartupObject>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Platforms>AnyCPU;ARM64</Platforms>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\bin\Debug\adm-app</OutputPath>
<NoWarn>1701;1702;CA1416</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<OutputPath>..\bin\Debug\adm-app</OutputPath>
<NoWarn>1701;1702;CA1416</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\bin\Release\adm-app</OutputPath>
<NoWarn>1701;1702;CA1416</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<OutputPath>..\bin\Release\adm-app</OutputPath>
<NoWarn>1701;1702;CA1416</NoWarn>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\AutoDarkModeSvc\Communication\Command.cs" Link="Command.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>..\bin\Publish\adm-app</PublishDir>
<PublishDir>..\bin\Publish\x86\adm-app</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<SelfContained>true</SelfContained>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
<PublishDir>..\bin\Publish\ARM64\adm-app</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<SelfContained>true</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<PublishReadyToRun>false</PublishReadyToRun>
<PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>
</Project>
10 changes: 10 additions & 0 deletions AutoDarkModeLib/AutoDarkModeLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,27 @@
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Platforms>AnyCPU;ARM64</Platforms>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\bin\Debug\adm-app</OutputPath>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<OutputPath>..\bin\Debug\adm-app</OutputPath>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\bin\Release\adm-app</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<OutputPath>..\bin\Release\adm-app</OutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="YamlDotNet" Version="11.2.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>..\bin\Publish\adm-app</PublishDir>
<PublishDir>..\bin\Publish\x86\adm-app</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<SelfContained>true</SelfContained>
Expand Down
18 changes: 18 additions & 0 deletions AutoDarkModeLib/Properties/PublishProfiles/LibPublishARM64.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
<PublishDir>..\bin\Publish\ARM64\adm-app</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<SelfContained>true</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<PublishReadyToRun>false</PublishReadyToRun>
<PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>
</Project>
9 changes: 9 additions & 0 deletions AutoDarkModeShell/AutoDarkModeShell.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,25 @@
<ApplicationIcon>AutoDarkModeIcon.ico</ApplicationIcon>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>1.3.3</Version>
<Platforms>AnyCPU;ARM64</Platforms>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\bin\Debug\adm-app</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<OutputPath>..\bin\Debug\adm-app</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\bin\Release\adm-app</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<OutputPath>..\bin\Release\adm-app</OutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Sharprompt" Version="3.0.0-preview4" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>..\bin\Publish\adm-app</PublishDir>
<PublishDir>..\bin\Publish\x86\adm-app</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
<PublishDir>..\bin\Publish\ARM64\adm-app</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<SelfContained>true</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<PublishReadyToRun>false</PublishReadyToRun>
<PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>
</Project>
11 changes: 11 additions & 0 deletions AutoDarkModeSvc/AutoDarkModeSvc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,29 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<SupportedOSPlatformVersion>10.0.18362.0</SupportedOSPlatformVersion>
<Platforms>AnyCPU;ARM64</Platforms>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\bin\Release\adm-app</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<OutputPath>..\bin\Release\adm-app</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\bin\Debug\adm-app</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<NoWarn>1701;1702;CA1416</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<OutputPath>..\bin\Debug\adm-app</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<NoWarn>1701;1702;CA1416</NoWarn>
</PropertyGroup>

<ItemGroup>
<None Remove="SwitchComponents\BaseComponent.cs~RFc134192.TMP" />
<None Remove="ThemeManager.cs~RF40d17af8.TMP" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<PublishDir>..\bin\Publish\adm-app</PublishDir>
<PublishDir>..\bin\Publish\x86\adm-app</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
<PublishDir>..\bin\Publish\ARM64\adm-app</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<SelfContained>true</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<PublishReadyToRun>false</PublishReadyToRun>
<PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>
</Project>
Loading

0 comments on commit b636592

Please sign in to comment.