diff options
| author | A2va <[email protected]> | 2024-04-24 23:04:32 +0200 |
|---|---|---|
| committer | A2va <[email protected]> | 2024-04-24 23:04:32 +0200 |
| commit | 007a8cc968097a24845dbf26fd3f6a3704c4b1b3 (patch) | |
| tree | 739916f0bf6c8f887de802c7d662bc82497334fb | |
| parent | 06d823d3ee7066ce559b57a308d352e9828bf2e9 (diff) | |
Add components support
| -rw-r--r-- | xmake/plugins/pack/wix/main.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xmake/plugins/pack/wix/main.lua b/xmake/plugins/pack/wix/main.lua index ed2fbe760..57c792d5a 100644 --- a/xmake/plugins/pack/wix/main.lua +++ b/xmake/plugins/pack/wix/main.lua @@ -127,7 +127,7 @@ function _get_feature_string(name, opt) local allow_absent = opt.force and "false" or "true" local allow_advertise = opt.force and "false" or "true" local typical_default = opt.force and [[TypicalDefault="install"]] or "" - local directory = opt.config_dir and [[ConfigurableDirectory="INSTALLFOLDER]] or "" + 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, name, description, level, allow_advertise, allow_absent, typical_default, directory) return feature end @@ -143,7 +143,7 @@ function _build_feature(package, opt) local default = opt.default or package:get("default") local result = {} - table.insert(result, _get_feature_string(package:title(), table.join(opt, {default = default, description = package:description()}))) + table.insert(result, _get_feature_string(opt.name or package:title(), table.join(opt, {default = default, description = package:description()}))) local installcmds = batchcmds.get_installcmds(package):cmds() local uninstallcmds = batchcmds.get_uninstallcmds(package):cmds() @@ -196,8 +196,11 @@ function _get_specvars(package) table.join2(features, _build_feature(package, {default = true, force = true})) table.join2(features, _add_to_path(package)) - specvars.PACKAGE_CMDS = table.concat(features, "\n ") + for name, component in table.orderpairs(package:components()) do + table.join2(features, _build_feature(component, {name = "Install " .. name})) + end + specvars.PACKAGE_CMDS = table.concat(features, "\n ") specvars.PACKAGE_WIX_UPGRADECODE = hash.uuid(package:name()) -- company cannot be empty with wix |
