diff --git a/README.md b/README.md index 87be53d..ac8eb3c 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,22 @@ irm https://codefloe.com/Jonas8272/scoop-bucket/raw/branch/master/installations/ > **Note:** This one is installed through winget. Edge is already built into Windows, so this usually just reports that it is installed. Edge updates itself, not `scoop update`. +## Installing mica-for-everyone + +[Mica For Everyone](https://github.com/MicaForEveryone/MicaForEveryone): applies Mica and other backdrop effects to the title bars and backgrounds of Win32 apps on Windows 11. + +```powershell +scoop install Jonas8272/mica-for-everyone +``` + +Or set up everything and install it with one script: + +```powershell +irm https://codefloe.com/Jonas8272/scoop-bucket/raw/branch/master/installations/install-mica-for-everyone.ps1 | iex +``` + +> **Note:** This one is installed from the Microsoft Store through winget (the project's official Store listing). The Store updates it, not `scoop update`. It needs Windows 11. + ## Installing vmware-workstation-pro VMware Workstation Pro: run virtual machines on Windows. @@ -259,4 +275,4 @@ scoop bucket rm Jonas8272 ## License -See the repository for licensing information. \ No newline at end of file +See the repository for licensing information. diff --git a/bucket/mica-for-everyone.json b/bucket/mica-for-everyone.json new file mode 100644 index 0000000..bc666f7 --- /dev/null +++ b/bucket/mica-for-everyone.json @@ -0,0 +1,14 @@ +{ + "version": "1.0", + "description": "Mica For Everyone: applies Mica and other backdrop effects to the title bars and backgrounds of Win32 apps on Windows 11 (installed from the Microsoft Store via winget)", + "homepage": "https://github.com/MicaForEveryone/MicaForEveryone", + "license": "MIT", + "notes": "Needs Windows 11. The Microsoft Store updates this app, not 'scoop update'.", + "url": "https://jonas8272.codeberg.page/blank/#/blank.html", + "installer": { + "script": "winget install --id 9P8V68P4Z78P --source msstore --accept-package-agreements --accept-source-agreements" + }, + "uninstaller": { + "script": "winget uninstall --id 9P8V68P4Z78P --source msstore" + } +} diff --git a/installations/install-mica-for-everyone.ps1 b/installations/install-mica-for-everyone.ps1 new file mode 100644 index 0000000..04cca65 --- /dev/null +++ b/installations/install-mica-for-everyone.ps1 @@ -0,0 +1,98 @@ +<# +.SYNOPSIS + Installs Mica For Everyone from the Jonas8272 bucket. Sets up Scoop, git and + the bucket first if they are missing. + +.DESCRIPTION + Mica For Everyone is installed from the Microsoft Store through winget, so + winget must be available (it ships with current Windows 10 and 11 as App + Installer). The app itself needs Windows 11. The Store updates it, not + "scoop update". + +.EXAMPLE + irm https://codefloe.com/Jonas8272/scoop-bucket/raw/branch/master/installations/install-mica-for-everyone.ps1 | iex + +.NOTES + Run in a normal (non-admin) PowerShell window if Scoop is not installed yet. +#> + +$ErrorActionPreference = 'Stop' + +$App = 'mica-for-everyone' +$BucketName = 'Jonas8272' +$BucketUrl = 'https://codefloe.com/Jonas8272/scoop-bucket' + +function Test-Command($name) { + return [bool](Get-Command $name -ErrorAction SilentlyContinue) +} + +function Test-Admin { + $id = [Security.Principal.WindowsIdentity]::GetCurrent() + $principal = New-Object Security.Principal.WindowsPrincipal($id) + return $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) +} + +$scoopRoot = if ($env:SCOOP) { $env:SCOOP } else { Join-Path $env:USERPROFILE 'scoop' } + +# 0. winget (the app comes from the Microsoft Store) -------------------------- +if (-not (Test-Command 'winget')) { + throw 'winget was not found. Install "App Installer" from the Microsoft Store, then run this script again.' +} + +if ([Environment]::OSVersion.Version.Build -lt 22000) { + Write-Warning 'Mica For Everyone is made for Windows 11. It may not install or do anything on Windows 10.' +} + +# 1. Scoop ------------------------------------------------------------------- +if (-not (Test-Command 'scoop')) { + Write-Host 'Scoop not found. Installing Scoop...' -ForegroundColor Cyan + Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force + if (Test-Admin) { + Invoke-Expression "& {$(Invoke-RestMethod -Uri 'https://get.scoop.sh')} -RunAsAdmin" + } else { + Invoke-RestMethod -Uri 'https://get.scoop.sh' | Invoke-Expression + } + + # Make scoop available in this session without reopening PowerShell + $env:PATH = "$scoopRoot\shims;$env:PATH" + + if (-not (Test-Command 'scoop')) { + throw 'Scoop was installed but is not on PATH. Open a new PowerShell window and run this script again.' + } +} else { + Write-Host 'Scoop is already installed.' -ForegroundColor Green +} + +# 2. git (needed to add buckets) ---------------------------------------------- +if (-not (Test-Command 'git')) { + Write-Host 'git not found. Installing git through Scoop...' -ForegroundColor Cyan + scoop install git + if ($LASTEXITCODE -ne 0) { throw 'Failed to install git through Scoop.' } + $env:PATH = "$scoopRoot\shims;$env:PATH" +} else { + Write-Host 'git is already installed.' -ForegroundColor Green +} + +# 3. Bucket ------------------------------------------------------------------ +$existing = scoop bucket list | Where-Object { + $_.Name -eq $BucketName -or $_.Source -like '*Jonas8272/scoop-bucket*' +} | Select-Object -First 1 + +if ($existing) { + $BucketName = $existing.Name + Write-Host "Bucket '$BucketName' is already added. Updating it..." -ForegroundColor Green + scoop update +} else { + Write-Host "Adding bucket '$BucketName'..." -ForegroundColor Cyan + scoop bucket add $BucketName $BucketUrl + if ($LASTEXITCODE -ne 0) { throw "Failed to add bucket '$BucketName'." } +} + +# 4. The app ----------------------------------------------------------------- +Write-Host '' +Write-Host "Installing $App..." -ForegroundColor Cyan +scoop install "$BucketName/$App" +if ($LASTEXITCODE -ne 0) { throw "Failed to install $App." } + +Write-Host '' +Write-Host "Done. $App is installed." -ForegroundColor Green