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

Msi Installed program does not have color support #90

Closed
Songtronix opened this issue Oct 12, 2019 · 2 comments
Closed

Msi Installed program does not have color support #90

Songtronix opened this issue Oct 12, 2019 · 2 comments
Labels

Comments

@Songtronix
Copy link

I'm unsure about what exactly is causing that. It may be wix, cargo-wix specific or my main.wxs settings or anything really.
If I run it myself everything works fine. But if it is installed via the msi installer colors do not work (they do for spawned subprocesses for whatever reason).

OS: Windows 10
Logging crate: fern (with colored feature).

grafic

@volks73
Copy link
Owner

volks73 commented Oct 12, 2019

I wonder if this is related to a Debug versus Release profile build? The cargo-wix subcommand builds the MSI using the Release profile. When you run everything yourself, are you running the Debug profile version?

Can you try creating the MSI with the --no-build flag?

I am not familiar with fern and its coloring feature, but it is only recently that the Windows 10 command prompt started supporting ANSI terminal escape codes, and it's support for ANSI escape codes has to be explicitly turned on. There is a good discussion and information about Windows 10 color support related to the ansi_term crate. The fern crate appears to use the colored crate, which has the following (closed) issue: Colours don't work in command prompt on Windows.

I will note early versions of this subcommand did use the ansi_term crate as well, but due to issues with coloring and support for older versions of Windows 7/10, I switched to using the termcolor crate, which supports the "native" Windows command prompt coloring API, but it is a little more cumbersome to use than the other terminal coloring crates because of this support. FYI, this is the same crate used by Cargo for coloring.

Given this information, I would suspect the issue is originating outside of the cargo-wix subcommand, and it is not a bug for this project. However, it does highlight a missing feature in using a different build profile other than the Release profile. A CLI flag or option should probably be added to the default cargo-wix subcommand (create) to allow alternative build profiles, in addition to just skipping the build step before MSI compiling.

@Songtronix
Copy link
Author

Thank you for the detailed answer!
I've just tried debug and release. Both work on my machine fine without the installer.
With the installer it does not. Neither release nor debug (via --no-build).

I've tested as described in the issue to enable the virtual terminal for windows support and now it works perfectly fine! I'll try to get a fix merged in fern.

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants