+2009-12-22 Christopher Faylor <me+cygwin@cgf.cx>
+
+ * ini.h: Use is_legacy to control setup.ini names.
+ * main.cc (set_legacy): New function.
+ (main): Call set_legacy with program name to determine if this is
+ supposed to be an installation of the legacy version of cygwin. Issue
+ a warning on attempt to install legacy on Windows NT class system.
+
2009-12-22 Christopher Faylor <me+cygwin@cgf.cx>
* package_message (packagemessage::display): Avoid displaying a message
EXCLUDE_NONE = 0,
EXCLUDE_BY_SETUP,
EXCLUDE_NOT_FOUND
-}
-excludes;
+} excludes;
-#define SETUP_INI_FILENAME (IsWindowsNT () ? "setup-2.ini" : "setup.ini")
-#define SETUP_BZ2_FILENAME (IsWindowsNT () ? "setup-2.bz2" : "setup.bz2")
+extern bool is_legacy;
+#define SETUP_INI_FILENAME (is_legacy ? "setup-legacy.ini" : "setup.ini")
+#define SETUP_BZ2_FILENAME (is_legacy ? "setup-legacy.bz2" : "setup.bz2")
/* The following three vars are used to facilitate error handling between the
parser/lexer and its callers, namely ini.cc:do_remote_ini() and
using namespace std;
HINSTANCE hinstance;
+bool is_legacy;
static BoolOption UnattendedOption (false, 'q', "quiet-mode", "Unattended setup mode");
static BoolOption HelpOption (false, 'h', "help", "print help");
CoUninitialize ();
}
+static void
+set_legacy (const char *command)
+{
+ char buf[MAX_PATH];
+ GetLongPathName (command, buf, MAX_PATH);
+ strlwr (buf);
+ is_legacy = strstr (buf, "setup-legacy");
+}
+
#ifndef __CYGWIN__
int WINAPI
WinMain (HINSTANCE h,
snprintf(locale, sizeof locale, ".%u", GetACP());
setlocale(LC_ALL, locale);
- if (!IsWindowsNT ())
+ set_legacy (_argv[0]);
+
+ if (is_legacy && IsWindowsNT ())
+ {
+ if (MessageBox (NULL,
+ "You are attempting to install a legacy version of Cygwin\n"
+ "on a modern version of Windows. Press \"OK\" if this is\n"
+ "really want you want to do. Otherwise press \"Cancel\".\n"
+ "See http://cygwin.com/ for more information.",
+ "Attempt to install legacy version of Cygwin",
+ MB_OKCANCEL | MB_ICONSTOP | MB_SETFOREGROUND | MB_TOPMOST)
+ == IDCANCEL)
+ return 1;
+ }
+ else if (!is_legacy && !IsWindowsNT ())
{
MessageBox (NULL,
"Cygwin 1.7 and later does not run on Windows 95,\n"
"Windows 98, or Windows Me. If you want to install Cygwin\n"
"on one of these systems, please install an older version.\n"
"See http://cygwin.com/ for more information.",
- "Unsupported Version of Windows detected",
+ "Unsupported version of Windows detected",
MB_OK | MB_ICONSTOP | MB_SETFOREGROUND | MB_TOPMOST);
return 1;
}