Skip to content

Commit 82f6bd6

Browse files
committed
fix wix id
1 parent 391eb03 commit 82f6bd6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

xmake/plugins/pack/wix/main.lua

+4-3
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,14 @@ function _get_feature_string(name, title, opt)
139139
local allow_advertise = opt.force and "false" or "true"
140140
local typical_default = [[TypicalDefault="install"]]
141141
local directory = opt.config_dir and [[ConfigurableDirectory="INSTALLFOLDER"]] or ""
142-
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)
142+
local feature = string.format([[<Feature Id="%s" Title="%s" Description="%s" Level="%d" AllowAdvertise="%s" AllowAbsent="%s" %s %s>]],
143+
name:gsub("[ ()]", ""), title, description, level, allow_advertise, allow_absent, typical_default, directory)
143144
return feature
144145
end
145146

146147
function _get_component_string(id, subdirectory)
147148
local subdirectory = (subdirectory ~= "." and subdirectory ~= nil) and string.format([[Subdirectory="%s"]], subdirectory) or ""
148-
return string.format([[<Component Id="%s" Guid="%s" Directory="INSTALLFOLDER" %s>]], id:gsub(" ", ""), hash.uuid(id), subdirectory)
149+
return string.format([[<Component Id="%s" Guid="%s" Directory="INSTALLFOLDER" %s>]], id:gsub("[ ()]", ""), hash.uuid(id), subdirectory)
149150
end
150151

151152
-- for each id/guid in the file wix want them to be unique
@@ -189,7 +190,7 @@ function _build_feature(package, opt)
189190
table.insert(result, "</Component>")
190191
end
191192

192-
table.insert(result, _get_component_string(name.. "Cmds"))
193+
table.insert(result, _get_component_string(name .. "Cmds"))
193194
for _, cmd in ipairs(installcmds) do
194195
table.insert(result, _get_other_commands(package, cmd, {install = true}))
195196
end

0 commit comments

Comments
 (0)