summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-05-28 22:21:22 +0800
committerruki <[email protected]>2024-05-28 22:21:22 +0800
commit82f6bd6ecec423edcd59dde22ae414fc52e78676 (patch)
tree1fc79faa300cf5e77363ffd8c32cf5be37a2755d
parent391eb035b8287966cadfec022d07e13367715ed5 (diff)
fix wix id
-rw-r--r--xmake/plugins/pack/wix/main.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/xmake/plugins/pack/wix/main.lua b/xmake/plugins/pack/wix/main.lua
index e3550a6ab..659075692 100644
--- a/xmake/plugins/pack/wix/main.lua
+++ b/xmake/plugins/pack/wix/main.lua
@@ -139,13 +139,14 @@ function _get_feature_string(name, title, opt)
local allow_advertise = opt.force and "false" or "true"
local typical_default = [[TypicalDefault="install"]]
local directory = opt.config_dir and [[ConfigurableDirectory="INSTALLFOLDER"]] or ""
- local feature = string.format([[<Feature Id="%s" Title="%s" Description="%s" Level="%d" AllowAdvertise="%s" AllowAbsent="%s" %s %s>]], name:gsub(" ", ""), title, description, level, allow_advertise, allow_absent, typical_default, directory)
+ local feature = string.format([[<Feature Id="%s" Title="%s" Description="%s" Level="%d" AllowAdvertise="%s" AllowAbsent="%s" %s %s>]],
+ name:gsub("[ ()]", ""), title, description, level, allow_advertise, allow_absent, typical_default, directory)
return feature
end
function _get_component_string(id, subdirectory)
local subdirectory = (subdirectory ~= "." and subdirectory ~= nil) and string.format([[Subdirectory="%s"]], subdirectory) or ""
- return string.format([[<Component Id="%s" Guid="%s" Directory="INSTALLFOLDER" %s>]], id:gsub(" ", ""), hash.uuid(id), subdirectory)
+ return string.format([[<Component Id="%s" Guid="%s" Directory="INSTALLFOLDER" %s>]], id:gsub("[ ()]", ""), hash.uuid(id), subdirectory)
end
-- for each id/guid in the file wix want them to be unique
@@ -189,7 +190,7 @@ function _build_feature(package, opt)
table.insert(result, "</Component>")
end
- table.insert(result, _get_component_string(name.. "Cmds"))
+ table.insert(result, _get_component_string(name .. "Cmds"))
for _, cmd in ipairs(installcmds) do
table.insert(result, _get_other_commands(package, cmd, {install = true}))
end