Skip to content

Automatic Discord install folder detection #198

@Speshkitty

Description

@Speshkitty

A short snippet that detects the highest version number in %LOCALAPPDATA%/Discord and stores it in a variable

for /f "usebackq delims=" %%i in (`
  powershell -c "ls -Name -Path "%LOCALAPPDATA%/Discord" -Filter app-* | sort { [version]($_.Name -replace '^.*-(\d+(\.\d+){1,3})$', '$1') } -Descending | select -Index 0;"
`) do set folder=%%i

This uses System.Version for comparison, so should avoid any weird sorting issues.

I'm not sure what the best way to work that into the existing install script is, which is why this is an issue and not a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions