From 47452f20061c50a8700127196d47a7ed4549b478 Mon Sep 17 00:00:00 2001 From: Abdo Date: Thu, 28 May 2026 22:25:37 +0300 Subject: [PATCH 01/12] Check Windows version --- src/briefcase/platforms/windows/__init__.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/briefcase/platforms/windows/__init__.py b/src/briefcase/platforms/windows/__init__.py index c8bd782f0..fbec80926 100644 --- a/src/briefcase/platforms/windows/__init__.py +++ b/src/briefcase/platforms/windows/__init__.py @@ -243,6 +243,26 @@ def _cleanup_app_support_package(self, support_path): """, ) + def _install_app_requirements( + self, + app: FinalizedAppConfig, + requires: list[str], + app_packages_path: Path, + **kwargs, + ): + support_min_version = 10240 # Windows 10 + min_version = int(getattr(app, "min_os_version", support_min_version)) + if min_version < support_min_version: + raise BriefcaseCommandError( + "Your Windows app specifies a minimum build number of " + f"{min_version}, but the support package only supports " + f"{support_min_version}" + ) + + return super()._install_app_requirements( + app, requires, app_packages_path, **kwargs + ) + def install_license(self, app: FinalizedAppConfig): """Install the license for the project as a single RTF document. From cb0c35b98e8bc661a8be4ab02ed498196a757193 Mon Sep 17 00:00:00 2001 From: Abdo Date: Fri, 29 May 2026 16:06:29 +0300 Subject: [PATCH 02/12] Add tests --- tests/platforms/windows/app/conftest.py | 2 ++ .../windows/app/create/test_create.py | 30 +++++++++++++++++- .../windows/visualstudio/conftest.py | 24 ++++++++++++++ .../windows/visualstudio/test_create.py | 31 +++++++++++++++++++ 4 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 tests/platforms/windows/visualstudio/conftest.py diff --git a/tests/platforms/windows/app/conftest.py b/tests/platforms/windows/app/conftest.py index 7855a7959..57e131b14 100644 --- a/tests/platforms/windows/app/conftest.py +++ b/tests/platforms/windows/app/conftest.py @@ -19,6 +19,8 @@ def first_app_templated(first_app_config, tmp_path): dedent( """\ [paths] + app_path = "src/app" + app_packages_path = "src/app_packages" extras_path = "custom_extras" """ ), diff --git a/tests/platforms/windows/app/create/test_create.py b/tests/platforms/windows/app/create/test_create.py index 623cca0cd..783d168fd 100644 --- a/tests/platforms/windows/app/create/test_create.py +++ b/tests/platforms/windows/app/create/test_create.py @@ -5,7 +5,8 @@ import pytest from packaging.version import Version -from briefcase.exceptions import UnsupportedHostError +from briefcase.exceptions import BriefcaseCommandError, UnsupportedHostError +from briefcase.integrations.subprocess import Subprocess from briefcase.platforms.windows.app import WindowsAppCreateCommand @@ -259,3 +260,30 @@ def test_external(create_command, external_first_app, tmp_path): context = create_command.output_format_template_context(external_first_app) assert context["package_path"] == str(tmp_path / "base_path/external/src") assert context["binary_path"] == "internal/app.exe" + + +@pytest.mark.parametrize( + ("min_os_version", "compatible"), [("7601", False), ("10240", True)] +) +def test_in_os_version(create_command, first_app_templated, min_os_version, compatible): + """If the app defines a min OS version that is incompatible with the support + package, an error is raised.""" + first_app_templated.requires = ["first", "second==1.2.3", "third>=3.2.1"] + first_app_templated.min_os_version = min_os_version + create_command.tools[first_app_templated].app_context = MagicMock( + spec_set=Subprocess + ) + + if not compatible: + with pytest.raises( + BriefcaseCommandError, + match=( + r"Your Windows app specifies a minimum build number of 7601, " + r"but the support package only supports 10240" + ), + ): + create_command.install_app_requirements(first_app_templated) + create_command.tools[first_app_templated].app_context.run.assert_not_called() + else: + create_command.install_app_requirements(first_app_templated) + create_command.tools[first_app_templated].app_context.run.assert_called() diff --git a/tests/platforms/windows/visualstudio/conftest.py b/tests/platforms/windows/visualstudio/conftest.py new file mode 100644 index 000000000..f37e451c8 --- /dev/null +++ b/tests/platforms/windows/visualstudio/conftest.py @@ -0,0 +1,24 @@ +from textwrap import dedent + +import pytest + +from ....utils import create_file + + +@pytest.fixture +def first_app_templated(first_app_config, tmp_path): + bundle_path = tmp_path / "base_path/build/first-app/windows/visualstudio" + + create_file( + bundle_path / "briefcase.toml", + dedent( + """\ + [paths] + app_path = "src/app" + app_packages_path = "src/app_packages" + extras_path = "custom_extras" + """ + ), + ) + + return first_app_config diff --git a/tests/platforms/windows/visualstudio/test_create.py b/tests/platforms/windows/visualstudio/test_create.py index e373982b2..ce1c6ee3b 100644 --- a/tests/platforms/windows/visualstudio/test_create.py +++ b/tests/platforms/windows/visualstudio/test_create.py @@ -1,5 +1,9 @@ +from unittest.mock import MagicMock + import pytest +from briefcase.exceptions import BriefcaseCommandError +from briefcase.integrations.subprocess import Subprocess from briefcase.platforms.windows.visualstudio import WindowsVisualStudioCreateCommand # Most tests and fixtures are the same for both "app" and "visualstudio". This file only @@ -22,3 +26,30 @@ def test_package_path(create_command, first_app_config, tmp_path): assert context["package_path"] == str( tmp_path / "base_path/build/first-app/windows/visualstudio/x64/Release" ) + + +@pytest.mark.parametrize( + ("min_os_version", "compatible"), [("7601", False), ("10240", True)] +) +def test_in_os_version(create_command, first_app_templated, min_os_version, compatible): + """If the app defines a min OS version that is incompatible with the support + package, an error is raised.""" + first_app_templated.requires = ["first", "second==1.2.3", "third>=3.2.1"] + first_app_templated.min_os_version = min_os_version + create_command.tools[first_app_templated].app_context = MagicMock( + spec_set=Subprocess + ) + + if not compatible: + with pytest.raises( + BriefcaseCommandError, + match=( + r"Your Windows app specifies a minimum build number of 7601, " + r"but the support package only supports 10240" + ), + ): + create_command.install_app_requirements(first_app_templated) + create_command.tools[first_app_templated].app_context.run.assert_not_called() + else: + create_command.install_app_requirements(first_app_templated) + create_command.tools[first_app_templated].app_context.run.assert_called() From 82f5536f45f91d4e6065873281afc07ad111f287 Mon Sep 17 00:00:00 2001 From: Abdo Date: Fri, 29 May 2026 16:23:07 +0300 Subject: [PATCH 03/12] Update docs --- docs/en/reference/platforms/windows/index.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/en/reference/platforms/windows/index.md b/docs/en/reference/platforms/windows/index.md index d00df8c9b..d0acdc9f9 100644 --- a/docs/en/reference/platforms/windows/index.md +++ b/docs/en/reference/platforms/windows/index.md @@ -129,6 +129,11 @@ The digest algorithm to request the Timestamp Authority server uses for the time The following options can be added to the `tool.briefcase.app..windows` section of your `pyproject.toml` file. +#### `min_os_version` + +The minimum [Windows build number](https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions) that the app will support. +This is used by MSI installers to block installation on unsupported versions. + #### `dotnet_version` { #dotnet-version } The minimum .NET runtime version required by the application, as a version string (e.g., `"10.0.0"`). This is used by MSI installers to verify that the required runtime is installed before installing the app. If this value is not set, no .NET runtime check is performed. From 6ddea8723435b225cc9f453af48b32b7e5e4dcb4 Mon Sep 17 00:00:00 2001 From: Abdo Date: Fri, 29 May 2026 16:32:47 +0300 Subject: [PATCH 04/12] Add change note --- changes/2855.feature.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/2855.feature.md diff --git a/changes/2855.feature.md b/changes/2855.feature.md new file mode 100644 index 000000000..a9ed7bcfe --- /dev/null +++ b/changes/2855.feature.md @@ -0,0 +1 @@ +The minimum supported Windows build number can now be specified using the `min_os_version` option. From c79adb5cde202b7ad423f49513e6c2b1b18d9091 Mon Sep 17 00:00:00 2001 From: Abdo Date: Tue, 2 Jun 2026 16:41:03 +0300 Subject: [PATCH 05/12] Read version from app template --- src/briefcase/platforms/windows/__init__.py | 29 ++++++++++++++----- .../windows/app/create/test_create.py | 27 ++++++++++++----- .../windows/visualstudio/test_create.py | 27 ++++++++++++----- 3 files changed, 59 insertions(+), 24 deletions(-) diff --git a/src/briefcase/platforms/windows/__init__.py b/src/briefcase/platforms/windows/__init__.py index fbec80926..5c82a267c 100644 --- a/src/briefcase/platforms/windows/__init__.py +++ b/src/briefcase/platforms/windows/__init__.py @@ -134,6 +134,18 @@ def verify_host(self): Install a 64bit version of Python and run Briefcase again. """) + def target_windows_build(self, app: FinalizedAppConfig) -> int | None: + """The minimum supported Windows build number for the app from + ``briefcase.toml``. + + :param app: The config object for the app + :return: version or None if one isn't specified + """ + try: + return int(self.briefcase_toml(app)["briefcase"]["target_windows_build"]) + except KeyError: + return None + class WindowsCreateCommand(CreateCommand): def support_package_filename(self, support_revision): @@ -250,14 +262,15 @@ def _install_app_requirements( app_packages_path: Path, **kwargs, ): - support_min_version = 10240 # Windows 10 - min_version = int(getattr(app, "min_os_version", support_min_version)) - if min_version < support_min_version: - raise BriefcaseCommandError( - "Your Windows app specifies a minimum build number of " - f"{min_version}, but the support package only supports " - f"{support_min_version}" - ) + template_min_version = self.target_windows_build(app) + if template_min_version: + min_version = getattr(app, "min_os_version", template_min_version) + if min_version and int(min_version) < template_min_version: + raise BriefcaseCommandError( + "Your Windows app specifies a minimum build number of " + f"{min_version}, but the app template only supports " + f"{template_min_version}" + ) return super()._install_app_requirements( app, requires, app_packages_path, **kwargs diff --git a/tests/platforms/windows/app/create/test_create.py b/tests/platforms/windows/app/create/test_create.py index 783d168fd..d78a1a45e 100644 --- a/tests/platforms/windows/app/create/test_create.py +++ b/tests/platforms/windows/app/create/test_create.py @@ -263,23 +263,34 @@ def test_external(create_command, external_first_app, tmp_path): @pytest.mark.parametrize( - ("min_os_version", "compatible"), [("7601", False), ("10240", True)] + ("template_version", "app_version", "compatible"), + [ + (10240, "7601", False), + (10240, "10240", True), + (10240, "17763", True), + (None, 10240, True), + (10240, None, True), + (None, None, True), + ], ) -def test_in_os_version(create_command, first_app_templated, min_os_version, compatible): - """If the app defines a min OS version that is incompatible with the support - package, an error is raised.""" +def test_min_os_version( + create_command, first_app_templated, template_version, app_version, compatible +): + """If the app defines a min OS version that is incompatible with the app template, + an error is raised.""" first_app_templated.requires = ["first", "second==1.2.3", "third>=3.2.1"] - first_app_templated.min_os_version = min_os_version + create_command.target_windows_build = MagicMock(return_value=template_version) + if app_version: + first_app_templated.min_os_version = app_version create_command.tools[first_app_templated].app_context = MagicMock( spec_set=Subprocess ) - if not compatible: with pytest.raises( BriefcaseCommandError, match=( - r"Your Windows app specifies a minimum build number of 7601, " - r"but the support package only supports 10240" + f"Your Windows app specifies a minimum build number of {app_version}, " + f"but the app template only supports {template_version}" ), ): create_command.install_app_requirements(first_app_templated) diff --git a/tests/platforms/windows/visualstudio/test_create.py b/tests/platforms/windows/visualstudio/test_create.py index ce1c6ee3b..18d38d7b1 100644 --- a/tests/platforms/windows/visualstudio/test_create.py +++ b/tests/platforms/windows/visualstudio/test_create.py @@ -29,23 +29,34 @@ def test_package_path(create_command, first_app_config, tmp_path): @pytest.mark.parametrize( - ("min_os_version", "compatible"), [("7601", False), ("10240", True)] + ("template_version", "app_version", "compatible"), + [ + (10240, "7601", False), + (10240, "10240", True), + (10240, "17763", True), + (None, 10240, True), + (10240, None, True), + (None, None, True), + ], ) -def test_in_os_version(create_command, first_app_templated, min_os_version, compatible): - """If the app defines a min OS version that is incompatible with the support - package, an error is raised.""" +def test_min_os_version( + create_command, first_app_templated, template_version, app_version, compatible +): + """If the app defines a min OS version that is incompatible with the app template, + an error is raised.""" first_app_templated.requires = ["first", "second==1.2.3", "third>=3.2.1"] - first_app_templated.min_os_version = min_os_version + create_command.target_windows_build = MagicMock(return_value=template_version) + if app_version: + first_app_templated.min_os_version = app_version create_command.tools[first_app_templated].app_context = MagicMock( spec_set=Subprocess ) - if not compatible: with pytest.raises( BriefcaseCommandError, match=( - r"Your Windows app specifies a minimum build number of 7601, " - r"but the support package only supports 10240" + f"Your Windows app specifies a minimum build number of {app_version}, " + f"but the app template only supports {template_version}" ), ): create_command.install_app_requirements(first_app_templated) From 015dd3030b9993bb7d1f09491099a24a6405234a Mon Sep 17 00:00:00 2001 From: Abdo Date: Tue, 2 Jun 2026 17:16:30 +0300 Subject: [PATCH 06/12] Ensure min_os_version is passed to the template if not specified --- src/briefcase/platforms/windows/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/briefcase/platforms/windows/__init__.py b/src/briefcase/platforms/windows/__init__.py index 5c82a267c..72656e24d 100644 --- a/src/briefcase/platforms/windows/__init__.py +++ b/src/briefcase/platforms/windows/__init__.py @@ -264,7 +264,10 @@ def _install_app_requirements( ): template_min_version = self.target_windows_build(app) if template_min_version: - min_version = getattr(app, "min_os_version", template_min_version) + min_version = getattr(app, "min_os_version", None) + if min_version is None: + app.min_os_version = template_min_version + min_version = template_min_version if min_version and int(min_version) < template_min_version: raise BriefcaseCommandError( "Your Windows app specifies a minimum build number of " From 82f4168a13d404522211231b0a1bd7fdef973a55 Mon Sep 17 00:00:00 2001 From: Abdo Date: Tue, 2 Jun 2026 17:40:02 +0300 Subject: [PATCH 07/12] Add tests for target_windows_build --- tests/platforms/windows/app/create/test_create.py | 11 +++++++++++ tests/platforms/windows/visualstudio/test_create.py | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/tests/platforms/windows/app/create/test_create.py b/tests/platforms/windows/app/create/test_create.py index d78a1a45e..1a6084717 100644 --- a/tests/platforms/windows/app/create/test_create.py +++ b/tests/platforms/windows/app/create/test_create.py @@ -298,3 +298,14 @@ def test_min_os_version( else: create_command.install_app_requirements(first_app_templated) create_command.tools[first_app_templated].app_context.run.assert_called() + + +def test_target_windows_build(create_command, first_app_templated): + "Test that the target Windows build is returned" + + create_command._briefcase_toml[first_app_templated] = {"briefcase": {}} + assert create_command.target_windows_build(first_app_templated) is None + create_command._briefcase_toml[first_app_templated] = { + "briefcase": {"target_windows_build": 10240} + } + assert create_command.target_windows_build(first_app_templated) == 10240 diff --git a/tests/platforms/windows/visualstudio/test_create.py b/tests/platforms/windows/visualstudio/test_create.py index 18d38d7b1..b205721e0 100644 --- a/tests/platforms/windows/visualstudio/test_create.py +++ b/tests/platforms/windows/visualstudio/test_create.py @@ -64,3 +64,14 @@ def test_min_os_version( else: create_command.install_app_requirements(first_app_templated) create_command.tools[first_app_templated].app_context.run.assert_called() + + +def test_target_windows_build(create_command, first_app_templated): + "Test that the target Windows build is returned" + + create_command._briefcase_toml[first_app_templated] = {"briefcase": {}} + assert create_command.target_windows_build(first_app_templated) is None + create_command._briefcase_toml[first_app_templated] = { + "briefcase": {"target_windows_build": 10240} + } + assert create_command.target_windows_build(first_app_templated) == 10240 From 2cee77580ac5e19a77becebf88fedb55d53a1c6e Mon Sep 17 00:00:00 2001 From: Abdo Date: Wed, 3 Jun 2026 19:26:16 +0300 Subject: [PATCH 08/12] Tweak argument formatting --- tests/platforms/windows/app/create/test_create.py | 6 +++++- tests/platforms/windows/visualstudio/test_create.py | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/platforms/windows/app/create/test_create.py b/tests/platforms/windows/app/create/test_create.py index 1a6084717..1e05942e8 100644 --- a/tests/platforms/windows/app/create/test_create.py +++ b/tests/platforms/windows/app/create/test_create.py @@ -274,7 +274,11 @@ def test_external(create_command, external_first_app, tmp_path): ], ) def test_min_os_version( - create_command, first_app_templated, template_version, app_version, compatible + create_command, + first_app_templated, + template_version, + app_version, + compatible, ): """If the app defines a min OS version that is incompatible with the app template, an error is raised.""" diff --git a/tests/platforms/windows/visualstudio/test_create.py b/tests/platforms/windows/visualstudio/test_create.py index b205721e0..b640b6997 100644 --- a/tests/platforms/windows/visualstudio/test_create.py +++ b/tests/platforms/windows/visualstudio/test_create.py @@ -40,7 +40,11 @@ def test_package_path(create_command, first_app_config, tmp_path): ], ) def test_min_os_version( - create_command, first_app_templated, template_version, app_version, compatible + create_command, + first_app_templated, + template_version, + app_version, + compatible, ): """If the app defines a min OS version that is incompatible with the app template, an error is raised.""" From 90daaa680e40b802d593207e152669444f7cd339 Mon Sep 17 00:00:00 2001 From: Abdo Date: Thu, 4 Jun 2026 14:53:44 +0300 Subject: [PATCH 09/12] Assume min_os_version is int --- src/briefcase/platforms/windows/__init__.py | 5 ++--- tests/platforms/windows/app/create/test_create.py | 6 +++--- tests/platforms/windows/visualstudio/test_create.py | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/briefcase/platforms/windows/__init__.py b/src/briefcase/platforms/windows/__init__.py index 72656e24d..ada613c1f 100644 --- a/src/briefcase/platforms/windows/__init__.py +++ b/src/briefcase/platforms/windows/__init__.py @@ -262,13 +262,12 @@ def _install_app_requirements( app_packages_path: Path, **kwargs, ): - template_min_version = self.target_windows_build(app) - if template_min_version: + if template_min_version := self.target_windows_build(app): min_version = getattr(app, "min_os_version", None) if min_version is None: app.min_os_version = template_min_version min_version = template_min_version - if min_version and int(min_version) < template_min_version: + elif min_version < template_min_version: raise BriefcaseCommandError( "Your Windows app specifies a minimum build number of " f"{min_version}, but the app template only supports " diff --git a/tests/platforms/windows/app/create/test_create.py b/tests/platforms/windows/app/create/test_create.py index 1e05942e8..590475068 100644 --- a/tests/platforms/windows/app/create/test_create.py +++ b/tests/platforms/windows/app/create/test_create.py @@ -265,9 +265,9 @@ def test_external(create_command, external_first_app, tmp_path): @pytest.mark.parametrize( ("template_version", "app_version", "compatible"), [ - (10240, "7601", False), - (10240, "10240", True), - (10240, "17763", True), + (10240, 7601, False), + (10240, 10240, True), + (10240, 17763, True), (None, 10240, True), (10240, None, True), (None, None, True), diff --git a/tests/platforms/windows/visualstudio/test_create.py b/tests/platforms/windows/visualstudio/test_create.py index b640b6997..b9b68e094 100644 --- a/tests/platforms/windows/visualstudio/test_create.py +++ b/tests/platforms/windows/visualstudio/test_create.py @@ -31,9 +31,9 @@ def test_package_path(create_command, first_app_config, tmp_path): @pytest.mark.parametrize( ("template_version", "app_version", "compatible"), [ - (10240, "7601", False), - (10240, "10240", True), - (10240, "17763", True), + (10240, 7601, False), + (10240, 10240, True), + (10240, 17763, True), (None, 10240, True), (10240, None, True), (None, None, True), From 30e23b5cf0bc0aee5972c1ffe6c7b59658359ad0 Mon Sep 17 00:00:00 2001 From: Abdo Date: Thu, 4 Jun 2026 16:20:09 +0300 Subject: [PATCH 10/12] Do not set a default min_os_version --- src/briefcase/platforms/windows/__init__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/briefcase/platforms/windows/__init__.py b/src/briefcase/platforms/windows/__init__.py index ada613c1f..9aa6b8ba9 100644 --- a/src/briefcase/platforms/windows/__init__.py +++ b/src/briefcase/platforms/windows/__init__.py @@ -263,11 +263,8 @@ def _install_app_requirements( **kwargs, ): if template_min_version := self.target_windows_build(app): - min_version = getattr(app, "min_os_version", None) - if min_version is None: - app.min_os_version = template_min_version - min_version = template_min_version - elif min_version < template_min_version: + min_version = getattr(app, "min_os_version", template_min_version) + if min_version < template_min_version: raise BriefcaseCommandError( "Your Windows app specifies a minimum build number of " f"{min_version}, but the app template only supports " From 4b22bfeea80e2632bb283177d4b891e2453216d4 Mon Sep 17 00:00:00 2001 From: Abdo Date: Wed, 10 Jun 2026 01:33:16 +0300 Subject: [PATCH 11/12] Restore int conversion Co-authored-by: Russell Keith-Magee --- src/briefcase/platforms/windows/__init__.py | 2 +- tests/platforms/windows/app/create/test_create.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/briefcase/platforms/windows/__init__.py b/src/briefcase/platforms/windows/__init__.py index 9aa6b8ba9..494e6ed86 100644 --- a/src/briefcase/platforms/windows/__init__.py +++ b/src/briefcase/platforms/windows/__init__.py @@ -263,7 +263,7 @@ def _install_app_requirements( **kwargs, ): if template_min_version := self.target_windows_build(app): - min_version = getattr(app, "min_os_version", template_min_version) + min_version = int(getattr(app, "min_os_version", template_min_version)) if min_version < template_min_version: raise BriefcaseCommandError( "Your Windows app specifies a minimum build number of " diff --git a/tests/platforms/windows/app/create/test_create.py b/tests/platforms/windows/app/create/test_create.py index 590475068..f9998758f 100644 --- a/tests/platforms/windows/app/create/test_create.py +++ b/tests/platforms/windows/app/create/test_create.py @@ -271,6 +271,10 @@ def test_external(create_command, external_first_app, tmp_path): (None, 10240, True), (10240, None, True), (None, None, True), + # Values provided as strings are converted to int + ("10240", "7601", False), + (10240, "7601", False), + ("10240", 7601, False), ], ) def test_min_os_version( From 79eb8881909a8ff33117f3bd98f6e19b63509186 Mon Sep 17 00:00:00 2001 From: Abdo Date: Wed, 10 Jun 2026 01:40:46 +0300 Subject: [PATCH 12/12] Move int conversion out of target_windows_build() --- src/briefcase/platforms/windows/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/briefcase/platforms/windows/__init__.py b/src/briefcase/platforms/windows/__init__.py index 494e6ed86..8ba004579 100644 --- a/src/briefcase/platforms/windows/__init__.py +++ b/src/briefcase/platforms/windows/__init__.py @@ -142,7 +142,7 @@ def target_windows_build(self, app: FinalizedAppConfig) -> int | None: :return: version or None if one isn't specified """ try: - return int(self.briefcase_toml(app)["briefcase"]["target_windows_build"]) + return self.briefcase_toml(app)["briefcase"]["target_windows_build"] except KeyError: return None @@ -264,7 +264,7 @@ def _install_app_requirements( ): if template_min_version := self.target_windows_build(app): min_version = int(getattr(app, "min_os_version", template_min_version)) - if min_version < template_min_version: + if min_version < int(template_min_version): raise BriefcaseCommandError( "Your Windows app specifies a minimum build number of " f"{min_version}, but the app template only supports "