From f469fe804aa5d3cbf89cd531c458b769913f4b92 Mon Sep 17 00:00:00 2001 From: jinke18 Date: Tue, 30 Jul 2024 21:02:13 +0800 Subject: [PATCH] fixbug:nsis pack only support ascii path without blank space --- xmake/plugins/pack/nsis/main.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xmake/plugins/pack/nsis/main.lua b/xmake/plugins/pack/nsis/main.lua index ac6d008b723..a22c1a0718a 100644 --- a/xmake/plugins/pack/nsis/main.lua +++ b/xmake/plugins/pack/nsis/main.lua @@ -113,7 +113,7 @@ function _get_command_strings(package, cmd, opt) local dstname = path.filename(dstfile) local dstdir = path.normalize(path.directory(dstfile)) table.insert(result, string.format("SetOutPath \"%s\"", dstdir)) - table.insert(result, string.format("File /oname=%s \"%s\"", dstname, srcfile)) + table.insert(result, string.format("File \"/oname=%s\" \"%s\"", dstname, srcfile)) end elseif kind == "rm" then local filepath = _translate_filepath(package, cmd.filepath) @@ -268,7 +268,9 @@ function _pack_nsis(makensis, package) local specvars_values = {} io.gsub(specfile, "(" .. pattern .. ")", function(_, name) table.insert(specvars_names, name) - end) + end, + {encoding="ansi"} + ) for _, name in ipairs(specvars_names) do name = name:trim() if specvars_values[name] == nil then @@ -288,7 +290,9 @@ function _pack_nsis(makensis, package) io.gsub(specfile, "(" .. pattern .. ")", function(_, name) name = name:trim() return specvars_values[name] - end) + end, + {encoding="ansi"} + ) -- make package os.vrunv(makensis, {specfile})