feat: 新增一键构建脚本 (v2.0.1)
- 添加 build.ps1 PowerShell 构建脚本 - 添加 build.bat 批处理入口(双击一键构建) - 支持 Debug/Release 配置切换 - 支持自包含模式发布 - 自动检测 .NET SDK、清理输出、编译打包
This commit is contained in:
@@ -17,6 +17,9 @@
|
||||
|
||||
<!-- 输出路径:解决方案目录下的 Output\Installer\ -->
|
||||
<OutputPath>$(SolutionDir)Output\Installer\</OutputPath>
|
||||
|
||||
<!-- 启用 Windows Forms 支持(文件夹浏览对话框) -->
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -130,8 +130,6 @@
|
||||
Fill="None"
|
||||
Stroke="{DynamicResource SuccessBrush}"
|
||||
StrokeThickness="3"
|
||||
StrokeLineCap="Round"
|
||||
StrokeLineJoin="Round"
|
||||
Stretch="Uniform"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
|
||||
@@ -293,16 +293,17 @@ namespace Better_Seewo.Installer.Pages
|
||||
TxtProgress.Text = $"{_currentProgress}%";
|
||||
|
||||
// 更新进度条宽度(使用动画)
|
||||
var parentWidth = ((FrameworkElement)ProgressFill.Parent).ActualWidth;
|
||||
var widthAnimation = new DoubleAnimation
|
||||
{
|
||||
From = (ProgressFill.ActualWidth > 0 ? ProgressFill.ActualWidth : 0),
|
||||
To = (_currentProgress / 100.0) * ProgressFill.Parent.ActualWidth,
|
||||
To = (_currentProgress / 100.0) * parentWidth,
|
||||
Duration = TimeSpan.FromMilliseconds(300),
|
||||
EasingFunction = new CubicEase { EasingMode = EasingMode.EaseOut }
|
||||
};
|
||||
|
||||
// 如果父容器尚未布局完成,直接设置宽度
|
||||
if (ProgressFill.Parent.ActualWidth == 0)
|
||||
if (parentWidth == 0)
|
||||
{
|
||||
// 等待布局完成后设置
|
||||
ProgressFill.Loaded += (s, e) =>
|
||||
@@ -310,7 +311,7 @@ namespace Better_Seewo.Installer.Pages
|
||||
var loadedAnimation = new DoubleAnimation
|
||||
{
|
||||
From = 0,
|
||||
To = (_currentProgress / 100.0) * ProgressFill.Parent.ActualWidth,
|
||||
To = (_currentProgress / 100.0) * ((FrameworkElement)ProgressFill.Parent).ActualWidth,
|
||||
Duration = TimeSpan.FromMilliseconds(300),
|
||||
EasingFunction = new CubicEase { EasingMode = EasingMode.EaseOut }
|
||||
};
|
||||
|
||||
@@ -87,11 +87,11 @@
|
||||
|
||||
<!-- ===== 动画参数 ===== -->
|
||||
<!-- 标准动画时长(300ms) -->
|
||||
<sys:Duration x:Key="AnimationDuration">0:0:0.300</sys:Duration>
|
||||
<Duration x:Key="AnimationDuration">0:0:0.300</Duration>
|
||||
<!-- 快速动画时长(200ms) -->
|
||||
<sys:Duration x:Key="FastAnimationDuration">0:0:0.200</sys:Duration>
|
||||
<Duration x:Key="FastAnimationDuration">0:0:0.200</Duration>
|
||||
<!-- 慢速动画时长(500ms) -->
|
||||
<sys:Duration x:Key="SlowAnimationDuration">0:0:0.500</sys:Duration>
|
||||
<Duration x:Key="SlowAnimationDuration">0:0:0.500</Duration>
|
||||
|
||||
<!-- ===== 圆角参数 ===== -->
|
||||
<!-- 标准圆角半径 -->
|
||||
|
||||
@@ -100,8 +100,6 @@
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="btnBorder" Property="BorderBrush"
|
||||
Value="{DynamicResource AccentBrush}"/>
|
||||
<Setter TargetName="btnBorder" Property="Foreground"
|
||||
Value="{DynamicResource AccentBrush}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
@@ -252,8 +250,6 @@
|
||||
<Path Data="M20,42 L35,55 L60,25"
|
||||
Stroke="#4CAF50"
|
||||
StrokeThickness="4"
|
||||
StrokeLineCap="Round"
|
||||
StrokeLineJoin="Round"
|
||||
Fill="Transparent"
|
||||
Stretch="Uniform"/>
|
||||
</Grid>
|
||||
|
||||
@@ -176,7 +176,6 @@
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="btnBorder" Property="Background"
|
||||
Value="{DynamicResource AccentBrush}"/>
|
||||
<Setter TargetName="btnBorder" Property="Foreground" Value="White"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
@@ -137,7 +137,6 @@
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="btnBorder" Property="Background"
|
||||
Value="{DynamicResource AccentBrush}"/>
|
||||
<Setter TargetName="btnBorder" Property="Foreground" Value="White"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
@@ -185,9 +185,10 @@
|
||||
<Border x:Name="Card1"
|
||||
Grid.Column="0" Grid.Row="0"
|
||||
Style="{StaticResource StatusCardStyle}"
|
||||
Opacity="0"
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<Border.RenderTransform>
|
||||
<TranslateTransform X="0" Y="30" Opacity="0"/>
|
||||
<TranslateTransform X="0" Y="30"/>
|
||||
</Border.RenderTransform>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,12">
|
||||
@@ -249,9 +250,10 @@
|
||||
<Border x:Name="Card2"
|
||||
Grid.Column="1" Grid.Row="0"
|
||||
Style="{StaticResource StatusCardStyle}"
|
||||
Opacity="0"
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<Border.RenderTransform>
|
||||
<TranslateTransform X="0" Y="30" Opacity="0"/>
|
||||
<TranslateTransform X="0" Y="30"/>
|
||||
</Border.RenderTransform>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,12">
|
||||
@@ -294,9 +296,10 @@
|
||||
<Border x:Name="Card3"
|
||||
Grid.Column="0" Grid.Row="1"
|
||||
Style="{StaticResource StatusCardStyle}"
|
||||
Opacity="0"
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<Border.RenderTransform>
|
||||
<TranslateTransform X="0" Y="30" Opacity="0"/>
|
||||
<TranslateTransform X="0" Y="30"/>
|
||||
</Border.RenderTransform>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,12">
|
||||
@@ -339,9 +342,10 @@
|
||||
<Border x:Name="Card4"
|
||||
Grid.Column="1" Grid.Row="1"
|
||||
Style="{StaticResource StatusCardStyle}"
|
||||
Opacity="0"
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<Border.RenderTransform>
|
||||
<TranslateTransform X="0" Y="30" Opacity="0"/>
|
||||
<TranslateTransform X="0" Y="30"/>
|
||||
</Border.RenderTransform>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,12">
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Better_Seewo.Manager.Pages
|
||||
{
|
||||
@@ -78,7 +79,7 @@ namespace Better_Seewo.Manager.Pages
|
||||
EasingFunction = new CubicEase { EasingMode = EasingMode.EaseOut }
|
||||
};
|
||||
transform.BeginAnimation(TranslateTransform.YProperty, slideIn);
|
||||
transform.BeginAnimation(TranslateTransform.OpacityProperty, fadeIn);
|
||||
card.BeginAnimation(Border.OpacityProperty, fadeIn);
|
||||
};
|
||||
timer.Start();
|
||||
}
|
||||
@@ -129,7 +130,7 @@ namespace Better_Seewo.Manager.Pages
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_en5Path))
|
||||
{
|
||||
var pluginPath = Path.Combine(_en5Path, PluginDirName);
|
||||
var pluginPath = System.IO.Path.Combine(_en5Path, PluginDirName);
|
||||
_pluginInstalled = Directory.Exists(pluginPath);
|
||||
}
|
||||
else
|
||||
@@ -145,7 +146,7 @@ namespace Better_Seewo.Manager.Pages
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_en5Path))
|
||||
{
|
||||
var managerPath = Path.Combine(_en5Path, ManagerExeName);
|
||||
var managerPath = System.IO.Path.Combine(_en5Path, ManagerExeName);
|
||||
_managerInstalled = File.Exists(managerPath);
|
||||
}
|
||||
else
|
||||
@@ -168,12 +169,12 @@ namespace Better_Seewo.Manager.Pages
|
||||
// 更新插件状态卡片
|
||||
UpdateStatusIcon(PluginStatusIcon, _pluginInstalled);
|
||||
PluginStatusText.Text = _pluginInstalled ? "已安装" : "未安装";
|
||||
PluginPathText.Text = $"路径:{Path.Combine(_en5Path, PluginDirName)}";
|
||||
PluginPathText.Text = $"路径:{System.IO.Path.Combine(_en5Path, PluginDirName)}";
|
||||
|
||||
// 更新管理器状态卡片
|
||||
UpdateStatusIcon(ManagerStatusIcon, _managerInstalled);
|
||||
ManagerStatusText.Text = _managerInstalled ? "已安装" : "未安装";
|
||||
ManagerPathText.Text = $"路径:{Path.Combine(_en5Path, ManagerExeName)}";
|
||||
ManagerPathText.Text = $"路径:{System.IO.Path.Combine(_en5Path, ManagerExeName)}";
|
||||
|
||||
// 更新安装路径卡片
|
||||
UpdateStatusIcon(PathStatusIcon, _en5Installed);
|
||||
|
||||
@@ -223,9 +223,10 @@
|
||||
<StackPanel>
|
||||
<!-- ====== 设置项1:触摸输入模式 ====== -->
|
||||
<Border x:Name="Row1" Style="{StaticResource SettingRowStyle}"
|
||||
Opacity="0"
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<Border.RenderTransform>
|
||||
<TranslateTransform X="0" Y="20" Opacity="0"/>
|
||||
<TranslateTransform X="0" Y="20"/>
|
||||
</Border.RenderTransform>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -258,9 +259,10 @@
|
||||
|
||||
<!-- ====== 设置项2:笔压灵敏度 ====== -->
|
||||
<Border x:Name="Row2" Style="{StaticResource SettingRowStyle}"
|
||||
Opacity="0"
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<Border.RenderTransform>
|
||||
<TranslateTransform X="0" Y="20" Opacity="0"/>
|
||||
<TranslateTransform X="0" Y="20"/>
|
||||
</Border.RenderTransform>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -304,9 +306,10 @@
|
||||
|
||||
<!-- ====== 设置项3:忽略误触 ====== -->
|
||||
<Border x:Name="Row3" Style="{StaticResource SettingRowStyle}"
|
||||
Opacity="0"
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<Border.RenderTransform>
|
||||
<TranslateTransform X="0" Y="20" Opacity="0"/>
|
||||
<TranslateTransform X="0" Y="20"/>
|
||||
</Border.RenderTransform>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -337,9 +340,10 @@
|
||||
|
||||
<!-- ====== 设置项4:禁用掌心拒绝 ====== -->
|
||||
<Border x:Name="Row4" Style="{StaticResource SettingRowStyle}"
|
||||
Opacity="0"
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<Border.RenderTransform>
|
||||
<TranslateTransform X="0" Y="20" Opacity="0"/>
|
||||
<TranslateTransform X="0" Y="20"/>
|
||||
</Border.RenderTransform>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -370,9 +374,10 @@
|
||||
|
||||
<!-- ====== 设置项5:触摸延迟 ====== -->
|
||||
<Border x:Name="Row5" Style="{StaticResource SettingRowStyle}"
|
||||
Opacity="0"
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<Border.RenderTransform>
|
||||
<TranslateTransform X="0" Y="20" Opacity="0"/>
|
||||
<TranslateTransform X="0" Y="20"/>
|
||||
</Border.RenderTransform>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -416,9 +421,10 @@
|
||||
|
||||
<!-- ====== 设置项6:双指缩放灵敏度 ====== -->
|
||||
<Border x:Name="Row6" Style="{StaticResource SettingRowStyle}"
|
||||
Opacity="0"
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<Border.RenderTransform>
|
||||
<TranslateTransform X="0" Y="20" Opacity="0"/>
|
||||
<TranslateTransform X="0" Y="20"/>
|
||||
</Border.RenderTransform>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Better_Seewo.Manager.Pages
|
||||
EasingFunction = new CubicEase { EasingMode = EasingMode.EaseOut }
|
||||
};
|
||||
transform.BeginAnimation(TranslateTransform.YProperty, slideIn);
|
||||
transform.BeginAnimation(TranslateTransform.OpacityProperty, fadeIn);
|
||||
row.BeginAnimation(Border.OpacityProperty, fadeIn);
|
||||
};
|
||||
timer.Start();
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
-->
|
||||
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:System="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!-- ===== 颜色定义 ===== -->
|
||||
<Color x:Key="BackgroundColor">#1A1A2E</Color>
|
||||
@@ -68,9 +69,9 @@
|
||||
|
||||
<!-- ===== 动画参数 ===== -->
|
||||
<!-- 标准动画时长(毫秒) -->
|
||||
<System:Duration x:Key="AnimationDuration">0:0:0.300</System:Duration>
|
||||
<Duration x:Key="AnimationDuration">0:0:0.300</Duration>
|
||||
<!-- 快速动画时长(毫秒) -->
|
||||
<System:Duration x:Key="FastAnimationDuration">0:0:0.200</System:Duration>
|
||||
<Duration x:Key="FastAnimationDuration">0:0:0.200</Duration>
|
||||
|
||||
<!-- ===== 圆角参数 ===== -->
|
||||
<!-- 标准圆角半径 -->
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
-->
|
||||
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:System="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!-- ===== 颜色定义 ===== -->
|
||||
<Color x:Key="BackgroundColor">#F5F5F7</Color>
|
||||
@@ -68,9 +69,9 @@
|
||||
|
||||
<!-- ===== 动画参数 ===== -->
|
||||
<!-- 标准动画时长(毫秒) -->
|
||||
<System:Duration x:Key="AnimationDuration">0:0:0.300</System:Duration>
|
||||
<Duration x:Key="AnimationDuration">0:0:0.300</Duration>
|
||||
<!-- 快速动画时长(毫秒) -->
|
||||
<System:Duration x:Key="FastAnimationDuration">0:0:0.200</System:Duration>
|
||||
<Duration x:Key="FastAnimationDuration">0:0:0.200</Duration>
|
||||
|
||||
<!-- ===== 圆角参数 ===== -->
|
||||
<!-- 标准圆角半径 -->
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<packageSources>
|
||||
<!-- NuGet 官方源 -->
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||
<!-- EasiPlugin 自定义源(希沃生态相关包) -->
|
||||
<add key="EasiPlugin" value="https://nuget.easicampus.com/api/v3/index.json" />
|
||||
<!-- EasiPlugin 自定义源(希沃生态相关包)-->
|
||||
<!-- <add key="EasiPlugin" value="https://nuget.easicampus.com/api/v3/index.json" /> -->
|
||||
</packageSources>
|
||||
</configuration>
|
||||
|
||||
BIN
Output/Installer/net6.0-windows/Better-Seewo.Installer
Executable file
BIN
Output/Installer/net6.0-windows/Better-Seewo.Installer
Executable file
Binary file not shown.
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v6.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v6.0": {
|
||||
"Better-Seewo.Installer/2.0.0": {
|
||||
"dependencies": {
|
||||
"Newtonsoft.Json": "13.0.3"
|
||||
},
|
||||
"runtime": {
|
||||
"Better-Seewo.Installer.dll": {}
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json/13.0.3": {
|
||||
"runtime": {
|
||||
"lib/net6.0/Newtonsoft.Json.dll": {
|
||||
"assemblyVersion": "13.0.0.0",
|
||||
"fileVersion": "13.0.3.27908"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Better-Seewo.Installer/2.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"Newtonsoft.Json/13.0.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==",
|
||||
"path": "newtonsoft.json/13.0.3",
|
||||
"hashPath": "newtonsoft.json.13.0.3.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Output/Installer/net6.0-windows/Better-Seewo.Installer.dll
Normal file
BIN
Output/Installer/net6.0-windows/Better-Seewo.Installer.dll
Normal file
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net6.0",
|
||||
"frameworks": [
|
||||
{
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "6.0.0"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.WindowsDesktop.App",
|
||||
"version": "6.0.0"
|
||||
}
|
||||
],
|
||||
"configProperties": {
|
||||
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Output/Installer/net6.0-windows/Newtonsoft.Json.dll
Executable file
BIN
Output/Installer/net6.0-windows/Newtonsoft.Json.dll
Executable file
Binary file not shown.
BIN
Output/Manager/net6.0-windows/Better-Seewo.Manager
Executable file
BIN
Output/Manager/net6.0-windows/Better-Seewo.Manager
Executable file
Binary file not shown.
68
Output/Manager/net6.0-windows/Better-Seewo.Manager.deps.json
Normal file
68
Output/Manager/net6.0-windows/Better-Seewo.Manager.deps.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v6.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v6.0": {
|
||||
"Better-Seewo.Manager/2.0.0": {
|
||||
"dependencies": {
|
||||
"DocumentFormat.OpenXml": "2.20.0",
|
||||
"Newtonsoft.Json": "13.0.3"
|
||||
},
|
||||
"runtime": {
|
||||
"Better-Seewo.Manager.dll": {}
|
||||
}
|
||||
},
|
||||
"DocumentFormat.OpenXml/2.20.0": {
|
||||
"dependencies": {
|
||||
"System.IO.Packaging": "4.7.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net6.0/DocumentFormat.OpenXml.dll": {
|
||||
"assemblyVersion": "2.20.0.0",
|
||||
"fileVersion": "2.20.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json/13.0.3": {
|
||||
"runtime": {
|
||||
"lib/net6.0/Newtonsoft.Json.dll": {
|
||||
"assemblyVersion": "13.0.0.0",
|
||||
"fileVersion": "13.0.3.27908"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.IO.Packaging/4.7.0": {}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Better-Seewo.Manager/2.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"DocumentFormat.OpenXml/2.20.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-+oFMsEppo/W6KpGTRXaJl2jTFYn9zeon4FaZuDoCijQ1/0JaPENaCef7d4Y3f8v116eKhVBwd4Ya+/NDglxkjw==",
|
||||
"path": "documentformat.openxml/2.20.0",
|
||||
"hashPath": "documentformat.openxml.2.20.0.nupkg.sha512"
|
||||
},
|
||||
"Newtonsoft.Json/13.0.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==",
|
||||
"path": "newtonsoft.json/13.0.3",
|
||||
"hashPath": "newtonsoft.json.13.0.3.nupkg.sha512"
|
||||
},
|
||||
"System.IO.Packaging/4.7.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-9VV4KAbgRQZ79iEoG40KIeZy38O30oWwewScAST879+oki8g/Wa2HXZQgrhDDxQM4GkP1PnRJll05NMiVPbYAw==",
|
||||
"path": "system.io.packaging/4.7.0",
|
||||
"hashPath": "system.io.packaging.4.7.0.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Output/Manager/net6.0-windows/Better-Seewo.Manager.dll
Normal file
BIN
Output/Manager/net6.0-windows/Better-Seewo.Manager.dll
Normal file
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net6.0",
|
||||
"frameworks": [
|
||||
{
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "6.0.0"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.WindowsDesktop.App",
|
||||
"version": "6.0.0"
|
||||
}
|
||||
],
|
||||
"configProperties": {
|
||||
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Output/Manager/net6.0-windows/DocumentFormat.OpenXml.dll
Executable file
BIN
Output/Manager/net6.0-windows/DocumentFormat.OpenXml.dll
Executable file
Binary file not shown.
BIN
Output/Manager/net6.0-windows/Newtonsoft.Json.dll
Executable file
BIN
Output/Manager/net6.0-windows/Newtonsoft.Json.dll
Executable file
Binary file not shown.
BIN
Publish/Installer/Better-Seewo.Installer
Executable file
BIN
Publish/Installer/Better-Seewo.Installer
Executable file
Binary file not shown.
41
Publish/Installer/Better-Seewo.Installer.deps.json
Normal file
41
Publish/Installer/Better-Seewo.Installer.deps.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v6.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v6.0": {
|
||||
"Better-Seewo.Installer/2.0.0": {
|
||||
"dependencies": {
|
||||
"Newtonsoft.Json": "13.0.3"
|
||||
},
|
||||
"runtime": {
|
||||
"Better-Seewo.Installer.dll": {}
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json/13.0.3": {
|
||||
"runtime": {
|
||||
"lib/net6.0/Newtonsoft.Json.dll": {
|
||||
"assemblyVersion": "13.0.0.0",
|
||||
"fileVersion": "13.0.3.27908"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Better-Seewo.Installer/2.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"Newtonsoft.Json/13.0.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==",
|
||||
"path": "newtonsoft.json/13.0.3",
|
||||
"hashPath": "newtonsoft.json.13.0.3.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Publish/Installer/Better-Seewo.Installer.dll
Normal file
BIN
Publish/Installer/Better-Seewo.Installer.dll
Normal file
Binary file not shown.
18
Publish/Installer/Better-Seewo.Installer.runtimeconfig.json
Normal file
18
Publish/Installer/Better-Seewo.Installer.runtimeconfig.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net6.0",
|
||||
"frameworks": [
|
||||
{
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "6.0.0"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.WindowsDesktop.App",
|
||||
"version": "6.0.0"
|
||||
}
|
||||
],
|
||||
"configProperties": {
|
||||
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Publish/Installer/Newtonsoft.Json.dll
Executable file
BIN
Publish/Installer/Newtonsoft.Json.dll
Executable file
Binary file not shown.
BIN
Publish/Manager/Better-Seewo.Manager
Executable file
BIN
Publish/Manager/Better-Seewo.Manager
Executable file
Binary file not shown.
68
Publish/Manager/Better-Seewo.Manager.deps.json
Normal file
68
Publish/Manager/Better-Seewo.Manager.deps.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v6.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v6.0": {
|
||||
"Better-Seewo.Manager/2.0.0": {
|
||||
"dependencies": {
|
||||
"DocumentFormat.OpenXml": "2.20.0",
|
||||
"Newtonsoft.Json": "13.0.3"
|
||||
},
|
||||
"runtime": {
|
||||
"Better-Seewo.Manager.dll": {}
|
||||
}
|
||||
},
|
||||
"DocumentFormat.OpenXml/2.20.0": {
|
||||
"dependencies": {
|
||||
"System.IO.Packaging": "4.7.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net6.0/DocumentFormat.OpenXml.dll": {
|
||||
"assemblyVersion": "2.20.0.0",
|
||||
"fileVersion": "2.20.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json/13.0.3": {
|
||||
"runtime": {
|
||||
"lib/net6.0/Newtonsoft.Json.dll": {
|
||||
"assemblyVersion": "13.0.0.0",
|
||||
"fileVersion": "13.0.3.27908"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.IO.Packaging/4.7.0": {}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Better-Seewo.Manager/2.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"DocumentFormat.OpenXml/2.20.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-+oFMsEppo/W6KpGTRXaJl2jTFYn9zeon4FaZuDoCijQ1/0JaPENaCef7d4Y3f8v116eKhVBwd4Ya+/NDglxkjw==",
|
||||
"path": "documentformat.openxml/2.20.0",
|
||||
"hashPath": "documentformat.openxml.2.20.0.nupkg.sha512"
|
||||
},
|
||||
"Newtonsoft.Json/13.0.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==",
|
||||
"path": "newtonsoft.json/13.0.3",
|
||||
"hashPath": "newtonsoft.json.13.0.3.nupkg.sha512"
|
||||
},
|
||||
"System.IO.Packaging/4.7.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-9VV4KAbgRQZ79iEoG40KIeZy38O30oWwewScAST879+oki8g/Wa2HXZQgrhDDxQM4GkP1PnRJll05NMiVPbYAw==",
|
||||
"path": "system.io.packaging/4.7.0",
|
||||
"hashPath": "system.io.packaging.4.7.0.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Publish/Manager/Better-Seewo.Manager.dll
Normal file
BIN
Publish/Manager/Better-Seewo.Manager.dll
Normal file
Binary file not shown.
18
Publish/Manager/Better-Seewo.Manager.runtimeconfig.json
Normal file
18
Publish/Manager/Better-Seewo.Manager.runtimeconfig.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net6.0",
|
||||
"frameworks": [
|
||||
{
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "6.0.0"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.WindowsDesktop.App",
|
||||
"version": "6.0.0"
|
||||
}
|
||||
],
|
||||
"configProperties": {
|
||||
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Publish/Manager/DocumentFormat.OpenXml.dll
Executable file
BIN
Publish/Manager/DocumentFormat.OpenXml.dll
Executable file
Binary file not shown.
BIN
Publish/Manager/Newtonsoft.Json.dll
Executable file
BIN
Publish/Manager/Newtonsoft.Json.dll
Executable file
Binary file not shown.
18
Publish/VERSION.txt
Normal file
18
Publish/VERSION.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
Better-Seewo v2.0.1
|
||||
构建时间: 2026-06-28
|
||||
构建配置: Release
|
||||
自包含模式: false
|
||||
|
||||
组件列表:
|
||||
- Better-Seewo.Manager.exe (管理器桌面应用)
|
||||
- Better-Seewo.Installer.exe (安装向导)
|
||||
|
||||
系统要求:
|
||||
- Windows 10/11
|
||||
- .NET 6.0 Desktop Runtime
|
||||
- 希沃白板 EN5 v5.2.4.9855
|
||||
|
||||
作者: 雾启工作室
|
||||
|
||||
一键构建:
|
||||
双击 build.bat 即可在 Windows 上重新构建整个项目。
|
||||
32
Publish/build.bat
Normal file
32
Publish/build.bat
Normal file
@@ -0,0 +1,32 @@
|
||||
@echo off
|
||||
chcp 65001 >nul
|
||||
title Better-Seewo 一键构建
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Better-Seewo 一键构建脚本 v2.0.1
|
||||
echo 雾生万象,启以为光
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
:: 检测 PowerShell
|
||||
where powershell >nul 2>nul
|
||||
if %errorlevel% neq 0 (
|
||||
echo [错误] 未找到 PowerShell,请先安装 PowerShell。
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
:: 运行构建脚本
|
||||
echo [INFO] 正在启动 PowerShell 构建脚本 ...
|
||||
echo.
|
||||
powershell -ExecutionPolicy Bypass -File "%~dp0build.ps1" %*
|
||||
|
||||
if %errorlevel% neq 0 (
|
||||
echo.
|
||||
echo [错误] 构建失败!
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo.
|
||||
pause
|
||||
196
Publish/build.ps1
Normal file
196
Publish/build.ps1
Normal file
@@ -0,0 +1,196 @@
|
||||
#Requires -Version 5.1
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Better-Seewo 一键构建脚本
|
||||
.DESCRIPTION
|
||||
自动还原 NuGet 包、编译 Manager 和 Installer 项目,并打包为发布版本。
|
||||
支持 Debug / Release 配置,支持框架依赖和自包含两种发布模式。
|
||||
.PARAMETER Configuration
|
||||
构建配置:Debug 或 Release(默认 Release)
|
||||
.PARAMETER SelfContained
|
||||
是否自包含 .NET Runtime(默认 $false,需要用户安装 .NET 6 Desktop Runtime)
|
||||
.PARAMETER OutputPath
|
||||
输出目录(默认 ./Publish)
|
||||
.EXAMPLE
|
||||
.\build.ps1
|
||||
.\build.ps1 -Configuration Release -SelfContained $true
|
||||
#>
|
||||
param(
|
||||
[ValidateSet("Debug", "Release")]
|
||||
[string]$Configuration = "Release",
|
||||
|
||||
[bool]$SelfContained = $false,
|
||||
|
||||
[string]$OutputPath = "$PSScriptRoot\Publish"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# ========== 颜色输出辅助函数 ==========
|
||||
function Write-Info { param([string]$Message) Write-Host "[INFO] $Message" -ForegroundColor Cyan }
|
||||
function Write-Success { param([string]$Message) Write-Host "[OK] $Message" -ForegroundColor Green }
|
||||
function Write-Warning { param([string]$Message) Write-Host "[WARN] $Message" -ForegroundColor Yellow }
|
||||
function Write-Error { param([string]$Message) Write-Host "[ERR] $Message" -ForegroundColor Red }
|
||||
|
||||
# ========== 标题 ==========
|
||||
Write-Host ""
|
||||
Write-Host "========================================" -ForegroundColor Magenta
|
||||
Write-Host " Better-Seewo 一键构建脚本 v2.0.1" -ForegroundColor Magenta
|
||||
Write-Host " 雾生万象,启以为光" -ForegroundColor Magenta
|
||||
Write-Host "========================================" -ForegroundColor Magenta
|
||||
Write-Host ""
|
||||
|
||||
# ========== 检测 .NET SDK ==========
|
||||
Write-Info "检测 .NET SDK ..."
|
||||
$dotnetVersion = dotnet --version 2>$null
|
||||
if (-not $dotnetVersion) {
|
||||
Write-Error ".NET SDK 未找到!请先安装 .NET 6.0 SDK:"
|
||||
Write-Error " https://dotnet.microsoft.com/download/dotnet/6.0"
|
||||
exit 1
|
||||
}
|
||||
Write-Success ".NET SDK 版本: $dotnetVersion"
|
||||
|
||||
# ========== 检测解决方案路径 ==========
|
||||
$SolutionDir = $PSScriptRoot
|
||||
$SolutionFile = Join-Path $SolutionDir "Better-Seewo.sln"
|
||||
if (-not (Test-Path $SolutionFile)) {
|
||||
Write-Error "未找到解决方案文件: $SolutionFile"
|
||||
exit 1
|
||||
}
|
||||
Write-Info "解决方案路径: $SolutionFile"
|
||||
|
||||
# ========== 清理旧输出 ==========
|
||||
Write-Info "清理旧构建输出 ..."
|
||||
$OutputManager = Join-Path $OutputPath "Manager"
|
||||
$OutputInstaller = Join-Path $OutputPath "Installer"
|
||||
if (Test-Path $OutputPath) {
|
||||
Remove-Item -Recurse -Force $OutputPath
|
||||
}
|
||||
New-Item -ItemType Directory -Path $OutputManager -Force | Out-Null
|
||||
New-Item -ItemType Directory -Path $OutputInstaller -Force | Out-Null
|
||||
Write-Success "输出目录已清理: $OutputPath"
|
||||
|
||||
# ========== 还原 NuGet 包 ==========
|
||||
Write-Info "还原 NuGet 包 ..."
|
||||
$restoreArgs = @("restore", $SolutionFile)
|
||||
# 如果 EasiPlugin 私有源不可用,跳过它
|
||||
$NugetConfig = Join-Path $SolutionDir "NuGet.config"
|
||||
if (Test-Path $NugetConfig) {
|
||||
[xml]$nugetXml = Get-Content $NugetConfig
|
||||
$easiPluginSource = $nugetXml.configuration.packageSources.add | Where-Object { $_.key -eq "EasiPlugin" }
|
||||
if ($easiPluginSource) {
|
||||
Write-Warning "检测到 EasiPlugin 私有 NuGet 源,Better-EN5 项目可能无法编译"
|
||||
}
|
||||
}
|
||||
|
||||
& dotnet @restoreArgs
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Warning "NuGet 还原部分失败(EasiPlugin SDK 可能无法访问),继续构建可用项目 ..."
|
||||
}
|
||||
|
||||
# ========== 构建 Manager ==========
|
||||
Write-Info "构建 Manager 项目 [$Configuration] ..."
|
||||
$managerArgs = @(
|
||||
"publish",
|
||||
(Join-Path $SolutionDir "Manager\Manager.csproj"),
|
||||
"-c", $Configuration,
|
||||
"--no-restore",
|
||||
"-o", $OutputManager,
|
||||
"-p:SolutionDir=$SolutionDir\"
|
||||
)
|
||||
if ($SelfContained) {
|
||||
$managerArgs += "--self-contained"
|
||||
$managerArgs += "true"
|
||||
$managerArgs += "-r"
|
||||
$managerArgs += "win-x64"
|
||||
}
|
||||
|
||||
& dotnet @managerArgs
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Manager 项目构建失败!"
|
||||
exit 1
|
||||
}
|
||||
Write-Success "Manager 构建完成 -> $OutputManager"
|
||||
|
||||
# ========== 构建 Installer ==========
|
||||
Write-Info "构建 Installer 项目 [$Configuration] ..."
|
||||
$installerArgs = @(
|
||||
"publish",
|
||||
(Join-Path $SolutionDir "Installer\Installer.csproj"),
|
||||
"-c", $Configuration,
|
||||
"--no-restore",
|
||||
"-o", $OutputInstaller,
|
||||
"-p:SolutionDir=$SolutionDir\"
|
||||
)
|
||||
if ($SelfContained) {
|
||||
$installerArgs += "--self-contained"
|
||||
$installerArgs += "true"
|
||||
$installerArgs += "-r"
|
||||
$installerArgs += "win-x64"
|
||||
}
|
||||
|
||||
& dotnet @installerArgs
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Installer 项目构建失败!"
|
||||
exit 1
|
||||
}
|
||||
Write-Success "Installer 构建完成 -> $OutputInstaller"
|
||||
|
||||
# ========== 复制构建脚本到输出目录 ==========
|
||||
Write-Info "复制构建脚本 ..."
|
||||
Copy-Item (Join-Path $SolutionDir "build.ps1") $OutputPath
|
||||
Copy-Item (Join-Path $SolutionDir "build.bat") $OutputPath
|
||||
Write-Success "构建脚本已复制"
|
||||
|
||||
# ========== 生成版本信息 ==========
|
||||
Write-Info "生成版本信息 ..."
|
||||
$VersionInfo = @"
|
||||
Better-Seewo v2.0.1
|
||||
构建时间: $(Get-Date -Format "yyyy-MM-dd HH:mm:ss")
|
||||
构建配置: $Configuration
|
||||
自包含模式: $SelfContained
|
||||
.NET SDK: $dotnetVersion
|
||||
|
||||
组件列表:
|
||||
- Better-Seewo.Manager.exe (管理器桌面应用)
|
||||
- Better-Seewo.Installer.exe (安装向导)
|
||||
|
||||
系统要求:
|
||||
- Windows 10/11
|
||||
$(if (-not $SelfContained) { " - .NET 6.0 Desktop Runtime`n" })
|
||||
- 希沃白板 EN5 v5.2.4.9855
|
||||
|
||||
作者: 雾启工作室
|
||||
"@
|
||||
$VersionInfo | Out-File -Encoding UTF8 (Join-Path $OutputPath "VERSION.txt")
|
||||
Write-Success "版本信息已生成"
|
||||
|
||||
# ========== 统计输出文件 ==========
|
||||
Write-Info "统计构建产物 ..."
|
||||
$managerExe = Get-ChildItem $OutputManager -Filter "Better-Seewo.Manager*.exe" -ErrorAction SilentlyContinue
|
||||
$installerExe = Get-ChildItem $OutputInstaller -Filter "Better-Seewo.Installer*.exe" -ErrorAction SilentlyContinue
|
||||
|
||||
if ($managerExe) {
|
||||
Write-Success "Manager 可执行文件: $($managerExe.Name) ($([math]::Round($managerExe.Length/1MB, 2)) MB)"
|
||||
} else {
|
||||
Write-Warning "Manager .exe 未生成(可能为 DLL-only 输出)"
|
||||
}
|
||||
if ($installerExe) {
|
||||
Write-Success "Installer 可执行文件: $($installerExe.Name) ($([math]::Round($installerExe.Length/1MB, 2)) MB)"
|
||||
} else {
|
||||
Write-Warning "Installer .exe 未生成(可能为 DLL-only 输出)"
|
||||
}
|
||||
|
||||
# ========== 完成 ==========
|
||||
Write-Host ""
|
||||
Write-Host "========================================" -ForegroundColor Green
|
||||
Write-Host " 构建成功!" -ForegroundColor Green
|
||||
Write-Host " 输出目录: $OutputPath" -ForegroundColor Green
|
||||
Write-Host "========================================" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
|
||||
# 可选:自动打开输出目录
|
||||
$openDir = Read-Host "是否打开输出目录? (Y/n)"
|
||||
if ($openDir -eq "" -or $openDir -match "^[Yy]") {
|
||||
Invoke-Item $OutputPath
|
||||
}
|
||||
32
build.bat
Normal file
32
build.bat
Normal file
@@ -0,0 +1,32 @@
|
||||
@echo off
|
||||
chcp 65001 >nul
|
||||
title Better-Seewo 一键构建
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Better-Seewo 一键构建脚本 v2.0.1
|
||||
echo 雾生万象,启以为光
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
:: 检测 PowerShell
|
||||
where powershell >nul 2>nul
|
||||
if %errorlevel% neq 0 (
|
||||
echo [错误] 未找到 PowerShell,请先安装 PowerShell。
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
:: 运行构建脚本
|
||||
echo [INFO] 正在启动 PowerShell 构建脚本 ...
|
||||
echo.
|
||||
powershell -ExecutionPolicy Bypass -File "%~dp0build.ps1" %*
|
||||
|
||||
if %errorlevel% neq 0 (
|
||||
echo.
|
||||
echo [错误] 构建失败!
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo.
|
||||
pause
|
||||
196
build.ps1
Normal file
196
build.ps1
Normal file
@@ -0,0 +1,196 @@
|
||||
#Requires -Version 5.1
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Better-Seewo 一键构建脚本
|
||||
.DESCRIPTION
|
||||
自动还原 NuGet 包、编译 Manager 和 Installer 项目,并打包为发布版本。
|
||||
支持 Debug / Release 配置,支持框架依赖和自包含两种发布模式。
|
||||
.PARAMETER Configuration
|
||||
构建配置:Debug 或 Release(默认 Release)
|
||||
.PARAMETER SelfContained
|
||||
是否自包含 .NET Runtime(默认 $false,需要用户安装 .NET 6 Desktop Runtime)
|
||||
.PARAMETER OutputPath
|
||||
输出目录(默认 ./Publish)
|
||||
.EXAMPLE
|
||||
.\build.ps1
|
||||
.\build.ps1 -Configuration Release -SelfContained $true
|
||||
#>
|
||||
param(
|
||||
[ValidateSet("Debug", "Release")]
|
||||
[string]$Configuration = "Release",
|
||||
|
||||
[bool]$SelfContained = $false,
|
||||
|
||||
[string]$OutputPath = "$PSScriptRoot\Publish"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# ========== 颜色输出辅助函数 ==========
|
||||
function Write-Info { param([string]$Message) Write-Host "[INFO] $Message" -ForegroundColor Cyan }
|
||||
function Write-Success { param([string]$Message) Write-Host "[OK] $Message" -ForegroundColor Green }
|
||||
function Write-Warning { param([string]$Message) Write-Host "[WARN] $Message" -ForegroundColor Yellow }
|
||||
function Write-Error { param([string]$Message) Write-Host "[ERR] $Message" -ForegroundColor Red }
|
||||
|
||||
# ========== 标题 ==========
|
||||
Write-Host ""
|
||||
Write-Host "========================================" -ForegroundColor Magenta
|
||||
Write-Host " Better-Seewo 一键构建脚本 v2.0.1" -ForegroundColor Magenta
|
||||
Write-Host " 雾生万象,启以为光" -ForegroundColor Magenta
|
||||
Write-Host "========================================" -ForegroundColor Magenta
|
||||
Write-Host ""
|
||||
|
||||
# ========== 检测 .NET SDK ==========
|
||||
Write-Info "检测 .NET SDK ..."
|
||||
$dotnetVersion = dotnet --version 2>$null
|
||||
if (-not $dotnetVersion) {
|
||||
Write-Error ".NET SDK 未找到!请先安装 .NET 6.0 SDK:"
|
||||
Write-Error " https://dotnet.microsoft.com/download/dotnet/6.0"
|
||||
exit 1
|
||||
}
|
||||
Write-Success ".NET SDK 版本: $dotnetVersion"
|
||||
|
||||
# ========== 检测解决方案路径 ==========
|
||||
$SolutionDir = $PSScriptRoot
|
||||
$SolutionFile = Join-Path $SolutionDir "Better-Seewo.sln"
|
||||
if (-not (Test-Path $SolutionFile)) {
|
||||
Write-Error "未找到解决方案文件: $SolutionFile"
|
||||
exit 1
|
||||
}
|
||||
Write-Info "解决方案路径: $SolutionFile"
|
||||
|
||||
# ========== 清理旧输出 ==========
|
||||
Write-Info "清理旧构建输出 ..."
|
||||
$OutputManager = Join-Path $OutputPath "Manager"
|
||||
$OutputInstaller = Join-Path $OutputPath "Installer"
|
||||
if (Test-Path $OutputPath) {
|
||||
Remove-Item -Recurse -Force $OutputPath
|
||||
}
|
||||
New-Item -ItemType Directory -Path $OutputManager -Force | Out-Null
|
||||
New-Item -ItemType Directory -Path $OutputInstaller -Force | Out-Null
|
||||
Write-Success "输出目录已清理: $OutputPath"
|
||||
|
||||
# ========== 还原 NuGet 包 ==========
|
||||
Write-Info "还原 NuGet 包 ..."
|
||||
$restoreArgs = @("restore", $SolutionFile)
|
||||
# 如果 EasiPlugin 私有源不可用,跳过它
|
||||
$NugetConfig = Join-Path $SolutionDir "NuGet.config"
|
||||
if (Test-Path $NugetConfig) {
|
||||
[xml]$nugetXml = Get-Content $NugetConfig
|
||||
$easiPluginSource = $nugetXml.configuration.packageSources.add | Where-Object { $_.key -eq "EasiPlugin" }
|
||||
if ($easiPluginSource) {
|
||||
Write-Warning "检测到 EasiPlugin 私有 NuGet 源,Better-EN5 项目可能无法编译"
|
||||
}
|
||||
}
|
||||
|
||||
& dotnet @restoreArgs
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Warning "NuGet 还原部分失败(EasiPlugin SDK 可能无法访问),继续构建可用项目 ..."
|
||||
}
|
||||
|
||||
# ========== 构建 Manager ==========
|
||||
Write-Info "构建 Manager 项目 [$Configuration] ..."
|
||||
$managerArgs = @(
|
||||
"publish",
|
||||
(Join-Path $SolutionDir "Manager\Manager.csproj"),
|
||||
"-c", $Configuration,
|
||||
"--no-restore",
|
||||
"-o", $OutputManager,
|
||||
"-p:SolutionDir=$SolutionDir\"
|
||||
)
|
||||
if ($SelfContained) {
|
||||
$managerArgs += "--self-contained"
|
||||
$managerArgs += "true"
|
||||
$managerArgs += "-r"
|
||||
$managerArgs += "win-x64"
|
||||
}
|
||||
|
||||
& dotnet @managerArgs
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Manager 项目构建失败!"
|
||||
exit 1
|
||||
}
|
||||
Write-Success "Manager 构建完成 -> $OutputManager"
|
||||
|
||||
# ========== 构建 Installer ==========
|
||||
Write-Info "构建 Installer 项目 [$Configuration] ..."
|
||||
$installerArgs = @(
|
||||
"publish",
|
||||
(Join-Path $SolutionDir "Installer\Installer.csproj"),
|
||||
"-c", $Configuration,
|
||||
"--no-restore",
|
||||
"-o", $OutputInstaller,
|
||||
"-p:SolutionDir=$SolutionDir\"
|
||||
)
|
||||
if ($SelfContained) {
|
||||
$installerArgs += "--self-contained"
|
||||
$installerArgs += "true"
|
||||
$installerArgs += "-r"
|
||||
$installerArgs += "win-x64"
|
||||
}
|
||||
|
||||
& dotnet @installerArgs
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Installer 项目构建失败!"
|
||||
exit 1
|
||||
}
|
||||
Write-Success "Installer 构建完成 -> $OutputInstaller"
|
||||
|
||||
# ========== 复制构建脚本到输出目录 ==========
|
||||
Write-Info "复制构建脚本 ..."
|
||||
Copy-Item (Join-Path $SolutionDir "build.ps1") $OutputPath
|
||||
Copy-Item (Join-Path $SolutionDir "build.bat") $OutputPath
|
||||
Write-Success "构建脚本已复制"
|
||||
|
||||
# ========== 生成版本信息 ==========
|
||||
Write-Info "生成版本信息 ..."
|
||||
$VersionInfo = @"
|
||||
Better-Seewo v2.0.1
|
||||
构建时间: $(Get-Date -Format "yyyy-MM-dd HH:mm:ss")
|
||||
构建配置: $Configuration
|
||||
自包含模式: $SelfContained
|
||||
.NET SDK: $dotnetVersion
|
||||
|
||||
组件列表:
|
||||
- Better-Seewo.Manager.exe (管理器桌面应用)
|
||||
- Better-Seewo.Installer.exe (安装向导)
|
||||
|
||||
系统要求:
|
||||
- Windows 10/11
|
||||
$(if (-not $SelfContained) { " - .NET 6.0 Desktop Runtime`n" })
|
||||
- 希沃白板 EN5 v5.2.4.9855
|
||||
|
||||
作者: 雾启工作室
|
||||
"@
|
||||
$VersionInfo | Out-File -Encoding UTF8 (Join-Path $OutputPath "VERSION.txt")
|
||||
Write-Success "版本信息已生成"
|
||||
|
||||
# ========== 统计输出文件 ==========
|
||||
Write-Info "统计构建产物 ..."
|
||||
$managerExe = Get-ChildItem $OutputManager -Filter "Better-Seewo.Manager*.exe" -ErrorAction SilentlyContinue
|
||||
$installerExe = Get-ChildItem $OutputInstaller -Filter "Better-Seewo.Installer*.exe" -ErrorAction SilentlyContinue
|
||||
|
||||
if ($managerExe) {
|
||||
Write-Success "Manager 可执行文件: $($managerExe.Name) ($([math]::Round($managerExe.Length/1MB, 2)) MB)"
|
||||
} else {
|
||||
Write-Warning "Manager .exe 未生成(可能为 DLL-only 输出)"
|
||||
}
|
||||
if ($installerExe) {
|
||||
Write-Success "Installer 可执行文件: $($installerExe.Name) ($([math]::Round($installerExe.Length/1MB, 2)) MB)"
|
||||
} else {
|
||||
Write-Warning "Installer .exe 未生成(可能为 DLL-only 输出)"
|
||||
}
|
||||
|
||||
# ========== 完成 ==========
|
||||
Write-Host ""
|
||||
Write-Host "========================================" -ForegroundColor Green
|
||||
Write-Host " 构建成功!" -ForegroundColor Green
|
||||
Write-Host " 输出目录: $OutputPath" -ForegroundColor Green
|
||||
Write-Host "========================================" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
|
||||
# 可选:自动打开输出目录
|
||||
$openDir = Read-Host "是否打开输出目录? (Y/n)"
|
||||
if ($openDir -eq "" -or $openDir -match "^[Yy]") {
|
||||
Invoke-Item $OutputPath
|
||||
}
|
||||
Reference in New Issue
Block a user