summaryrefslogtreecommitdiff
path: root/xmake/plugins/pack/nsis/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-11-22 22:35:52 +0800
committerruki <[email protected]>2023-11-22 22:35:52 +0800
commit98179c982c6d67a88e6918959d8c434fdbbe7a25 (patch)
treee43859d61a081f4a5d92fb52d92ea50526979c2c /xmake/plugins/pack/nsis/main.lua
parent72eaaf884bd49781a783ea4c65b52e322fb5419d (diff)
install xpack component
Diffstat (limited to 'xmake/plugins/pack/nsis/main.lua')
-rw-r--r--xmake/plugins/pack/nsis/main.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/xmake/plugins/pack/nsis/main.lua b/xmake/plugins/pack/nsis/main.lua
index 282b20a2d..e44d41d8b 100644
--- a/xmake/plugins/pack/nsis/main.lua
+++ b/xmake/plugins/pack/nsis/main.lua
@@ -152,6 +152,16 @@ function _get_commands_string(package, cmds, opt)
return table.concat(cmdstrs, "\n ")
end
+-- get install commands of component
+function _get_component_installcmds(component)
+ return _get_commands_string(component, batchcmds.get_installcmds(component):cmds(), {install = true})
+end
+
+-- get uninstall commands of component
+function _get_component_uninstallcmds(component)
+ return _get_commands_string(component, batchcmds.get_uninstallcmds(component):cmds(), {install = false})
+end
+
-- get install commands
function _get_installcmds(package)
return _get_commands_string(package, batchcmds.get_installcmds(package):cmds(), {install = true})
@@ -211,8 +221,9 @@ function _get_specvars(package)
local result = {}
for name, component in table.orderpairs(package:components()) do
local tag = "Install" .. name
+ local cmd = _get_component_installcmds(component)
table.insert(result, string.format('Section "%s" %s', component:title(), tag))
- -- TODO add commands
+ table.insert(result, cmd)
table.insert(result, "SectionEnd")
end
return table.concat(result, "\n ")