diff --git a/.resources/.scripts/install-docker-mac.ps1 b/.resources/.scripts/install-docker-mac.ps1 index c20198c..841361b 100644 --- a/.resources/.scripts/install-docker-mac.ps1 +++ b/.resources/.scripts/install-docker-mac.ps1 @@ -1,6 +1,6 @@ # if a flag is provided it will install Docker for mac with intelCPU param( - [Parameter(Mandatory)][string]$filePath, + [Parameter(Mandatory)][string]$filesPath, [switch]$IntelCPU ) $cpu = "" @@ -8,16 +8,16 @@ Write-Host "Downloading Docker setup files, please wait... " if ($IntelCPU) { $cpu = "Intel" $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest https://desktop.docker.com/mac/main/amd64/Docker.dmg -o "$filePath/Docker.dmg"; + Invoke-WebRequest https://desktop.docker.com/mac/main/amd64/Docker.dmg -o "$filesPath/Docker.dmg"; $ProgressPreference = 'Continue' }else { $cpu = "Apple silicon arm" $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest https://desktop.docker.com/mac/main/arm64/Docker.dmg -o "$filePath/Docker.dmg"; + Invoke-WebRequest https://desktop.docker.com/mac/main/arm64/Docker.dmg -o "$filesPath/Docker.dmg"; $ProgressPreference = 'Continue' } Write-Output "Installing Docker for $cpu CPU, please wait..." -sudo hdiutil attach "$filePath/Docker.dmg" +sudo hdiutil attach "$filesPath/Docker.dmg" sudo /Volumes/Docker/Docker.app/Contents/MacOS/install --accept-license sudo hdiutil detach /Volumes/Docker open /Applications/Docker.app \ No newline at end of file diff --git a/.resources/.scripts/install-docker-win.ps1 b/.resources/.scripts/install-docker-win.ps1 index 1b78d59..87fdc22 100644 --- a/.resources/.scripts/install-docker-win.ps1 +++ b/.resources/.scripts/install-docker-win.ps1 @@ -1,15 +1,14 @@ -set-executionpolicy -scope CurrentUser -executionPolicy Bypass -Force +param( + [Parameter(Mandatory)][string]$filesPath + ) If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { # Relaunch as an elevated process: Start-Process powershell.exe "-File", ('"{0}"' -f $MyInvocation.MyCommand.Path) -Verb RunAs exit } -$RESOURCES_DIR = (get-item $PWD ).parent.FullName -$SCRIPTS_DIR = "$RESOURCES_DIR\.scripts" -$FILES_DIR = "$RESOURCES_DIR\.files" - function installDoker { + Write-Host $filesPath Write-Host "Downloading Docker setup files, please wait... " $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri https://desktop.docker.com/win/stable/Docker%20Desktop%20Installer.exe -OutFile DockerInstaller.exe @@ -18,7 +17,7 @@ function installDoker { Write-Output "Installing Docker please wait..." start-process .\DockerInstaller.exe -Wait -NoNewWindow -ArgumentList "install --accept-license --quiet" - Copy-Item "$FILES_DIR\docker-default-settings.json" -Destination "$env:AppData\Docker\settings.json" + Copy-Item "$filesPath\docker-default-settings.json" -Destination "$env:AppData\Docker\settings.json" Write-Output "Docker Installed successfully" Read-Host "You must reboot the sytem to continue. After reboot re-run the script and proceed with the next steps (e.g. .env setup and start stack)" Restart-Computer -Confirm @@ -52,7 +51,7 @@ if ($wsl.State -eq "Enabled") { installDoker } else { - Write-Output 'Docker installation/repair canceled.' + Write-Output 'Docker installation/repair canceled.' Write-Output 'If docker was already correctly installed on your system you should be able to proceed with the next steps anyway' } } diff --git a/runme.ps1 b/runme.ps1 index 671e02a..b365c28 100644 --- a/runme.ps1 +++ b/runme.ps1 @@ -22,7 +22,7 @@ $DKCOM_SRC = "https://github.com/MRColorR/money4band/raw/main/$DKCOM_FILENAME" $DKINST_WIN_SRC = 'https://github.com/MRColorR/money4band/raw/main/.resources/.scripts/install-docker-win.ps1' ### Docker installer script for Mac source link ## -$DKINST_MAC_SRC = 'https://github.com/MRColorR/money4band/raw/dev/.resources/.scripts/install-docker-mac.ps1' +$DKINST_MAC_SRC = 'https://github.com/MRColorR/money4band/raw/main/.resources/.scripts/install-docker-mac.ps1' ### Resources, Scripts and Files folders @@ -85,8 +85,8 @@ function fn_dockerInstall { Clear-Host Write-Output "Starting Docker for Windows auto installation script" Invoke-WebRequest $DKINST_WIN_SRC -o "$SCRIPTS_DIR\install-docker-win.ps1" - Start-Process PowerShell -Verb RunAs "-noprofile -executionpolicy bypass -command `"$SCRIPTS_DIR\install-docker-win.ps1`"" -Wait - $InstallStatus = 1; + Start-Process PowerShell -Verb RunAs "-noprofile -executionpolicy bypass -command `"$SCRIPTS_DIR\install-docker-win.ps1 -filesPath $FILES_DIR`"" -Wait + $InstallStatus = 1; } 3 { Clear-Host @@ -98,11 +98,11 @@ function fn_dockerInstall { $cpuSel = Read-Host switch ($cpuSel) { 1 { - Start-Process PowerShell -Verb RunAs "-noprofile -executionpolicy bypass -command `"$SCRIPTS_DIR\install-docker-mac.ps1 -filePath $FILES_DIR`"" -Wait + Start-Process PowerShell -Verb RunAs "-noprofile -executionpolicy bypass -command `"$SCRIPTS_DIR\install-docker-mac.ps1 -filesPath $FILES_DIR`"" -Wait $InstallStatus = 1; } 2 { - Start-Process PowerShell -Verb RunAs "-noprofile -executionpolicy bypass -command `"$SCRIPTS_DIR\install-docker-mac.ps1 -filePath $FILES_DIR -IntelCPU `"" -Wait + Start-Process PowerShell -Verb RunAs "-noprofile -executionpolicy bypass -command `"$SCRIPTS_DIR\install-docker-mac.ps1 -filesPath $FILES_DIR -IntelCPU `"" -Wait $InstallStatus = 1; } Default { fn_unknown "$cpuSel"}