Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit 556225d

Browse files
author
Ben Hillis
authored
Change WSL to use system error string for WSL OC not present (#117)
1 parent 19eeb24 commit 556225d

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

DistroLauncher/DistroLauncher.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ int wmain(int argc, wchar_t const *argv[])
8686
// Ensure that the Windows Subsystem for Linux optional component is installed.
8787
DWORD exitCode = 1;
8888
if (!g_wslApi.WslIsOptionalComponentInstalled()) {
89-
Helpers::PrintMessage(MSG_MISSING_OPTIONAL_COMPONENT);
89+
Helpers::PrintErrorMessage(HRESULT_FROM_WIN32(ERROR_LINUX_SUBSYSTEM_NOT_PRESENT));
9090
if (arguments.empty()) {
9191
Helpers::PromptForInput();
9292
}
@@ -156,10 +156,7 @@ int wmain(int argc, wchar_t const *argv[])
156156

157157
// If an error was encountered, print an error message.
158158
if (FAILED(hr)) {
159-
if (hr == HRESULT_FROM_WIN32(ERROR_LINUX_SUBSYSTEM_NOT_PRESENT)) {
160-
Helpers::PrintMessage(MSG_MISSING_OPTIONAL_COMPONENT);
161-
162-
} else if (hr == HCS_E_HYPERV_NOT_INSTALLED) {
159+
if (hr == HCS_E_HYPERV_NOT_INSTALLED) {
163160
Helpers::PrintMessage(MSG_ENABLE_VIRTUALIZATION);
164161

165162
} else {

DistroLauncher/messages.mc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ Language=English
7878
Press any key to continue...
7979
.
8080
81-
MessageId=1012 SymbolicName=MSG_MISSING_OPTIONAL_COMPONENT
82-
Language=English
83-
The Windows Subsystem for Linux optional component is not enabled. Please enable it and try again.
84-
See https://aka.ms/wslinstall for details.
85-
.
86-
8781
MessageId=1013 SymbolicName=MSG_INSTALL_ALREADY_EXISTS
8882
Language=English
8983
The distribution installation has become corrupted.

0 commit comments

Comments
 (0)