版本号体系落地:AssemblyInfo 固定三段式 1.0.3 为唯一事实源(禁用 1.0.* 自动号);关于软件运行时读程序集版本;setup.iss 带版本号并纳入 git;新增 tools\递增版本号.ps1 一键递增三处同步(已自测往返);技能写入版本号铁律(每次发版必须递增)

This commit is contained in:
dqb-dev
2026-10-02 01:49:05 +08:00
parent c1849f97d5
commit 2f0ee71093
5 changed files with 78 additions and 8 deletions
@@ -22,10 +22,8 @@ using System.Runtime.InteropServices;
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
// ★ 版本号唯一事实源(2026-10-01 起):格式 主.次.修订.0——每次发版必须递增修订号,
// 用 tools\递增版本号.ps1 一键同步(关于软件自动读这里;setup.iss 由脚本同步)。
// 不要用 "1.0.*" 自动号(每次编译都变,无法对应发布的安装包)。
[assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.3.0")]
+5 -1
View File
@@ -1,4 +1,4 @@
// 关于软件:经典关于页模板(页头 图标/名称/版本/简介 + 选项卡 功能介绍|开源致谢 + 底部版权栏)
// 关于软件:经典关于页模板(页头 图标/名称/版本/简介 + 选项卡 功能介绍|开源致谢 + 底部版权栏)
// 富文本用 SelectionColor/Font 逐段设置(■ 小节标题深蓝加粗、协议名按协议配色,纯 WinForms 无新依赖)
using System;
using System.Drawing;
@@ -16,6 +16,10 @@ namespace 成套报价软件
// 页头排版在 Load 里做(AutoScale 完成后):版本号紧随软件名实际宽度、
// 简介对齐软件名左侧,避免高 DPI 下固定坐标互相压字;图标 Zoom 充满框
pic图标.SizeMode = PictureBoxSizeMode.Zoom;
// ★ 版本号从程序集读取(唯一事实源=AssemblyInfo 的 AssemblyVersion,递增后这里自动跟随;
// Designer 里的 v1.0.0 只是设计期占位文本)。显示三段:主.次.修订
lbl版本.Text = "v" + System.Reflection.Assembly.GetExecutingAssembly()
.GetName().Version.ToString(3);
this.Load += (s, e) =>
{
try