[PATCH setup] Show a MessageBox warning if running on a deprecated Windows version
Jon Turney
jon.turney@dronecode.org.uk
Thu Jan 13 15:13:30 GMT 2022
Show a MessageBox warning if we are running on a Windows version which
we have deprecated Cygwin support for:
- Windows 6.0 (Windows Vista, Windows Server 2008)
- 32-bit Windows
This warning can be disabled with '--allow-unsupported-windows'.
---
Notes:
Not sure if this is needed, or maybe this is just annoying to the ~3% of
users who are running effected OSes. But maybe we want to annoy them
into doing something about it?
main.cc | 23 +++++++++++++++++++----
res.rc | 2 ++
resource.h | 2 ++
3 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/main.cc b/main.cc
index 162028f..818b01b 100644
--- a/main.cc
+++ b/main.cc
@@ -330,11 +330,26 @@ WinMain (HINSTANCE h,
}
/* Check if Cygwin works on this Windows version */
- if (!UnsupportedOption && (OSMajorVersion () < 6))
+ if (!UnsupportedOption)
{
- mbox (NULL, IDS_UNSUPPORTED_WINDOWS_VERSION,
- MB_ICONEXCLAMATION | MB_OK);
- Logger ().exit (1, false);
+ if (OSMajorVersion () < 6)
+ {
+ mbox (NULL, IDS_UNSUPPORTED_WINDOWS_VERSION,
+ MB_ICONEXCLAMATION | MB_OK);
+ Logger ().exit (1, false);
+ }
+
+ if
+#ifdef _X86_
+ (TRUE)
+#else
+ (!is_64bit)
+#endif
+ mbox (NULL, IDS_DEPRECATED_WINDOWS_ARCH,
+ MB_ICONEXCLAMATION | MB_OK);
+ else if ((OSMajorVersion () == 6) && (OSMinorVersion() < 1))
+ mbox (NULL, IDS_DEPRECATED_WINDOWS_VERSION,
+ MB_ICONEXCLAMATION | MB_OK);
}
/* Set default DACL and Group. */
diff --git a/res.rc b/res.rc
index 83d8339..1b9026a 100644
--- a/res.rc
+++ b/res.rc
@@ -675,6 +675,8 @@ BEGIN
"Setup will not be able to create Cygwin Icons "
"in the Start Menu or on the Desktop."
IDS_UNSUPPORTED_WINDOWS_VERSION "Cygwin is not supported on this Windows version"
+ IDS_DEPRECATED_WINDOWS_VERSION "Cygwin support for this Windows version is deprecated, and will be removed in the next major version"
+ IDS_DEPRECATED_WINDOWS_ARCH "Cygwin support for 32-bit Windows is deprecated, and will be removed in the next major version"
IDS_MOUNT_REGISTRY_KEY_FAILED "Couldn't create registry key to store installation path"
IDS_NIO_ERROR "Internet Error: %s"
IDS_PREREQ_UNSOLVED_PROBLEMS
diff --git a/resource.h b/resource.h
index 0a10f64..6dfedcc 100644
--- a/resource.h
+++ b/resource.h
@@ -103,6 +103,8 @@
#define IDS_PROGRESS_DOWNLOADING_FROM 1206
#define IDS_FILE_INUSE_KILL 1207
#define IDS_FILE_INUSE_MSG 1208
+#define IDS_DEPRECATED_WINDOWS_VERSION 1209
+#define IDS_DEPRECATED_WINDOWS_ARCH 1210
// Dialogs
--
2.34.1
More information about the Cygwin-apps
mailing list