chocolatey / docs

https://docs.chocolatey.org - new docs website
Apache License 2.0
161 stars 181 forks source link

Completely offline install script doesn't work #1040

Open DennisL68 opened 3 months ago

DennisL68 commented 3 months ago

What New Or Updated Would You Like To See?

The script at Completely offline install should be replaced with.

  1. Download https://community.chocolatey.org/install.ps1 to local drive
  2. Run .\install.ps1 -ChocolateyDownloadUrl <c:\downloadpath\chocolatey.x.x.x.nupkg>

Why Is It Needed?

The script at Completely offline install doesn't install Chocolatey properly and the command won't be available in any new PowerShell sessions.

pauby commented 3 months ago

The script in the docs is intended to be used to install Chocolatey CLI from a separate repository and allows multiple options. The steps you provide don't go through that.

Step 2 doesn't take into account the credentials for the repository, the compression method, the execution policy etc.

The script at Completely offline install doesn't install Chocolatey properly

What doesn't work?

the command won't be available in any new PowerShell sessions

Which command? choco?

LeaDevelop commented 1 month ago

I volunter to take care of this issue, got time next week. I set up offline installer couple of weeks ago, can follow official docs again and verify if something could be improved and compare it to the reported.

LeaDevelop commented 1 month ago

Hey @DennisL68, if could please answer on pauby's questions. Could also help out if you point out exact section of documentation that you took, where it got confusing and lead you to opening issue and proposing approach you shared.

I ran with success by following next steps (could not find any issue with install.ps1):

  1. Prerequisites are present on Windows machine:

    • PowerShell 3.0+
    • .NET Framework 4.8+
    • 7zip or you can enable windows built in option in install.ps1 file
      • set $env:chocolateyUseWindowsCompression = 'true'
  2. https://community.chocolatey.org/install.ps1 downloaded and located into your preferred directory, for this example I used C:\OfflineInstaller

  3. Downloaded latest chocolatey package and located to same directory as install.ps1

  4. In install.ps1 file I edited value for $ChocolateyDownloadUrl =

    [CmdletBinding(DefaultParameterSetName = 'Default')]
    param(
    # The URL to download Chocolatey from. This defaults to the value of
    # $env:chocolateyDownloadUrl, if it is set, and otherwise falls back to the
    # official Chocolatey community repository to download the Chocolatey package.
    # Can be used for offline installation by providing a path to a Chocolatey.nupkg.
    [Parameter(Mandatory = $false)]
    [string]
    $ChocolateyDownloadUrl = 'file:C:\OfflineInstaller\chocolatey.2.3.0.nupkg',
  5. Opened up PowerShell and ran install.ps1

    I personally wished when I was fresh to Chocolatey and had my first time preparing offline installer to find plain simple Powershell solution offline instructions as I just shared above. Instead of Puppet, I feel it's easier for onboarding flow to build up the understanding instead of skip onto configuration management. I also kind of missed out on the install.ps1 link and instead went with puppet proposed but I wasn't going to use Puppet, so I got lost in the read flow there a little. I feel if we understand the base ground first we'll also be able to switch it to installing chocolatey via configuration management but that is just me 😊 I simply made me personal note back then and use it whenever I'd need it. Am curious if it's just me or there are more who had such experience and we could use small improvement in reader flow there.

DennisL68 commented 1 month ago

@LeaDevelop

I'll have a look at it next week. We are about to reinstall that server anyway soon along with detailed instructions.

So this is something I'll need to do soon anyway 👍

LeaDevelop commented 1 month ago

@DennisL68 how did it go?

DennisL68 commented 1 month ago

Not there yet :/

We had to prioritize a big migration work first that is still under due.

github-actions[bot] commented 3 days ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue will be closed in 14 days if it continues to be inactive.