public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [PATCH setup] Show a MessageBox warning if running on a deprecated Windows version
@ 2022-01-13 15:13 Jon Turney
  2022-01-14  9:04 ` Corinna Vinschen
  0 siblings, 1 reply; 10+ messages in thread
From: Jon Turney @ 2022-01-13 15:13 UTC (permalink / raw)
  To: cygwin-apps; +Cc: Jon Turney

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-01-24 19:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13 15:13 [PATCH setup] Show a MessageBox warning if running on a deprecated Windows version Jon Turney
2022-01-14  9:04 ` Corinna Vinschen
2022-01-14 10:54   ` Adam Dinwoodie
2022-01-14 11:45     ` Corinna Vinschen
2022-01-16 13:46       ` Adam Dinwoodie
2022-01-16 17:55         ` Hamish McIntyre-Bhatty
2022-01-17 10:03           ` Corinna Vinschen
2022-01-17 18:06             ` Brian Inglis
2022-01-18 16:15   ` Jon Turney
2022-01-24 19:57     ` Jon Turney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).