diff options
| author | ruki <[email protected]> | 2023-11-22 00:50:07 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-11-22 00:50:07 +0800 |
| commit | 897fc6b9e0ab48e4012bd523eb7a53bcdf5e1a44 (patch) | |
| tree | 4f59d47c83db88968dda3285b301f7be1029b916 | |
| parent | 8c8f130f69343bbb50dafa718a8fe6df63497974 (diff) | |
register component section in nsis
| -rw-r--r-- | xmake/plugins/pack/nsis/main.lua | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/xmake/plugins/pack/nsis/main.lua b/xmake/plugins/pack/nsis/main.lua index 29e4c6a55..2016a70d9 100644 --- a/xmake/plugins/pack/nsis/main.lua +++ b/xmake/plugins/pack/nsis/main.lua @@ -205,37 +205,33 @@ function _get_specvars(package) end return _translate_filepath(package, iconpath) end - --[[ specvars.PACKAGE_NSIS_INSTALL_SECTIONS = function () local result = {} - local cmds = package:get("nsis_installcmds") - for name, cmd in pairs(cmds) do - local tag = "Install" .. _get_unique_tag(name) - table.insert(result, string.format('Section "%s" %s', name, tag)) - table.insert(result, cmd) + for name, component in table.orderpairs(package:components()) do + local tag = "Install" .. name + table.insert(result, string.format('Section "%s" %s', component:title(), tag)) + -- TODO add commands table.insert(result, "SectionEnd") end return table.concat(result, "\n ") end specvars.PACKAGE_NSIS_INSTALL_DESCS = function () local result = {} - local cmds = package:get("nsis_installcmds") - for name, cmd in pairs(cmds) do - local tag = "Install" .. _get_unique_tag(name) - local description = package:extraconf("nsis_installcmds." .. name, cmd, "description") or name + for name, component in table.orderpairs(package:components()) do + local tag = "Install" .. name + local description = component:description() table.insert(result, string.format('LangString DESC_%s ${LANG_ENGLISH} "%s"', tag, description)) end return table.concat(result, "\n ") end specvars.PACKAGE_NSIS_INSTALL_DESCRIPTION_TEXTS = function () local result = {} - local cmds = package:get("nsis_installcmds") - for name, _ in pairs(cmds) do - local tag = "Install" .. _get_unique_tag(name) + for name, component in table.orderpairs(package:components()) do + local tag = "Install" .. name table.insert(result, string.format('!insertmacro MUI_DESCRIPTION_TEXT ${%s} $(DESC_%s)', tag, tag)) end return table.concat(result, "\n ") - end]] + end return specvars end |
