Skip to content

Windows installation instructions do not work #6901

Closed

Description

@jedevc

It doesn't look like we can specify a version to download in dagger using the instructions here: https://docs.dagger.io/quickstart/729237/cli:

$script = Invoke-WebRequest -UseBasicParsing -Uri https://dl.dagger.io/dagger/install.ps1
$params = "-DaggerVersion 0.9.7"
"$script $params" | Invoke-Expression

If I look at the contents at that script:

# param (
#     [Parameter(Mandatory)] $PersonalToken
# )
Clear-Host
@"

---------------------------------------------------------------------------------
Author: Alessandro Festa
Dagger Installation Utility  for Windows users
---------------------------------------------------------------------------------

"@

# Since we are already authenticated we may directly download latest version.
$name="dagger"
$base="https://dl.dagger.io"
function http_download {
    $version=Get_Version
    $version=$version -replace '[""]'
    $version=$version -replace '\n'
    $fileName="dagger_v" + $version + "_windows_amd64"
    Clear-Host
    $url = $base + "/" + $name + "/releases/" + $version + "/" + $fileName + ".zip"
    write-host $url
    Pause


    Invoke-WebRequest -Uri $url -OutFile $env:temp/$fileName.zip -ErrorAction Stop
    Expand-Archive -Path $env:temp/$fileName.zip -DestinationPath $env:HOMEPATH/dagger -Force -ErrorVariable ProcessError;
    If ($ProcessError)
    {
    Clear-Host
@"
Whoops apparently we had an issue in unzipping the file, please check
you have the right permission to do so and try to unzip manually the file.
Currently we saved Dagger at your temp folder.
"@
exit
    } else {
        Clear-Host

@"

Thank You for downloading Dagger!

-----------------------------------------------------
Dagger has been saved at <YOUR HOME FOLDER>/dagger/
Please add dagger.exe to your PATH in order to use it
----------------------------------------------------

"@
    }

}

function Get_Version {
    $response = Invoke-RestMethod 'http://releases.dagger.io/dagger/latest_version' -Method 'GET'  -Body $body -ErrorAction SilentlyContinue -ErrorVariable DownloadError
    If ($DownloadError)
    {
    Clear-Host
@"

---------------------------------------------------------------------------
Houston we have a problem!

Apparently we had an issue in downloading the file, please try again
run the script and if it still fail please open an issue on the Dagger repo.
----------------------------------------------------------------------------

"@
exit
    }
    return $response

}

http_download

I don't see a reference to DaggerVersion anywhere, so I'm not sure how this is meant to work - it seems like we always use Get_Version.

Think this is a docs issue, but also, not sure, since this script clearly used to work.

Activity

  1. added this to the v0.11.1 milestone on Apr 8, 2024
  2. jedevc commented on Apr 8, 2024

    @jedevc
    ContributorAuthor

    Just some history:

    So the install.ps1 script on dl.dagger.io is legacy and hasn't been updated since then! We should update it, which likely involves rewriting it.

    Just a quick note though - I'm not sure how install.sh ends up deployed to dagger.io - probably worth investigating this as well.

  3. jedevc commented on Apr 8, 2024

    @jedevc
    ContributorAuthor

    Right I've worked out what happened - when #2903 was merged, the install.ps1 script on dl.dagger.io was never updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions