From 0a70ffe931dc7f73f9ab4304a954b50a880c6855 Mon Sep 17 00:00:00 2001 From: HenryDu8133 <813367384@qq.com> Date: Sun, 28 Jun 2026 13:20:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(installers):=20=E5=88=87=E6=8D=A2=E8=B5=84?= =?UTF-8?q?=E6=BA=90URL=E5=88=B0main=E5=88=86=E6=94=AF=E5=B9=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将所有安装脚本的资源下载链接从固定commit路径切换为main分支原始路径,同时为各安装器新增下载并写入对应更新脚本的逻辑,支持后续程序更新。 --- install_ticketmachine.lua | 13 ++++++++++++- installer.lua | 8 +++++--- installer_bi.lua | 8 +++++--- installer_refill.lua | 13 ++++++++++++- update_gate.lua | 2 +- update_machine.lua | 2 +- update_refill.lua | 3 ++- 7 files changed, 38 insertions(+), 11 deletions(-) diff --git a/install_ticketmachine.lua b/install_ticketmachine.lua index f14d709..c3478d1 100644 --- a/install_ticketmachine.lua +++ b/install_ticketmachine.lua @@ -1,5 +1,6 @@ -local URL_MACHINE_HTTP = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/src/commit/d6aa03d3a78f8b6fbd2754bf3f4199392c6ef4c1/ticketmachine.lua" +local URL_MACHINE_HTTP = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/ticketmachine.lua" +local URL_UPDATE_MACHINE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/update_machine.lua" local function writeFile(path, content, binary) local mode = binary and "wb" or "w" @@ -67,12 +68,22 @@ if not ok or type(code) ~= "string" or #code == 0 then return end +local okUpdate, updateCode = httpGet(URL_UPDATE_MACHINE) +if not okUpdate or type(updateCode) ~= "string" or #updateCode == 0 then + print("Download failed: " .. tostring(updateCode or "")) + return +end + if not atomicWrite("startup", code, false) then print("Write failed: startup") return end atomicWrite("startup.lua", code, false) if fs.exists("ticketmachine.lua") then atomicWrite("ticketmachine.lua", code, false) end +if not atomicWrite("update_machine.lua", updateCode, false) then + print("Write failed: update_machine.lua") + return +end print("") print("Done.") diff --git a/installer.lua b/installer.lua index 6a084d0..143b52b 100644 --- a/installer.lua +++ b/installer.lua @@ -1,6 +1,7 @@ -local URL_ERROR = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/src/commit/d6aa03d3a78f8b6fbd2754bf3f4199392c6ef4c1/error.dfpwm" -local URL_PASS = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/src/commit/d6aa03d3a78f8b6fbd2754bf3f4199392c6ef4c1/pass.dfpwm" -local URL_GATE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/src/commit/d6aa03d3a78f8b6fbd2754bf3f4199392c6ef4c1/gate.lua" +local URL_ERROR = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/error.dfpwm" +local URL_PASS = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/pass.dfpwm" +local URL_GATE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/gate.lua" +local URL_UPDATE_GATE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/update_gate.lua" local CONFIG_PATH = "gate_config.json" @@ -137,6 +138,7 @@ end writeFile("startup.lua", gateCode, false) writeFile("startup", gateCode, false) +if not download(URL_UPDATE_GATE, "update_gate.lua", false) then return end print("") print("Done.") diff --git a/installer_bi.lua b/installer_bi.lua index ab4c7a6..9e0f9f4 100644 --- a/installer_bi.lua +++ b/installer_bi.lua @@ -1,6 +1,7 @@ -local URL_ERROR = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/src/commit/d6aa03d3a78f8b6fbd2754bf3f4199392c6ef4c1/error.dfpwm" -local URL_PASS = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/src/commit/d6aa03d3a78f8b6fbd2754bf3f4199392c6ef4c1/pass.dfpwm" -local URL_GATE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/src/commit/d6aa03d3a78f8b6fbd2754bf3f4199392c6ef4c1/gate.lua" +local URL_ERROR = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/error.dfpwm" +local URL_PASS = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/pass.dfpwm" +local URL_GATE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/gate.lua" +local URL_UPDATE_GATE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/update_gate.lua" local CONFIG_PATH = "gate_config.json" @@ -156,6 +157,7 @@ end writeFile("startup.lua", gateCode, false) writeFile("startup", gateCode, false) +if not download(URL_UPDATE_GATE, "update_gate.lua", false) then return end print("") print("Done.") diff --git a/installer_refill.lua b/installer_refill.lua index bc3edc6..a263d48 100644 --- a/installer_refill.lua +++ b/installer_refill.lua @@ -1,4 +1,5 @@ -local URL_REFILL_MACHINE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/src/commit/d6aa03d3a78f8b6fbd2754bf3f4199392c6ef4c1/refillmachine.lua" +local URL_REFILL_MACHINE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/refillmachine.lua" +local URL_UPDATE_REFILL = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/update_refill.lua" local function writeFile(path, content, binary) local mode = binary and "wb" or "w" @@ -65,6 +66,12 @@ if not ok or type(code) ~= "string" or #code == 0 then return end +local okUpdate, updateCode = httpGet(URL_UPDATE_REFILL) +if not okUpdate or type(updateCode) ~= "string" or #updateCode == 0 then + print("Download failed: " .. tostring(updateCode or "")) + return +end + if not atomicWrite("refillmachine.lua", code, false) then print("Write failed: refillmachine.lua") return @@ -77,6 +84,10 @@ if not atomicWrite("startup", code, false) then print("Write failed: startup") return end +if not atomicWrite("update_refill.lua", updateCode, false) then + print("Write failed: update_refill.lua") + return +end print("") print("Done.") diff --git a/update_gate.lua b/update_gate.lua index b17a6e3..ae262a8 100644 --- a/update_gate.lua +++ b/update_gate.lua @@ -1,5 +1,5 @@ -local URL_GATE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/src/commit/d6aa03d3a78f8b6fbd2754bf3f4199392c6ef4c1/gate.lua" +local URL_GATE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/gate.lua" local function writeFile(path, content, binary) local mode = binary and "wb" or "w" diff --git a/update_machine.lua b/update_machine.lua index 2f1bc8a..2ab3a15 100644 --- a/update_machine.lua +++ b/update_machine.lua @@ -1,5 +1,5 @@ -local URL_MACHINE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/src/commit/d6aa03d3a78f8b6fbd2754bf3f4199392c6ef4c1/ticketmachine.lua" +local URL_MACHINE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/ticketmachine.lua" local function writeFile(path, content, binary) local mode = binary and "wb" or "w" diff --git a/update_refill.lua b/update_refill.lua index bb9f0cf..c353506 100644 --- a/update_refill.lua +++ b/update_refill.lua @@ -1,4 +1,5 @@ -local URL_REFILL_MACHINE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/src/commit/d6aa03d3a78f8b6fbd2754bf3f4199392c6ef4c1/refillmachine.lua" + +local URL_REFILL_MACHINE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/refillmachine.lua" local function writeFile(path, content, binary) local mode = binary and "wb" or "w"