feat(installers): 切换资源URL到main分支并添加更新脚本安装

将所有安装脚本的资源下载链接从固定commit路径切换为main分支原始路径,同时为各安装器新增下载并写入对应更新脚本的逻辑,支持后续程序更新。
This commit is contained in:
2026-06-28 13:20:49 +08:00
parent a4d97fbd5a
commit 0a70ffe931
7 changed files with 38 additions and 11 deletions
+12 -1
View File
@@ -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.")