diff --git a/fs/xmake.lua b/fs/xmake.lua deleted file mode 100644 index 557dc7e..0000000 --- a/fs/xmake.lua +++ /dev/null @@ -1,31 +0,0 @@ -add_rules("mode.debug", "mode.release") -set_languages("c++17") - -if is_plat("windows") then - add_cxxflags("/source-charset:utf-8", {force = true}) -end -if is_plat("mingw") then - add_cxxflags("-Wno-unused-variable -finput-charset=utf-8 -fexec-charset=gbk") -end -if is_mode("debug") then - set_suffixname("d") -end -target("lua_fs") - add_options("boost") - add_defines("FS_LIB_EXPORT") - set_kind("shared") - add_files("*.cxx") - add_deps("lua") - if is_plat("mingw") or is_plat("windows") then - set_filename("lua_fs.dll") - end -option("boost") - set_default(false) - set_showmenu(true) - boost_root_dir = os.getenv("BOOST_HEADER_DIR") - boost_lib_dir = os.getenv("BOOST_LIB_DIR") - boost_libs = os.getenv("BOOST_LIBS") - add_includedirs(boost_root_dir) - add_defines("USE_BOOST_FILESYSTEM") - add_linkdirs(boost_lib_dir) - add_links(boost_libs) \ No newline at end of file diff --git a/pack/pack.lua b/pack/pack.lua deleted file mode 100644 index 0bf4bbc..0000000 --- a/pack/pack.lua +++ /dev/null @@ -1,89 +0,0 @@ -local fs = require("lua_fs") - -local path1 = "C:\\Program Files\\NSIS\\makensis.exe" -local path2 = "C:\\Program Files (x86)\\NSIS\\makensis.exe" -local version = "v0.1" -local package_name = "mlua" -local extern = "" - --- 确定使用哪个路径 -local makensis_path = nil - -if fs.exists(path2) then - makensis_path = path2 -elseif fs.exists(path1) then - makensis_path = path1 -else - print("Error: makensis.exe not found!") - return -end - --- 执行 xmake f -v 命令并获取输出 -local handle = io.popen('cd .. && xmake f -v') -- 使用 io.popen 执行命令并获取输出句柄 -if not handle then - print("xmake f -v 命令执行失败") - return -end -local output = handle:read("*a") -- 读取命令输出 -handle:close() -- 关闭文件句柄 - --- 匹配并提取 plat, arch 和 mode -local plat = string.match(output, "plat = (%S+)") -local arch = string.match(output, "arch = (%S+)") -local mode = string.match(output, "mode = (%S+)") - --- 打印结果 -print("plat: " .. plat) -print("arch: " .. arch) -print("mode: " .. mode) - --- 获取当前脚本所在的目录 -local cur = fs.get_current_directory() -local updir = fs.get_parent(cur) -local re_bin_dir = updir .. "/build/" .. plat .. "/" .. arch .. "/" .. mode -local bin_dir = fs.normalize(re_bin_dir) -print("bin_dir: " .. bin_dir) - -local files = "" -local filenames = {"mlua.exe", "mluac.exe", "lua_fs.dll"} -local function add_files_to_list(arg_bin_dir) - for _, filename in ipairs(filenames) do - files = files .. "File \"" .. fs.append_path(arg_bin_dir, filename) .. "\"\n " - end - return files -end - -add_files_to_list(bin_dir) - --- 打开文件 -local file = io.open("pack.nsi", "r") -if not file then - print("文件打开失败") - return -end - --- 读取文件内容 -local content = file:read("*all") -file:close() - -local new_str = string.gsub(content, "REP_NAME", package_name) -new_str = string.gsub(new_str, "REP_BIN_FILE", package_name .. "-" .. version .. "-" .. arch .. extern) -new_str = string.gsub(new_str, ";REP_FILES", files) - -print(new_str) -local f = io.open("tpack.nsi", "w") -if f then - f:write(new_str) - f:close() - print("success to save file tpack.nsi") -else - print("can't open file tpack.nsi") -end - -local command = "\"\"" .. makensis_path .. "\" tpack.nsi\"" -print("command: " .. command) - -local result = os.execute(command) -os.remove("tpack.nsi") -print("End...") - diff --git a/pack/pack.nsi b/pack/pack.nsi deleted file mode 100644 index bab21b7..0000000 --- a/pack/pack.nsi +++ /dev/null @@ -1,82 +0,0 @@ -;NSIS Modern User Interface -;Welcome/Finish Page Example Script -;Written by Joost Verburg - -;-------------------------------- -;Include Modern UI - - !include "MUI2.nsh" - -;-------------------------------- -;General - - !define ProgramName "REP_NAME" - Name "${ProgramName}" - OutFile "REP_BIN_FILE.exe" - Unicode True - InstallDir "$LOCALAPPDATA\${ProgramName}" - RequestExecutionLevel user - -;-------------------------------- -;Interface Settings - - !define MUI_ABORTWARNING - -;-------------------------------- -;Pages - - !insertmacro MUI_PAGE_WELCOME - ;!insertmacro MUI_PAGE_LICENSE "REP_LICENSE" - !insertmacro MUI_PAGE_COMPONENTS - !insertmacro MUI_PAGE_DIRECTORY - !insertmacro MUI_PAGE_INSTFILES - !insertmacro MUI_PAGE_FINISH - - !insertmacro MUI_UNPAGE_WELCOME - !insertmacro MUI_UNPAGE_CONFIRM - !insertmacro MUI_UNPAGE_INSTFILES - !insertmacro MUI_UNPAGE_FINISH - -;-------------------------------- -;Languages - !insertmacro MUI_LANGUAGE "SimpChinese" - -;-------------------------------- -;Installer Sections - -Section "REP_NAME" All - - SetOutPath "$INSTDIR" - - ;ADD YOUR OWN FILES HERE... - ;REP_FILES - ;Create uninstaller - WriteUninstaller "$INSTDIR\Uninstall.exe" - -SectionEnd - -;-------------------------------- -;Descriptions - - ;Language strings - LangString DESC_All 2052 "install all main files." - - ;Assign language strings to sections - !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${All} $(DESC_All) - !insertmacro MUI_FUNCTION_DESCRIPTION_END - -;-------------------------------- -;Uninstaller Section - -Section "Uninstall" - - ;ADD YOUR OWN FILES HERE... - - Delete "$INSTDIR\Uninstall.exe" - - RMDir "$INSTDIR" - - DeleteRegKey /ifempty HKCU "Software\${ProgramName}" - -SectionEnd diff --git a/xmake.lua b/xmake.lua deleted file mode 100644 index 5b317c3..0000000 --- a/xmake.lua +++ /dev/null @@ -1,3 +0,0 @@ -add_rules("mode.debug", "mode.release") -set_languages("c++17") -includes("lua", "fs") \ No newline at end of file