cloudflare / cloudflare/cloudflared

🐛Windows System Path Environment Entry is Incorrectly Including a Dot at the End

Open
#1,049 0 comments 0 reactions 0 assignees View on GitHub
Priority: Normal Type: Bug
Dominant language
Go
Stars
15.6k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
On Windows, running the .msi installer from the GitHub page will make a path entry in the system environment variables. This entry includes a "." at the end of the path. This is incorrect for Windows. The path should end with the final backslash (\) or no slash at all. It should not end in a dot (.) or period.

Why is this a problem?

If I'm using PowerShell to manage my installation of cloudflared, I would like to be able to use the path variable to find the executable and manage it. For example, `(Get-Command cloudflared.exe).Path` will return `C:\Program Files (x86)\cloudflared\.\cloudflared.exe`. In PowerShell, I cannot now inspect the executable with this returned path and I cannot execute the executable. Removing the "." from the Path environment variable entry will resolve this problem.

**To Reproduce**
Steps to reproduce the behavior:
1. On a fresh installation of Windows, or a properly cleaned version without a path, print the current path with `[System.Environment]::GetEnvironmentVariable("Path","Machine") -split ";"`
2. Note no entries for cloudflared
3. Run the latest installation (2023.7.3) of cloudflared.
4. print the current path with `[System.Environment]::GetEnvironmentVariable("Path","Machine") -split ";"`
5. Note the new entry for cloudflared includes a dot (.)

**Expected behavior**
A Path environment entry that does not include a dot (.)

**Environment and versions**
- OS: Windows (tested on Windows Server 2016, Windows 10, and Windows 11, all 64-bit)
- Architecture: Intel 64-bit
- Version: 2023.7.2 and many previous versions

**Additional context**
This is a screenshot of a console window demonstration
![WindowsTerminal_SblGsEDZXu](https://github.com/cloudflare/cloudflared/assets/38893324/1cf0f638-15d8-4ef9-b92b-fbeb189daa97)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.