From 6d23f5a0d34ee597722a377e05130f54ea09756e Mon Sep 17 00:00:00 2001 From: Anjan Nath Date: Mon, 25 Sep 2023 11:26:06 +0530 Subject: [PATCH] preflight: always use crc.exe abs path with small case drive letter in the hidden_daemon.ps1 script always use the path of crc.exe with small case drive letter, this should fix any path missmatch that might happen when crc is invoked from some other program as seen with the extension issue #175 --- pkg/crc/preflight/preflight_daemon_task_check_windows.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/crc/preflight/preflight_daemon_task_check_windows.go b/pkg/crc/preflight/preflight_daemon_task_check_windows.go index 5424bc55c9..12b2853c43 100644 --- a/pkg/crc/preflight/preflight_daemon_task_check_windows.go +++ b/pkg/crc/preflight/preflight_daemon_task_check_windows.go @@ -211,8 +211,10 @@ func getDaemonPoshScriptContent() []byte { if err != nil { return []byte{} } + drive := filepath.VolumeName(binPath) + binPathWithSmallCaseDriveLetter := strings.Replace(binPath, drive, strings.ToLower(drive), 1) daemonCmdArgs := `daemon --log-level debug` - return []byte(fmt.Sprintf(daemonPoshScriptTemplate, binPath, daemonCmdArgs)) + return []byte(fmt.Sprintf(daemonPoshScriptTemplate, binPathWithSmallCaseDriveLetter, daemonCmdArgs)) } func checkDaemonPoshScript() error {