Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
<PrivateAssets>all</PrivateAssets>
<Version>3.9.50</Version>
</PackageReference>
</ItemGroup>
</Project>
14 changes: 13 additions & 1 deletion Ink Canvas/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,19 @@ async void App_Startup(object sender, StartupEventArgs e)
await Task.Delay(100);
RootPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;

LogHelper.NewLog(string.Format("Ink Canvas Starting (Version: {0})", Assembly.GetExecutingAssembly().GetName().Version));
var version = Assembly.GetExecutingAssembly().GetName().Version;
var informationalVersion = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>();
string versionString = version.Major + "." + version.Minor + "." + version.Build + "." + version.Revision;
if (informationalVersion != null)
{
string infoVersion = informationalVersion.InformationalVersion;
int lastDotIndex = infoVersion.LastIndexOf('.');
if (lastDotIndex >= 0 && lastDotIndex < infoVersion.Length - 7)
{
versionString += " (" + infoVersion.Substring(lastDotIndex + 1) + ")";
}
}
LogHelper.NewLog(string.Format("Ink Canvas Starting (Version: {0})", versionString));

// 检查是否为最终应用启动(更新后的应用)
bool isFinalApp = e.Args.Contains("--final-app");
Expand Down
18 changes: 2 additions & 16 deletions Ink Canvas/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,7 @@
using System.Windows;

[assembly: System.Runtime.Versioning.SupportedOSPlatform("windows")]
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("InkCanvasForClass")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("CJK_mkp")]
[assembly: AssemblyProduct("InkCanvasForClass")]
[assembly: AssemblyCopyright("Copyright © CJK_mkp 2025-2026")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// i18n: 默认/回退语言为简体中文,与 Strings.resx 默认文案一致。
Expand All @@ -44,5 +30,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.18.10")]
[assembly: AssemblyFileVersion("1.7.18.10")]
// [assembly: AssemblyVersion("1.7.18.10")]
// [assembly: AssemblyFileVersion("1.7.18.10")]
14 changes: 9 additions & 5 deletions Ink Canvas/InkCanvasForClass.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>2.0.2.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>false</BootstrapperEnabled>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<GenerateAssemblyInfo>True</GenerateAssemblyInfo>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
Expand Down Expand Up @@ -67,12 +65,10 @@
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Title>InkCanvasForClass</Title>
<Version>1.7</Version>
<Authors>CJK_mkp</Authors>
<Product>InkCanvasForClass</Product>
<Copyright>© Copyright CJK_mkp 2025-now</Copyright>
<PackageProjectUrl>https://inkcanvasforclass.github.io</PackageProjectUrl>
<FileVersion>bundled</FileVersion>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
Expand Down Expand Up @@ -667,4 +663,12 @@
</ItemGroup>
<Copy SourceFiles="@(IACoreHelperFiles)" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" Condition="'@(IACoreHelperFiles)' != ''" />
</Target>

<Target Name="SetAssemblyInformationalVersion" DependsOnTargets="GetBuildVersion" AfterTargets="GetBuildVersion">
<PropertyGroup>
<_ShortSha>$(GitCommitIdShort)</_ShortSha>
<_ShortSha7>$(_ShortSha.Substring(0, 7))</_ShortSha7>
<AssemblyInformationalVersion>$(AssemblyVersion).$(_ShortSha7)</AssemblyInformationalVersion>
</PropertyGroup>
</Target>
</Project>
38 changes: 2 additions & 36 deletions Ink Canvas/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,12 @@
using System.Runtime.InteropServices;
using System.Windows;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("InkCanvasForClass")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("CJK_mkp")]
[assembly: AssemblyProduct("InkCanvasForClass")]
[assembly: AssemblyCopyright("Copyright © CJK_mkp 2025-2026")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// i18n: 默认/回退语言为简体中文,与 Strings.resx 默认文案一致。
[assembly: System.Resources.NeutralResourcesLanguage("zh-CN", System.Resources.UltimateResourceFallbackLocation.MainAssembly)]


[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
ResourceDictionaryLocation.None,
ResourceDictionaryLocation.SourceAssembly
)]


// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.18.10")]
[assembly: AssemblyFileVersion("1.7.18.10")]
13 changes: 12 additions & 1 deletion Ink Canvas/Windows/SettingsViews/Pages/AboutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,18 @@ private void LoadSettings()
{
try
{
AppVersionTextBlock.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString();
var version = Assembly.GetExecutingAssembly().GetName().Version;
AppVersionTextBlock.Text = version.Major + "." + version.Minor + "." + version.Build + "." + version.Revision;
var informationalVersion = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>();
if (informationalVersion != null)
{
string infoVersion = informationalVersion.InformationalVersion;
int lastDotIndex = infoVersion.LastIndexOf('.');
if (lastDotIndex >= 0 && lastDotIndex < infoVersion.Length - 7)
{
AppVersionTextBlock.Text += " (" + infoVersion.Substring(lastDotIndex + 1) + ")";
}
}
RefreshDeviceInfo();
}
catch (Exception ex)
Expand Down
14 changes: 12 additions & 2 deletions Ink Canvas/Windows/SplashScreen.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,25 @@ private void SetVersionText()
if (version != null)
{
VersionTextBlock.Text = $"v{version.Major}.{version.Minor}.{version.Build}.{version.Revision}";
var informationalVersion = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>();
if (informationalVersion != null)
{
string infoVersion = informationalVersion.InformationalVersion;
int lastDotIndex = infoVersion.LastIndexOf('.');
if (lastDotIndex >= 0 && lastDotIndex < infoVersion.Length - 7)
{
VersionTextBlock.Text += " (" + infoVersion.Substring(lastDotIndex + 1) + ")";
}
}
}
else
{
VersionTextBlock.Text = "v5.0.4.0";
VersionTextBlock.Text = "v1.7.18.10";
}
}
catch
{
VersionTextBlock.Text = "v5.0.4.0";
VersionTextBlock.Text = "v1.7.18.10";
}
}

Expand Down
6 changes: 6 additions & 0 deletions Ink Canvas/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@
"resolved": "15.0.0",
"contentHash": "/KgYw8uvv0Ut8FPvyEa1XJ/TrLSRgvTv3JgC2IT0/8NwoICzbEJWfmfwsE6Dwi8WH0jVkTEO7zRvGvaKqUOhqQ=="
},
"Nerdbank.GitVersioning": {
"type": "Direct",
"requested": "[3.9.50, )",
"resolved": "3.9.50",
"contentHash": "HtOgGF6jZ+WYbXnCUCYPT8Y2d6mIJo9ozjK/FINTRsXdm4Zgv9GehUMa7EFoGQkqrMcDJNOIDwCmENnvXg4UbA=="
},
"Newtonsoft.Json": {
"type": "Direct",
"requested": "[13.0.4, )",
Expand Down
1 change: 1 addition & 0 deletions InkCanvas.Controls/InkCanvas.Controls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<LangVersion>10</LangVersion>
<NoWarn>CA1416</NoWarn>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions InkCanvas.IACoreHelper/InkCanvas.IACoreHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
Expand Down
2 changes: 0 additions & 2 deletions InkCanvas.IACoreHelper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@
[assembly: AssemblyProduct("InkCanvas.IACoreHelper")]
[assembly: AssemblyCopyright("Copyright © ICC CE")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
1 change: 1 addition & 0 deletions InkCanvas.PluginSdk/InkCanvas.PluginSdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<Nullable>disable</Nullable>
<RootNamespace>Ink_Canvas.Plugins</RootNamespace>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

</Project>
22 changes: 22 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.7.18.10",
"nugetPackageVersion": {
"semVer": 2,
"precision": "revision"
},
"git": {
"shortShaLength": 6,
"getCommitDetails": "always"
},
"buildNumber": {
"sha": true,
"useAbbreviatedSha": true
},
"assemblyVersion": {
"precision": "revision"
},
"npm": {
"precision": "revision"
}
}