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

Package for winget #1374

Open
scottwillmoore opened this issue Jun 28, 2022 · 16 comments
Open

Package for winget #1374

scottwillmoore opened this issue Jun 28, 2022 · 16 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@scottwillmoore
Copy link
Contributor

It would be nice to be able to install the latest stable release of neovide viawinget. As winget is developed by Microsoft, I expect with time it will become the de facto package manager for Windows.

In a soon to be released version (microsoft/winget-cli#182), winget will be able to install a standalone executable and add it to the PATH. However, I don't believe this will support the start/search menu. This would require neovide to be published as an .exe in releases. In future, it should be possible to extract the .exe from a .zip (microsoft/winget-cli#140), however I don't believe this will be available for a while yet.

To achieve this at the moment, we would have to bundle neovide into an installer such as an .msi which would be able to add neovide to the PATH add create a start menu shortcut. I think the easiest way to do this would be to use cargo-wix to package neovide in the CI workflow.

What are the everyone's thoughts? It could be quite a while before winget implement all the features required, I would be happy to investigate using cargo-wix as a solution.

@scottwillmoore scottwillmoore added the enhancement New feature or request label Jun 28, 2022
@MultisampledNight
Copy link
Contributor

MultisampledNight commented Jun 28, 2022

Neovide already uses cargo-bundle for macOS builds, ideally the Windows solution would use that, too. Switching to another bundling stack for one platform is not really viable, considering that tests (and with that builds because the CI doesn't publish those then) for Windows are already failing on main even for past, actually fine commits. I'm unable to debug that without a Windows machine and asking on the Discord server led to no response on that.

About actually using releases, I think we should not replace the standalone executable, but rather release both the installer and standalone executable in split artifacts. Some users are unable to install programs persistently, but are allowed to execute binaries.

About packaging Neovide for winget at all, I think the situation is similar to Linux packaging: The program authors aren't required to package, and the people on that platform are expected to package stuff they want. Even Rare landed on winget without the Rare devs even knowing, until @loathingKernel recently discovered it.

@scottwillmoore
Copy link
Contributor Author

I didn't know about cargo-bundle, but it definitely makes sense to keep using it. I think at the moment it doesn't support Windows (burtonageo/cargo-bundle#96, burtonageo/cargo-bundle#116).

I have a Windows machine, and happy to investigate some of the build issues with Windows you discussed.

I agree that both the installer and executable for Windows should be released, which is what neovim does.

I think it is up to the maintainers of neovide whether they wish to support an installer-like release for Windows. There is precedent, the Neovim project did decide to create an installer for Windows to support winget. With Linux it is pretty standard for the distribution maintainers to have to package applications, but on Windows and Mac it is generally more normal for the author to provide these installers.

@John-Nagle
Copy link

John-Nagle commented Jul 8, 2022

I have a Windows machine, and happy to investigate some of the build issues with Windows you discussed.

Please do. cargo bundle does not currently support Windows targets. It supports Mac, and has some support for .deb files.

A few people started work on this, but nothing was finished. See crates

  • rust-msi Library to read and write .msi files. Caller provides content.
  • msix Similar, for .msix files.
  • cargo-msix Right idea, but never finished.
  • cargo-wix Requires Wix toolset running on Windows and a project built for Wix.

There may be enough pieces there to do most of the job. Windows install files, .msi or .msix, are rather arcane and need someone who lives in the Windows ecosystem, which I do not.

The intent of cargo bundle is to handle the common cases easily and allow cross-platform builds. You add a few lines to the Cargo.toml file to guide the bundling process, but don't have to write all the XML stuff Windows installers want. Write once, run everywhere. (Cross-compiling GUI programs to Windows works surprisingly well. Here's my demo.

All that's needed is install, uninstall, and maybe upgrade/reinstall. More than that on Windows and you probably need Windows-specific tooling.

Ref: burtonageo/cargo-bundle#116

@scottwillmoore
Copy link
Contributor Author

I have done a bit of research into other Rust projects and cargo-wix, or just the WiX toolset does seem pretty popular choice to bundle for Windows (often with winget as the primary motivation). Below is a list of popular Rust projects that do choose to use WiX.

https://github.com/alacritty/alacritty
https://github.com/extrawurst/gitui
https://github.com/lapce/lapce
https://github.com/nushell/nushell
https://github.com/starship/starship
https://github.com/volta-cli/volta

@scottwillmoore
Copy link
Contributor Author

I have had a look into this tonight, and with cargo-wix, and I've managed to build a Windows MSI installer, which will: Install the Neovide executable, add it to the system path, create a shortcut on the desktop and in the start menu. In addition, I have amended the GitHub actions, so it should automatically build the MSI and upload it, but still also upload the the original executable.

You can download and try the MSI: https://github.com/scottwillmoore/neovide/actions/runs/3113998046.

Would the contributors be interested in merging this in? I'll double check I am happy with everything over the weekend, maybe squash my commits and then submit it as a pull request.

@MultisampledNight
Copy link
Contributor

As long as someone can confirm this to be working on their setup, yeah, definitely! Thanks for your work!

By the way, no need to squash your commits. We squash them when merging anyways, and not squashing in the PR allows "looking into" the actual history should it ever be relevant.

@MultisampledNight
Copy link
Contributor

(also, by the way: please do create another branch than main on your fork for the PR, makes testing less messy <3)

@scottwillmoore
Copy link
Contributor Author

Would it be possible to publish another release with the .msi not bundled in a .zip? I just went to create a winget package for neovide with the recently published release, however at the moment winget doesn't support installation for a .msi from within a .zip, it needs to have a direct URL to the .msi.

@sschneider-ihre-pvs
Copy link

sschneider-ihre-pvs commented Jun 29, 2023

Would it be possible to make the MSI not require elevated rights to make a user installation possible?
msiexec.exe /i neovide.msi INSTALLDIR=%USERPROFILE% MSIINSTALLPERUSER=1 ALLUSERS=2

@fredizzimo
Copy link
Member

@scottwillmoore, the 0.11.0 release does not zip the MSI anymore.

@scottwillmoore
Copy link
Contributor Author

@sschneider-ihre-pvs: I'm not sure, but you could check out the Wix configuration and you may be able to adjust it such that user installation does work.

@fredizzimo: I think an update to winget in the end actually did allow the zipped MSI to work. You can see in the PR and the package manifest that it looks like @sarvex got it to work. A new PR should be opened to both update the winget manifest to the latest version and use the unzipped MSI.

At the moment I don't use Neovim or Neovide 😢, so I'll defer these issues to other users in the community.

@fredizzimo
Copy link
Member

I added some comments on the package PR on the winget github microsoft/winget-pkgs#96805. On Neovide's side we need fix the runtimes https://volks73.github.io/cargo-wix/cargo_wix/index.html#c-runtime

@fredizzimo fredizzimo added the good first issue Good for newcomers label Aug 11, 2023
@scottwillmoore
Copy link
Contributor Author

Just want to point out that there are two PRs in the winget repository, where it looks like the latter was merged?

@Kethku Kethku added the hacktoberfest Good options for hactoberfest contributions. Not exclusive label Oct 5, 2023
@fredizzimo fredizzimo removed the hacktoberfest Good options for hactoberfest contributions. Not exclusive label Nov 1, 2023
@fredizzimo
Copy link
Member

The package has not been updated since it was merged in 0.10.4. What should we do?

  1. Can you @sarvex continue maintaining it Neovide.Neovide version 0.10.4 microsoft/winget-pkgs#102447
  2. Should we maintainers add that as a step to the release process
  3. Should we take the package down
  4. Should we find some other maintainer

@sarvex
Copy link

sarvex commented Feb 1, 2024

Sure, @fredizzimo I can do maintain the same

@fredizzimo
Copy link
Member

Thank you @sarvex.

I recommend that watch the release notifications https://github.blog/changelog/2018-11-27-watch-releases/, so that you don't miss them. I assume you will have to make a new PR to winget for each new release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants