xmake
xmake copied to clipboard
Xpack: wix toolset support
Closes #4637
TODO:
- [x] Add to PATH
- [x] Add xpack components
- [x] Submit package to xmake-repo
There are two drawbacks:
- From what I have learned with the wix toolset, you cannot set the order of the actions (installing files, creating folders). So the commands set in
before_installcmd
orafter_installcmd
can be executed at the same time. - The actions that wix can perform are limited, so the move and cd commands are not supported.
Does it ready now?
There are a few things missing (unit tests, ...), I will test again tomorrow and the review can be done this weekend. If anyone wants to try and provide feedback, I will be happy to take it.
you can add this new format in test.
https://github.com/xmake-io/xmake/blob/c31fa8ffad9d5abe9b70724d843400bbe2bde4cf/tests/plugins/pack/xmake.lua#L22
it will be tested on ci.
Thanks, I will test it in these days.
I tried it, but I get some errors.
> xmake pack -f wix
packing build\xpack\test\test-windows-x64-v1.0.0.msi
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
-> wixtoolset 5.0.0
please input: y (y/n/m)
=> install wixtoolset 5.0.0 .. ok
error: wix.exe : error WIX0144: The extension 'WixToolset.UI.wixext' could not be found. Checked paths: WixToolset.UI.wixext
wix build build\.xpack\test\test-windows-x64-v1.0.0.wxs -ext WixToolset.UI.wixext -o build\xpack\test\test-windows-x64-v1.0.0.msi -arch x64
wix.exe : error WIX0144: The extension 'WixToolset.UI.wixext' could not be found. Checked paths: WixToolset.UI.wixext
error: @programdir\core\main.lua:314: @programdir\core\sandbox\modules\os.lua:378: execv(wix build build\.xpack\test\test-windows-x64-v1.0.0.wxs -ext WixToolset.UI.wixext -o build\xpack\test\test-windows-x64-v1.0.0.msi -arch x64) failed(144)
I think I know why.
The WIX_EXTENSIONS
env is registered as C:\Users\runneradmin\AppData\Local\.xmake\packages\w\wixtoolset\5.0.0\361647656cc344cc8086fd2a7e53dd19\bin
in the manifest.txt
It's certainly because it downloaded wix from the precompiled package, at least that is the the case on my end.
in xmake-repo:
-> wixtoolset 5.0.0
please input: y (y/n/m)
y
=> download https://github.com/xmake-mirror/build-artifacts/releases/download/wixtoolset-5.0.0/windows-x64-vc14.39.33519-361647656cc344cc8086fd2a7e53dd19.7z .. ok
=> install wixtoolset 5.0.0 .. ok
package:addenv("WIX_EXTENSIONS", package:installdir("bin"))
We should set relative path.
package:addenv("WIX_EXTENSIONS", "bin")
https://github.com/xmake-io/xmake-repo/pull/4170
I tried it again, there are some different points.
different component default value status
mix
nsis
different install root path
mix
nsis
I think I know why. The
WIX_EXTENSIONS
env is registered asC:\Users\runneradmin\AppData\Local\.xmake\packages\w\wixtoolset\5.0.0\361647656cc344cc8086fd2a7e53dd19\bin
in the manifest.txt It's certainly because it downloaded wix from the precompiled package, at least that is the the case on my end.in xmake-repo: -> wixtoolset 5.0.0 please input: y (y/n/m) y => download https://github.com/xmake-mirror/build-artifacts/releases/download/wixtoolset-5.0.0/windows-x64-vc14.39.33519-361647656cc344cc8086fd2a7e53dd19.7z .. ok => install wixtoolset 5.0.0 .. ok
I fixed it, at least the first run, it works. But the second run still has this problem.
But when running wix for the second time it still has the problem.
And you can add wix
to https://github.com/xmake-io/xmake/blob/master/core/xpack.lua to test xmake installer.
You can continue to improve it to wix
branch. https://github.com/xmake-io/xmake/pull/5153
And I will aslo improve it.
I think I know why. The
WIX_EXTENSIONS
env is registered asC:\Users\runneradmin\AppData\Local\.xmake\packages\w\wixtoolset\5.0.0\361647656cc344cc8086fd2a7e53dd19\bin
in the manifest.txt It's certainly because it downloaded wix from the precompiled package, at least that is the the case on my end.in xmake-repo: -> wixtoolset 5.0.0 please input: y (y/n/m) y => download https://github.com/xmake-mirror/build-artifacts/releases/download/wixtoolset-5.0.0/windows-x64-vc14.39.33519-361647656cc344cc8086fd2a7e53dd19.7z .. ok => install wixtoolset 5.0.0 .. ok
I fixed it, at least the first run, it works. But the second run still has this problem.
But when running wix for the second time it still has the problem.
I have fixed it.