Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xpack: wix toolset support #4788

Merged
merged 15 commits into from
May 27, 2024
Merged

Xpack: wix toolset support #4788

merged 15 commits into from
May 27, 2024

Conversation

A2va
Copy link
Contributor

@A2va A2va commented Mar 1, 2024

TODO:

  • Add to PATH
  • Add xpack components
  • 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 or after_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.

@waruqi waruqi mentioned this pull request May 16, 2024
@waruqi
Copy link
Member

waruqi commented May 23, 2024

Does it ready now?

@A2va
Copy link
Contributor Author

A2va commented May 23, 2024

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.

@waruqi
Copy link
Member

waruqi commented May 23, 2024

you can add this new format in test.

set_formats("nsis", "srpm", "rpm", "zip", "targz", "srczip", "srctargz", "runself")

it will be tested on ci.

@A2va A2va marked this pull request as ready for review May 25, 2024 18:33
@waruqi
Copy link
Member

waruqi commented May 27, 2024

Thanks, I will test it in these days.

@waruqi
Copy link
Member

waruqi commented May 27, 2024

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)

@A2va
Copy link
Contributor Author

A2va commented May 27, 2024

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

@waruqi
Copy link
Member

waruqi commented May 27, 2024

        package:addenv("WIX_EXTENSIONS", package:installdir("bin"))

We should set relative path.

        package:addenv("WIX_EXTENSIONS", "bin")

@waruqi
Copy link
Member

waruqi commented May 27, 2024

xmake-io/xmake-repo#4170

@waruqi
Copy link
Member

waruqi commented May 27, 2024

I tried it again, there are some different points.

different component default value status

mix

image

nsis

image

different install root path

mix

image

nsis

image

@waruqi
Copy link
Member

waruqi commented May 27, 2024

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

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.

@waruqi
Copy link
Member

waruqi commented May 27, 2024

And you can add wix to https://github.com/xmake-io/xmake/blob/master/core/xpack.lua to test xmake installer.

@waruqi waruqi changed the base branch from dev to wix May 27, 2024 14:25
@waruqi waruqi added this to the v2.9.3 milestone May 27, 2024
@waruqi waruqi merged commit 1dfee59 into xmake-io:wix May 27, 2024
19 checks passed
@waruqi
Copy link
Member

waruqi commented May 27, 2024

You can continue to improve it to wix branch. #5153

And I will aslo improve it.

@waruqi
Copy link
Member

waruqi commented May 27, 2024

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

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.

A2va added a commit to A2va/xmake that referenced this pull request May 27, 2024
A2va added a commit to A2va/xmake that referenced this pull request May 27, 2024
A2va added a commit to A2va/xmake that referenced this pull request May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants