Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Windows installer: refuse Windows 7 and 8 with a clear message (#2310) (#3261)

Dan Hiorns20cb95bc272f
diff --git a/README.md b/README.md
index b6e8c5a60..0455744b0 100644
--- a/README.md
+++ b/README.md
@@ -331,6 +331,8 @@ sha256-verified. Fetch them with `cargo xtask corpus --all` and run the tests wi
| arm64 (Snapdragon and other ARM PCs) | `photocraft-<ver>-windows-arm64.msi` | `photocraft-<ver>-windows-arm64-portable.zip` |
| x86 (32-bit) | `photocraft-<ver>-windows-x86.msi` | `photocraft-<ver>-windows-x86-portable.zip` |
+Windows 10 or later is required. On Windows 7 and 8 the app can't start (the installer says so).
+
Installers and executables are code-signed.
### macOS
diff --git a/packaging/windows/photocraft.en-us.wxl b/packaging/windows/photocraft.en-us.wxl
index faa2835ab..8c14594d1 100644
--- a/packaging/windows/photocraft.en-us.wxl
+++ b/packaging/windows/photocraft.en-us.wxl
@@ -7,5 +7,6 @@
<String Id="WelcomeDlgTitle" Value="{\WixUI_Font_Bigger}Welcome to the [ProductName] [PhotocraftVersion] Setup Wizard" />
<String Id="WelcomeDlgDescription" Value="The Setup Wizard will install [ProductName] version [PhotocraftVersion] on your computer. Click Next to continue or Cancel to exit the Setup Wizard." />
<String Id="VerifyReadyDlgInstallTitle" Value="{\WixUI_Font_Title}Ready to install [ProductName] [PhotocraftVersion]" />
+ <String Id="RequiresWindows10" Value="PhotoCraft needs Windows 10 or later. This version of Windows can't run it." />
<String Id="ExitDialogTitle" Value="{\WixUI_Font_Bigger}Completed the [ProductName] [PhotocraftVersion] Setup Wizard" />
</WixLocalization>
diff --git a/packaging/windows/photocraft.wxs b/packaging/windows/photocraft.wxs
index 98dc1fdfd..d0b490950 100644
--- a/packaging/windows/photocraft.wxs
+++ b/packaging/windows/photocraft.wxs
@@ -31,6 +31,18 @@
DowngradeErrorMessage="A newer version of PhotoCraft is already installed." />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
+ <!-- Windows 10 or later. The Rust standard library has needed it since 1.78: on Windows 7 and
+ 8 the app fails at launch with "The procedure entry point ProcessPrng could not be located
+ in bcryptprimitives.dll" (#2310), so the installer says so instead of installing it.
+ `CurrentMajorVersionNumber` exists only from Windows 10 on, in the 32- and 64-bit
+ registry views alike; MSI's own VersionNT has reported both 603 and 1000 there.
+ `Installed` keeps repair and uninstall working on any Windows. -->
+ <Property Id="WINDOWS10ORLATER" Secure="yes">
+ <RegistrySearch Id="WindowsMajorVersion" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion"
+ Name="CurrentMajorVersionNumber" Type="raw" />
+ </Property>
+ <Launch Condition="Installed OR WINDOWS10ORLATER" Message="!(loc.RequiresWindows10)" />
+
<!-- MSI caches this icon using its Id as the filename. Advertised shortcuts to an
.exe need an .exe icon identifier (ICE50), even when the source is an ICO. -->
<Icon Id="PhotocraftIcon.exe" SourceFile="$(var.IconPath)" />