Skip to content

Commit 1227e29

Browse files
authored
Merge pull request #25 from aslamcodes/chore/installation-instruction
chore: add install.ps1 script for windows install
2 parents 0dab0ae + 1c2eb4f commit 1227e29

2 files changed

Lines changed: 46 additions & 4 deletions

File tree

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,19 @@ AWS AppStream provides a CLI, but it only handles high-level image operations li
2020
3. S3 and Git backend support
2121
4. State persistence within image builders
2222

23-
# Usage
24-
Use **local** backend source when the config file is within image builders. S3, Git Support is WIP
25-
```sh
26-
appstreamfile -source local -location config.yaml
23+
# Installation
24+
## Windows Installation
25+
26+
You can install and run **AppStreamFile** without cloning the repository.
27+
The script detects your system architecture and downloads the correct binary automatically.
28+
29+
```powershell
30+
iwr https://raw.githubusercontent.com/aslamcodes/appstreamfile/main/scripts/install.ps1 | iex
2731
```
2832

33+
## Linux
34+
***Supported in future releases***
35+
2936
# Sample config
3037
```yaml
3138
platform: "windows"

win_install.ps1

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# --- AppStreamFile runtime downloader for Windows ---
2+
3+
$repo = "aslamcodes/appstreamfile"
4+
$version = "v0.1.0"
5+
$baseUrl = "https://github.com/$repo/releases/download/$version"
6+
$dir = "$env:TEMP\appstreamfile"
7+
8+
if (!(Test-Path $dir)) { New-Item -ItemType Directory -Path $dir | Out-Null }
9+
10+
# Detect architecture from Windows environment
11+
$pa = $env:PROCESSOR_ARCHITECTURE
12+
$arch = switch ($pa) {
13+
"AMD64" { "x86_64" }
14+
"x86" { "i386" }
15+
"ARM64" { "arm64" }
16+
default { throw "Unsupported architecture: $pa" }
17+
}
18+
19+
$file = "appstreamfile_Windows_$arch.zip"
20+
$url = "$baseUrl/$file"
21+
22+
Write-Host "Downloading $file..."
23+
$zipPath = Join-Path $dir $file
24+
Invoke-WebRequest -Uri $url -OutFile $zipPath
25+
26+
Write-Host "Extracting..."
27+
Expand-Archive -Path $zipPath -DestinationPath $dir -Force
28+
Remove-Item $zipPath
29+
30+
$exe = Join-Path $dir "appstreamfile.exe"
31+
if (!(Test-Path $exe)) { throw "Binary not found after extraction" }
32+
33+
Write-Host "Binary ready at: $exe"
34+
Write-Host "Running --help"
35+
& $exe --help

0 commit comments

Comments
 (0)