diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 3b10eaf7..adf26c68 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -52,6 +52,20 @@ jobs: rustup component add clippy cargo clippy --workspace --all-targets --all-features -- -D warnings cargo fmt -- --check + + - name: Compile icon/resources.res + if: ${{ matrix.platform == 'windows-latest' }} + run: | + $InstallationPath = vswhere -products * -latest -prerelease -property installationPath + pushd "$($InstallationPath)\VC\Auxiliary\Build" + cmd /c "vcvarsall.bat x64 & set" | + foreach { + if ($_ -match "=") { + $v = $_.split("=", 2); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])" + } + } + popd + .\icon\create-resources.ps1 - name: Build, get version run: | diff --git a/icon/create-resources.ps1 b/icon/create-resources.ps1 new file mode 100644 index 00000000..b120305a --- /dev/null +++ b/icon/create-resources.ps1 @@ -0,0 +1,15 @@ +$ErrorActionPreference = "Stop" + +# https://learn.microsoft.com/en-us/windows/win32/menurc/using-rc-the-rc-command-line- + +& convert $PSScriptRoot\icon.svg ` + \( -clone 0 -resize 16x16 \) ` + \( -clone 0 -resize 32x32 \) ` + \( -clone 0 -resize 48x48 \) ` + \( -clone 0 -resize 64x64 \) ` + \( -clone 0 -resize 96x96 \) ` + \( -clone 0 -resize 128x128 \) ` + \( -clone 0 -resize 256x256 \) ` + -delete 0 -alpha remove -colors 256 fend-icon.ico + +& rc /v $PSScriptRoot\resources.rc diff --git a/icon/fend-icon-128.png b/icon/fend-icon-128.png deleted file mode 100644 index 632d05a7..00000000 Binary files a/icon/fend-icon-128.png and /dev/null differ diff --git a/icon/fend-icon-150.png b/icon/fend-icon-150.png deleted file mode 100644 index 140b1f3b..00000000 Binary files a/icon/fend-icon-150.png and /dev/null differ diff --git a/icon/fend-icon-16.png b/icon/fend-icon-16.png deleted file mode 100644 index 47360bb7..00000000 Binary files a/icon/fend-icon-16.png and /dev/null differ diff --git a/icon/fend-icon-256.ico b/icon/fend-icon-256.ico deleted file mode 100644 index b6644278..00000000 Binary files a/icon/fend-icon-256.ico and /dev/null differ diff --git a/icon/fend-icon-256.png b/icon/fend-icon-256.png deleted file mode 100644 index 3f908dc4..00000000 Binary files a/icon/fend-icon-256.png and /dev/null differ diff --git a/icon/fend-icon-32.png b/icon/fend-icon-32.png deleted file mode 100644 index c1f5e530..00000000 Binary files a/icon/fend-icon-32.png and /dev/null differ diff --git a/icon/fend-icon-44.png b/icon/fend-icon-44.png deleted file mode 100644 index f82a8746..00000000 Binary files a/icon/fend-icon-44.png and /dev/null differ diff --git a/icon/fend-icon-48.png b/icon/fend-icon-48.png deleted file mode 100644 index d5051a37..00000000 Binary files a/icon/fend-icon-48.png and /dev/null differ diff --git a/icon/fend-icon-500.png b/icon/fend-icon-500.png deleted file mode 100644 index 48729931..00000000 Binary files a/icon/fend-icon-500.png and /dev/null differ diff --git a/icon/fend-icon-64.png b/icon/fend-icon-64.png deleted file mode 100644 index 9a17fcde..00000000 Binary files a/icon/fend-icon-64.png and /dev/null differ diff --git a/icon/fend-icon-96.png b/icon/fend-icon-96.png deleted file mode 100644 index c75fc01d..00000000 Binary files a/icon/fend-icon-96.png and /dev/null differ diff --git a/icon/fend-icon.ico b/icon/fend-icon.ico deleted file mode 100644 index fe407260..00000000 Binary files a/icon/fend-icon.ico and /dev/null differ diff --git a/icon/resources.res b/icon/resources.res deleted file mode 100644 index 12366f70..00000000 Binary files a/icon/resources.res and /dev/null differ diff --git a/web/build.sh b/web/build.sh index 95468a13..0cf57f30 100755 --- a/web/build.sh +++ b/web/build.sh @@ -4,14 +4,14 @@ cd "$(dirname "$0")" (cd ../wasm && wasm-pack build --target no-modules --out-dir ../web/pkg) -cp ../icon/fend-icon-128.png . +convert -resize "128x128" ../icon/icon.svg fend-icon-128.png mkdir -p documentation (cd ../documentation && pandoc --standalone \ - --output=../web/documentation/index.html \ - --metadata-file=pandoc-metadata.yml \ - --lua-filter=include-code-files.lua \ - --lua-filter=include-files.lua \ - --lua-filter=add-header-ids.lua \ - index.md) + --output=../web/documentation/index.html \ + --metadata-file=pandoc-metadata.yml \ + --lua-filter=include-code-files.lua \ + --lua-filter=include-files.lua \ + --lua-filter=add-header-ids.lua \ + index.md) diff --git a/windows-msix/build.ps1 b/windows-msix/build.ps1 index b69423dd..98574728 100644 --- a/windows-msix/build.ps1 +++ b/windows-msix/build.ps1 @@ -13,34 +13,34 @@ $Env:WINDOWS_CERT_PASSWORD = "MyPassword" # $PSScriptRoot is the directory of this script if (Test-Path $PSScriptRoot\build) { - Remove-Item -Recurse -Force $PSScriptRoot\build + Remove-Item -Recurse -Force $PSScriptRoot\build } if (Test-Path $PSScriptRoot\fend.msix) { - Remove-Item -Force $PSScriptRoot\fend.msix + Remove-Item -Force $PSScriptRoot\fend.msix } if (Test-Path $PSScriptRoot\fend-windows-x64.msix) { - Remove-Item -Force $PSScriptRoot\fend-windows-x64.msix + Remove-Item -Force $PSScriptRoot\fend-windows-x64.msix } mkdir $PSScriptRoot\build Copy-Item $PSScriptRoot\..\target\release\fend.exe $PSScriptRoot\build (Get-Content $PSScriptRoot\AppxManifest.xml).replace('$FEND_VERSION', $Env:FEND_VERSION) | Set-Content $PSScriptRoot\build\AppxManifest.xml -Copy-Item $PSScriptRoot\..\icon\fend-icon-44.png $PSScriptRoot\build -Copy-Item $PSScriptRoot\..\icon\fend-icon-150.png $PSScriptRoot\build +convert -resize 44x44 $PSScriptRoot\..\icon\icon.svg $PSScriptRoot\build\fend-icon-44.png +convert -resize 150x150 $PSScriptRoot\..\icon\icon.svg $PSScriptRoot\build\fend-icon-150.png & "C:\Program Files (x86)\Windows Kits\10\App Certification Kit\makeappx.exe" ` - pack ` - /d $PSScriptRoot\build ` - /p $PSScriptRoot\fend.msix ` - /verbose + pack ` + /d $PSScriptRoot\build ` + /p $PSScriptRoot\fend.msix ` + /verbose & "C:\Program Files (x86)\Windows Kits\10\App Certification Kit\signtool.exe" ` - sign ` - /fd SHA256 /a ` - /f $PSScriptRoot\fend-signing-cert.pfx ` - /p $Env:WINDOWS_CERT_PASSWORD ` - $PSScriptRoot\fend.msix + sign ` + /fd SHA256 /a ` + /f $PSScriptRoot\fend-signing-cert.pfx ` + /p $Env:WINDOWS_CERT_PASSWORD ` + $PSScriptRoot\fend.msix Move-Item $PSScriptRoot\fend.msix $PSScriptRoot\fend-windows-x64.msix