|
| 1 | +# Weather Widget - Windows Installer Packaging |
| 2 | + |
| 3 | +This directory contains everything needed to build production-ready Windows |
| 4 | +installers for the Weather Widget application. |
| 5 | + |
| 6 | +## Two Packaging Options |
| 7 | + |
| 8 | +| Format | Use Case | Script | |
| 9 | +|--------|----------|--------| |
| 10 | +| **MSI** | Traditional Windows installer, sideloading | `build-msi.ps1` | |
| 11 | +| **MSIX** | Microsoft Store submission (recommended) | `build-msix.ps1` | |
| 12 | + |
| 13 | +## Prerequisites |
| 14 | + |
| 15 | +### Required for both |
| 16 | + |
| 17 | +1. **Go 1.25+** with CGO enabled (Fyne requires CGO) |
| 18 | +2. **go-winres** — embeds icon, manifest, and version info into the exe: |
| 19 | + ```powershell |
| 20 | + go install github.com/tc-hib/go-winres@latest |
| 21 | + ``` |
| 22 | +3. **A code signing certificate** — required for production/Store builds. |
| 23 | + For Store apps, you get one through Microsoft Partner Center. |
| 24 | + |
| 25 | +### For MSI builds |
| 26 | + |
| 27 | +4. **WiX Toolset v4+**: |
| 28 | + ```powershell |
| 29 | + dotnet tool install --global wix |
| 30 | + ``` |
| 31 | + |
| 32 | +### For MSIX builds (Microsoft Store) |
| 33 | + |
| 34 | +4. **Windows 10/11 SDK** — provides `MakeAppx.exe` and `SignTool.exe`. |
| 35 | + Install via Visual Studio Installer or the standalone SDK installer. |
| 36 | + |
| 37 | +## Quick Start |
| 38 | + |
| 39 | +### Build an unsigned MSI (for testing) |
| 40 | + |
| 41 | +```powershell |
| 42 | +.\installer\build-msi.ps1 -Version "1.0.0.0" -SkipSign |
| 43 | +``` |
| 44 | + |
| 45 | +### Build a signed MSI |
| 46 | + |
| 47 | +```powershell |
| 48 | +.\installer\build-msi.ps1 -Version "1.0.0.0" -CertPath ".\cert.pfx" -CertPassword "yourpassword" |
| 49 | +``` |
| 50 | + |
| 51 | +### Build an MSIX for Microsoft Store |
| 52 | + |
| 53 | +```powershell |
| 54 | +.\installer\build-msix.ps1 -Version "1.0.0.0" -CertPath ".\cert.pfx" -CertPassword "yourpassword" |
| 55 | +``` |
| 56 | + |
| 57 | +Output goes to `.\build\`. |
| 58 | + |
| 59 | +## Store Assets (MSIX only) |
| 60 | + |
| 61 | +Before submitting to the Microsoft Store, place properly sized PNG images in |
| 62 | +`installer/store-assets/`: |
| 63 | + |
| 64 | +| File | Size | Purpose | |
| 65 | +|------|------|---------| |
| 66 | +| `StoreLogo.png` | 50x50 | Store listing logo | |
| 67 | +| `Square44x44Logo.png` | 44x44 | Taskbar, Start menu | |
| 68 | +| `Square150x150Logo.png` | 150x150 | Start menu tile | |
| 69 | +| `Wide310x150Logo.png` | 310x150 | Wide Start tile | |
| 70 | +| `Square310x310Logo.png` | 310x310 | Large Start tile | |
| 71 | + |
| 72 | +If these are missing, the build script creates 1x1 placeholders so the |
| 73 | +package builds, but you must replace them before Store submission. |
| 74 | + |
| 75 | +## Icon File |
| 76 | + |
| 77 | +Place your application icon as `winres/icon.ico`. This gets embedded into the |
| 78 | +exe and is used for the taskbar, window title, and Explorer file icon. |
| 79 | + |
| 80 | +To convert a PNG to ICO, use ImageMagick: |
| 81 | +```bash |
| 82 | +magick convert icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico |
| 83 | +``` |
| 84 | + |
| 85 | +## AppxManifest.xml Configuration |
| 86 | + |
| 87 | +Before submitting to the Store, update these fields in `AppxManifest.xml`: |
| 88 | + |
| 89 | +- `Identity Name` — your Partner Center app reservation name |
| 90 | +- `Identity Publisher` — must match your signing certificate subject exactly |
| 91 | +- `PublisherDisplayName` — your display name in the Store |
| 92 | + |
| 93 | +## File Structure |
| 94 | + |
| 95 | +``` |
| 96 | +installer/ |
| 97 | +├── AppxManifest.xml # MSIX package manifest |
| 98 | +├── Package.wxs # WiX MSI definition |
| 99 | +├── build-msi.ps1 # MSI build script |
| 100 | +├── build-msix.ps1 # MSIX build script |
| 101 | +├── store-assets/ # Store tile images (you provide these) |
| 102 | +│ ├── StoreLogo.png |
| 103 | +│ ├── Square44x44Logo.png |
| 104 | +│ ├── Square150x150Logo.png |
| 105 | +│ ├── Wide310x150Logo.png |
| 106 | +│ └── Square310x310Logo.png |
| 107 | +└── README.md # This file |
| 108 | +
|
| 109 | +winres/ |
| 110 | +├── winres.json # Windows resource definitions |
| 111 | +└── icon.ico # Application icon (you provide this) |
| 112 | +``` |
0 commit comments