Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Install Script Doesn't Work #26

Open
joe-camp-nelnet opened this issue Apr 30, 2024 · 0 comments
Open

Windows Install Script Doesn't Work #26

joe-camp-nelnet opened this issue Apr 30, 2024 · 0 comments

Comments

@joe-camp-nelnet
Copy link

The Komodor UI provides instructions on how to use port forwarding using the Komodor CLI:

However, there are several issues with your windows / powershell install script. It fails to run on powershell core on windows.

https://github.com/komodorio/komocli/blob/main/scripts/install.ps1

  1. The script is written to detect the operating system, but I presume this PowerShell script is really only intended for windows-based installation. The script could be simplified for that use case, unless you intend it to be usable for people running PowerShell on Linux. But for Linux users I'd assume the bash install script is preferable.

  2. The Get-Arch function depends on the Get-WmiObject function which is only available in "PowerShell for Windows" and not in the PowerShell Core. Even if the script is intended only for windows installations, it should be assumed that developers are likely using the latest version of PowerShell Core. The Get-Arch function could be updated as follows:

function Get-Arch {
    $systemType = (Get-CimInstance -ClassName CIM_ComputerSystem).SystemType
    if ($systemType -match 'x64') {
        "amd64"
    }
    elseif ($systemType -match 'ARM') {
        "arm64"
    }
    elseif ($systemType -match 'x86') {
        "386"
    }
}
  1. The script downloads the windows_amd64.exe asset but then saves it as a .tar.gz file. The file should be saved as an .exe file. It does not need to be extracted from an archive. The script also assumes it can extract the file using tar which is not common on windows, but that is irrelevant, and that dependency should not be needed since the file downloaded is the raw executable.

  2. The script stores the file in $env:APPDATA but it seems like it would be more typical to store it in a sub-folder beneath that location at least.

  3. The script does not add the file location to the PATH. For completeness, either update the path or provide instructions to users that they'd need to edit their path themselves in order to use the tool from the terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant