static BoolOption WaitOption (false, 'W', "wait", "When elevating, wait for elevated child process");
static BoolOption HelpOption (false, 'h', "help", "print help");
static StringOption SetupBaseNameOpt ("setup", 'i', "ini-basename", "Use a different basename, e.g. \"foo\", instead of \"setup\"", false);
+BoolOption UnsupportedOption (false, '0', "allow-unsupported-windows", "Allow old, unsupported Windows versions");
std::string SetupBaseName;
static void inline
<< setup_version << endLog;
}
- /* Check if Cygwin works on this Windows version */
- if (OSMajorVersion () < 6)
- {
- mbox (NULL, "Cygwin is not supported on this Windows version",
- "Cygwin Setup", MB_ICONEXCLAMATION | MB_OK);
- Logger ().exit (1, false);
- }
-
if (help_option)
{
if (invalid_option)
GetOption::GetInstance ().ParameterUsage (Log (LOG_PLAIN));
Log (LOG_PLAIN) << endLog;
Logger ().exit (invalid_option ? 1 : 0, false);
+ goto finish_up;
}
- else if (elevate)
+
+ /* Check if Cygwin works on this Windows version */
+ if (!UnsupportedOption && (OSMajorVersion () < 6))
+ {
+ mbox (NULL, "Cygwin is not supported on this Windows version",
+ "Cygwin Setup", MB_ICONEXCLAMATION | MB_OK);
+ Logger ().exit (1, false);
+ }
+
+ if (elevate)
{
char exe_path[MAX_PATH];
if (!GetModuleFileName(NULL, exe_path, ARRAYSIZE(exe_path)))
StringArrayOption SiteOption('s', "site", "Download site");
BoolOption OnlySiteOption(false, 'O', "only-site", "Ignore all sites except for -s");
+extern BoolOption UnsupportedOption;
SiteSetting::SiteSetting (): saved (false)
{
getSavedSites ();
}
+const char *
+SiteSetting::lastMirrorKey ()
+{
+ if (UnsupportedOption)
+ return "last-mirror-unsupported";
+
+ return "last-mirror";
+}
+
void
SiteSetting::save()
{
- io_stream *f = UserSettings::instance().open ("last-mirror");
+ io_stream *f = UserSettings::instance().open (lastMirrorKey ());
if (f)
{
for (SiteList::const_iterator n = site_list.begin ();
char mirror_url[1000];
char *theMirrorString, *theCachedString;
+
+ if (UnsupportedOption)
+ return 0;
+
const char *cached_mirrors = OnlySiteOption ? NULL : UserSettings::instance().get ("mirrors-lst");
if (cached_mirrors)
{
void
SiteSetting::getSavedSites ()
{
- const char *buf = UserSettings::instance().get ("last-mirror");
+ const char *buf = UserSettings::instance().get (lastMirrorKey ());
if (!buf)
return;
char *fg_ret = strdup (buf);