Skip to content

Commit d69eb92

Browse files
authored
Merge pull request #1277 from microsoft/remove-alias-logic
Remove WSL2_EXECUTION_ALIAS_PATH since the installation path is always the same as the execution path since WSL 2.0.0
2 parents 35926f4 + e955b08 commit d69eb92

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

WSLGd/main.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ constexpr auto c_sharedMemoryMountPoint = "/mnt/shared_memory";
3131
constexpr auto c_sharedMemoryMountPointEnv = "WSL2_SHARED_MEMORY_MOUNT_POINT";
3232
constexpr auto c_sharedMemoryObDirectoryPathEnv = "WSL2_SHARED_MEMORY_OB_DIRECTORY";
3333

34-
constexpr auto c_executionAliasPathEnv = "WSL2_EXECUTION_ALIAS_PATH";
3534
constexpr auto c_installPathEnv = "WSL2_INSTALL_PATH";
3635
constexpr auto c_userProfileEnv = "WSL2_USER_PROFILE";
3736
constexpr auto c_systemDistroEnvSection = "system-distro-env";
@@ -271,12 +270,6 @@ try {
271270
wslInstallPath = installPath;
272271
}
273272

274-
std::string wslExecutionAliasPath;
275-
auto executionAliasPath = getenv(c_executionAliasPathEnv);
276-
if (executionAliasPath) {
277-
wslExecutionAliasPath = executionAliasPath;
278-
}
279-
280273
// Bind mount the versions.txt file which contains version numbers of the various WSLG pieces.
281274
{
282275
wil::unique_fd fd(open(c_versionMount, (O_RDWR | O_CREAT), (S_IRUSR | S_IRGRP | S_IROTH)));
@@ -461,8 +454,8 @@ try {
461454

462455
std::filesystem::path rdpClientExePath;
463456
bool isUseMstsc = GetEnvBool("WSLG_USE_MSTSC", false);
464-
if (!isUseMstsc && !wslExecutionAliasPath.empty()) {
465-
std::filesystem::path msrdcExePath = TranslateWindowsPath(wslExecutionAliasPath.c_str());
457+
if (!isUseMstsc && !wslInstallPath.empty()) {
458+
std::filesystem::path msrdcExePath = TranslateWindowsPath(wslInstallPath.c_str());
466459
msrdcExePath /= MSRDC_EXE;
467460
if (access(msrdcExePath.c_str(), X_OK) == 0) {
468461
rdpClientExePath = std::move(msrdcExePath);

0 commit comments

Comments
 (0)