From 00c5ce748b56c672d2f4e796d3f0b263200f95f8 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 5 Apr 2026 16:45:29 +0800 Subject: 增加了对 Linux 平台的支持 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用 Mono (mcs) 和 Wine (wine) 的方式让项目能在 Linux 系统上运行 - 增加 `lin_build.sh` 和 `lin_run.sh` 脚本,用于编译和执行 - 修改 `Program.cs`:使 Mono 平台不会调用 Application.SetHighDpiMode(HighDpiMode.SystemAware); 函数 - 最后,谴责 *SmallFox*,居然不选择跨平台的框架 \斜眼笑 --- lin_build.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 lin_build.sh (limited to 'lin_build.sh') diff --git a/lin_build.sh b/lin_build.sh new file mode 100755 index 0000000..f8f0b21 --- /dev/null +++ b/lin_build.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# 检查 Mono 编译器是否存在 +if ! command -v mcs &> /dev/null; then + echo "ERROR: mcs command not found. Please install Mono." + exit 1 +fi + +cd "$(dirname "$0")/NotePad/NotePad/" + +mkdir -p bin/Linux + +# 使用 Mono 编译 +mcs \ + -target:winexe \ + -out:bin/Linux/NotePad.exe \ + -r:System.Windows.Forms \ + -r:System.Drawing \ + -r:System \ + -r:System.Data \ + -r:System.Xml \ + Form1.cs Form1.Designer.cs Program.cs + +if [ $? -eq 0 ]; then + echo "SUCCESS" +else + echo "FAILED" + exit 1 +fi -- cgit