Skip to content

Commit

Permalink
(doc) Upgrade Offline Install Steps
Browse files Browse the repository at this point in the history
  • Loading branch information
JPRuskin committed Jul 19, 2024
1 parent b2a4fb3 commit 2392565
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
21 changes: 20 additions & 1 deletion OfflineInstallPreparation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,26 @@ param(
}
$true
})]
[string]$LicensePath = "C:\ProgramData\chocolatey\license\chocolatey.license.xml",
[string]$LicensePath = $(
if (Test-Path $PSScriptRoot\files\chocolatey.license.xml) {
# Offline setup has been run, we should use that license.
Join-Path $PSScriptRoot "files\chocolatey.license.xml"
} elseif (Test-Path $env:ChocolateyInstall\license\chocolatey.license.xml) {
# Chocolatey is already installed, we can use that license.
Join-Path $env:ChocolateyInstall "license\chocolatey.license.xml"
} else {
# Prompt the user for the license.
$Wshell = New-Object -ComObject Wscript.Shell
$null = $Wshell.Popup('You will need to provide the license file location. Please select your Chocolatey License in the next file dialog.')
$null = [System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms")
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog
$OpenFileDialog.initialDirectory = "$env:USERPROFILE\Downloads"
$OpenFileDialog.filter = 'All Files (*.*)| *.*'
$null = $OpenFileDialog.ShowDialog()

$OpenFileDialog.filename
}
),

[string]$WorkingDirectory = $(Join-Path $env:Temp "choco-offline")
)
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ Below are the minimum requirements for setting up your C4B server via this guide
> :warning:**DISCLAIMER**: This guide utilizes code from a GitHub repository, namely: [choco-quickstart-scripts](https://github.com/chocolatey/choco-quickstart-scripts). Though we explain what each script does in drop-down boxes, please do your due diligence to review this code and ensure it meets your Organizational requirements.
> :memo:**Offline Install**: If your C4B server does not have unrestricted access to the internet, you can download the `choco-quickstart-scripts` repository to a Windows machine that is connected to the internet and run `OfflineInstallPreparation.ps1`. This will use Chocolatey to save all of the required assets into the repository folder, which can then be transferred to the target C4B server.
> - Download [choco-quickstart-scripts by clicking here](https://github.com/chocolatey/choco-quickstart-scripts/archive/refs/heads/main.zip).
> - Unzip it, e.g.: `Expand-Archive -Path ~\Downloads\choco-quickstart-scripts-main.zip -DestinationPath ~\Downloads\choco-quickstart-scripts`.
> - Run the OfflineInstallPreparation script, e.g.: `~\Downloads\choco-quickstart-scripts\choco-quickstart-scripts-main\OfflineInstallPreparation.ps1`.
> - Run the following to zip up your offline bundle: `Compress-Archive -Path ~\Downloads\choco-quickstart-scripts\choco-quickstart-scripts-main\* -DestinationPath ~\Downloads\C4B-Files.zip`.
> - Transfer the `C4B-Files.zip` from your downloads folder to your offline system. All further steps will be carried out on the offline system.
> - Run `Expand-Archive -Path \path\to\C4B-Files.zip -DestinationPath C:\choco-setup\files -Force` on your offline system.
> - Run `Set-Location "$env:SystemDrive\choco-setup\files"; Set-ExecutionPolicy Bypass Process; .\Start-C4bSetup.ps1` on your offline system.
> - Proceed to Step 2!
### Step 1: Begin C4B Setup

Expand Down

0 comments on commit 2392565

Please sign in to comment.