diff options
| author | ruki <[email protected]> | 2023-11-10 22:55:10 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-11-10 22:55:10 +0800 |
| commit | ff33f52afebb41b4d281e9b4f7c9c6711a1e422c (patch) | |
| tree | d7e9c6c2a5b36bf27c28944932b5f47465409e8b /xmake/plugins/pack/nsis/main.lua | |
| parent | 28197467e651b9a92d7076a56783eb00b3dfaeb2 (diff) | |
get specfile
Diffstat (limited to 'xmake/plugins/pack/nsis/main.lua')
| -rw-r--r-- | xmake/plugins/pack/nsis/main.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xmake/plugins/pack/nsis/main.lua b/xmake/plugins/pack/nsis/main.lua index e672ce03f..24bd371f7 100644 --- a/xmake/plugins/pack/nsis/main.lua +++ b/xmake/plugins/pack/nsis/main.lua @@ -53,9 +53,23 @@ end -- pack nsis package function _pack_nsis(makensis, package, opt) + + -- install the initial specfile + local specfile = package:specfile() + if not os.isfile(specfile) then + local specfile_template = path.join(os.programdir(), "scripts", "xpack", "nsis", "makensis.nsi") + os.cp(specfile_template, specfile) + end + + -- generate specfile print("xpack(%s)", package:name()) print(" description: %s", package:description()) print(" installcmd: ", package:script("installcmd")) + + -- ./nsis/makensis.exe /DMAJOR=$($version.ProductMajorPart) + -- /DMINOR=$($version.ProductMinorPart) + -- /DALTER=$($version.ProductBuildPart) /DBUILD=$($($version.ProductVersion + -- -split '\+')[1]) /D${{ matrix.arch }} .\scripts\installer.nsi end function main(package, opt) @@ -63,6 +77,9 @@ function main(package, opt) -- get makensis local makensis, oldenvs = _get_makensis() + -- clean the build directory first + os.tryrm(package:buildir()) + -- pack nsis package _pack_nsis(makensis.program, package, opt) |
