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

fix: disable console window for Windows GUI application #101

Merged
merged 2 commits into from
Jun 14, 2024

Conversation

nekrondev
Copy link
Contributor

Rust 1.18.0 added support for windows GUI application preventing to open a console window when the application is started.

Rust 1.18.0 added support for windows GUI application preventing to open a console window when the application is started.
@nekrondev
Copy link
Contributor Author

A side note on this: I cross-compiled Packetry on Linux using a build container provided by https://github.com/MGlolenstine/gtk4-cross. You need to copy some of the cross compilation environment mingw DLLs to your Windows host but afterwards Packetry is running ok (I couldn't yet test with Cynthion so detecting the device using winusb is unknown to me). The build process could be eventually automated to provide an archive including GTK DLLs and Packetry executable for easier use on Windows machines.

It looks like this using the standard GTK4 settings provided by the cross compilation environment:

image

@martinling
Copy link
Member

Thanks for the PR, I hadn't realised this was an issue. I've been testing on Windows, but was always launching the app from the command line, so I didn't notice it would open a console window otherwise.

That cross compilation environment looks useful, but I'd rather avoid that approach in general; we'd like Windows users to be able to contribute to the project easily too, so we want the project to be easy to build on Windows.

I've been doing native builds with MSVC, after getting the dependencies from vcpkg, and just setting a couple of environment variables for the pkg-config stuff.

It took a bit of work to get that working in GitHub Actions (see #83), but the difficulties there were purely on the CI side.

@nekrondev
Copy link
Contributor Author

Ah sorry, I didn't see your PR adding Windows build target, but I agree doing a CI-based native compilation is more useful for developers working on Windows OS. X-compilation also results a bigger executable compared to the native build artifacts found here. Just in case someone wants to create a Windows binary on Linux the docker build container is working fine and took only like 10 minutes to cross compile the whole thing.

@martinling
Copy link
Member

The CI failures you're getting here aren't your fault - if you rebase on main now they should go away.

@miek miek merged commit cb981c6 into greatscottgadgets:main Jun 14, 2024
8 checks passed
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.

3 participants