summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorruki <[email protected]>2023-11-17 22:53:23 +0800
committerruki <[email protected]>2023-11-17 22:53:23 +0800
commit65d2bc2cad967c0de7304e00500d99ff13307d21 (patch)
tree8b28cd6f380c0df8d53068e2c335db8daecf37dd /xmake/plugins
parentcf3afe37b546efb93079fd6314c0769884ca0fb1 (diff)
fix makensis
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/pack/nsis/main.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/xmake/plugins/pack/nsis/main.lua b/xmake/plugins/pack/nsis/main.lua
index 3c4fa3bbd..22d63eb30 100644
--- a/xmake/plugins/pack/nsis/main.lua
+++ b/xmake/plugins/pack/nsis/main.lua
@@ -524,6 +524,20 @@ function _get_filter_value(package, name)
return value
end
+-- get target file path
+function _get_target_filepath(package)
+ local targetfile
+ for _, target in ipairs(package:targets()) do
+ if target:is_binary() then
+ targetfile = target:targetfile()
+ break
+ end
+ end
+ if targetfile then
+ return path.normalize(path.join(package:bindir(), path.filename(targetfile)))
+ end
+end
+
-- get specvars
function _get_specvars(package)
local specvars = table.clone(package:specvars())
@@ -537,6 +551,7 @@ function _get_specvars(package)
return _get_uninstallcmds(package)
end
specvars.PACKAGE_NSIS_DISPLAY_NAME = _get_filter_value(package, "nsis_displayname") or package:name()
+ specvars.PACKAGE_NSIS_DISPLAY_ICON = _get_filter_value(package, "nsis_displayicon") or _get_target_filepath(package) or ""
specvars.PACKAGE_NSIS_INSTALL_SECTIONS = function ()
local result = {}
local cmds = package:get("nsis_installcmds")