Delete /etc/resolv.conf from installed WSL distro before launch

This commit is contained in:
difegue 2020-04-19 21:30:06 +02:00
parent 66a4c205ab
commit 2360eb7c62

View File

@ -122,7 +122,10 @@ namespace Setup
// The extra quote after the /K flag is needed.
// "If command starts with a quote, the first and last quote chars in command will be removed, whether /s is specified or not."
var procArgs = "/S /K \"\"" + lxRunLocation + "\\LxRunOffline.exe\" i -n lanraragi -d " + distroLocation + " -f \"" + packageLocation + "\" && pause && exit\"";
var procArgs = "/S /K \"\"" + lxRunLocation + "\\LxRunOffline.exe\" i -n lanraragi -d " + distroLocation
+ " -f \"" + packageLocation + "\" && del \"" + distroLocation +"\\etc\\resolv.conf\" && pause && exit\"";
// We delete /etc/resolv.conf here as it's a leftover from the package's origins as a Docker image.
// Deleting it in Linux would be too late as WSL already started!
session.Log("Launching cmd.exe with arguments " + procArgs);
var lxProc = new Process