From c46729f89ed1147bf05de99b0fc1a869932198d8 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sat, 21 Sep 2019 19:19:58 -0400 Subject: [PATCH] Simpler LINUXTMP compatible with non-/mnt roots Sometimes the C drive is not mounted at /mnt https://docs.microsoft.com/en-us/windows/wsl/wsl-config wslpath can be used to convert reliably from Windows to Linux paths --- wsl_gui_autoinstall.bat | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wsl_gui_autoinstall.bat b/wsl_gui_autoinstall.bat index 2449505..9143ef4 100644 --- a/wsl_gui_autoinstall.bat +++ b/wsl_gui_autoinstall.bat @@ -1,7 +1,8 @@ @ECHO OFF -SET "LINUXTMP=$(echo '%TMP:\=\\%' | sed -e 's|\\|/|g' -e 's|^\([A-Za-z]\)\:/\(.*\)|/mnt/\L\1\E/\2|')" -echo LINUXTMP = "%LINUXTMP%" +set WSLENV=%WSLENV%:WINTMP +set WINTMP=%TMP% +set LINUXTMP='$(wslpath -u \"$WINTMP\")' ECHO --- Running Linux installation. You will be prompted for your Ubuntu user's password: REM One big long command to be absolutely sure we're not prompted for a password repeatedly @@ -48,4 +49,4 @@ echo load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous ECHO When prompted, DO NOT allow 'pulseaudio' access to any of your networks. It doesn't need access. ECHO All Done -PAUSE \ No newline at end of file +PAUSE