Skip to content

Custom Installations

Atiq Rahman edited this page Nov 9, 2021 · 20 revisions

Non chocolatey based installations are discussed here.

Powershell

instruction to deploy powershell

  • First, invoke legacy powershell since we are updating to a pwsh 6 or later version (elevation is not required),
Start-Process powershell -ArgumentList '-NoExit', '-NoLogo', 'Init-App.ps1 admin' -ErrorAction 'Stop'
  • Then, we deploy/upgrade,
Invoke-WebRequest https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.ps1 -OutFile Install-Powershell.ps1
.\Install-Powershell -Destination D:\PFiles_x64\choco\pwsh
Remove-Item Install-Powershell.ps1

UseMSI does not support custom destination,

.\Install-Powershell -UseMSI -Destination D:\PFiles_x64\choco\pwsh

throws error: Parameter set cannot be resolved using the specified named parameters

If we have we can definitely add those package params under $MSIArguments so that custom path gets added.

} elseif ($UseMSI) {
    if($MSIArguments) {
        Start-Process $packagePath -ArgumentList $MSIArguments -Wait
... ... ...

refs

dotcore-sdk ref

Invoke-WebRequest https://raw.githubusercontent.com/dotnet/install-scripts/master/src/dotnet-install.ps1 -OutFile dotnet-install.ps1
dotnet-install -Channel LTS -InstallDir D:\PFiles_x64\choco\dotnet -NoPath
Remove-Item dotnet-install.ps1

Win32-OpenSSH

Set $GITHUB_TOKEN then apply,

Install\OpenSSH.ps1

If we want to install in system32 we can utilize following code,


# Install in Sys32 like the system's openssh (windows capability)
$destDir = 'D:\Soft\openssh'

# Overwrite windows installed bins
$openSshBins = (Get-ChildItem 'C:\WINDOWS\System32\OpenSSH\').Name
Expand-Archive -Path "$destDir\OpenSSH-Win64.zip" -DestinationPath $destDir
takeown.exe /a /r /f C:\Windows\System32\OpenSSH\
icacls.exe 'C:\Windows\System32\OpenSSH' /grant 'BUILTIN\Administrators:(OI)(CI)F'
icacls.exe 'C:\Windows\System32\OpenSSH' /grant 'BUILTIN\Administrators:F' /t
Stop-Service ssh-agent
$openSshBins | ForEach-Object { Copy-Item -Path "$destDir\OpenSSH-Win64\$_" -Destination C:\Windows\System32\OpenSSH\ }
Start-Service ssh-agent
Clone this wiki locally