Skip to content

Commit 7a35b1c

Browse files
committed
Issue #26619: Improves error message when installing on out-of-date Windows Server
2 parents a845a81 + 2fadfc0 commit 7a35b1c

2 files changed

Lines changed: 50 additions & 18 deletions

File tree

Tools/msi/bundle/Default.wxl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@ Please <a href="https://www.bing.com/search?q=how%20to%20install%20windows%20
131131
Please &lt;a href="https://www.bing.com/search?q=how%20to%20install%20windows%20vista%20service%20pack%202"&gt;update your machine&lt;/a&gt; and then restart the installation.</String>
132132
<String Id="FailureXPOrEarlier">Windows Vista or later is required to install and use [WixBundleName].
133133

134+
Visit &lt;a href="https://www.python.org/"&gt;python.org&lt;/a&gt; to download Python 3.4.</String>
135+
136+
<String Id="FailureWS2K8R2MissingSP1">Windows Server 2008 R2 Service Pack 1 and all applicable updates are required to install [WixBundleName].
137+
138+
Please &lt;a href="https://www.bing.com/search?q=how%20to%20install%20windows%20server%202008%20r2%20service%20pack%201"&gt;update your machine&lt;/a&gt; and then restart the installation.</String>
139+
<String Id="FailureWS2K8MissingSP2">Windows Server 2008 Service Pack 2 and all applicable updates are required to install [WixBundleName].
140+
141+
Please &lt;a href="https://www.bing.com/search?q=how%20to%20install%20windows%20server%202008%20service%20pack%202"&gt;update your machine&lt;/a&gt; and then restart the installation.</String>
142+
<String Id="FailureWS2K3OrEarlier">Windows Server 2008 SP2 or later is required to install and use [WixBundleName].
143+
134144
Visit &lt;a href="https://www.python.org/"&gt;python.org&lt;/a&gt; to download Python 3.4.</String>
135145

136146
<String Id="SuccessMaxPathButton">Disable path length limit</String>

Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3017,24 +3017,46 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
30173017
void ValidateOperatingSystem() {
30183018
LOC_STRING *pLocString = nullptr;
30193019

3020-
if (IsWindows7SP1OrGreater()) {
3021-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows 7 SP1 or later");
3022-
return;
3023-
} else if (IsWindows7OrGreater()) {
3024-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 7 RTM");
3025-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");
3026-
LocGetString(_wixLoc, L"#(loc.FailureWin7MissingSP1)", &pLocString);
3027-
} else if (IsWindowsVistaSP2OrGreater()) {
3028-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows Vista SP2");
3029-
return;
3030-
} else if (IsWindowsVistaOrGreater()) {
3031-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Vista RTM or SP1");
3032-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 2 is required to continue installation");
3033-
LocGetString(_wixLoc, L"#(loc.FailureVistaMissingSP2)", &pLocString);
3034-
} else {
3035-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows XP or earlier");
3036-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Vista SP2 or later is required to continue installation");
3037-
LocGetString(_wixLoc, L"#(loc.FailureXPOrEarlier)", &pLocString);
3020+
if (IsWindowsServer()) {
3021+
if (IsWindowsVersionOrGreater(6, 1, 1)) {
3022+
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows Server 2008 R2 or later");
3023+
return;
3024+
} else if (IsWindowsVersionOrGreater(6, 1, 0)) {
3025+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008 R2");
3026+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");
3027+
LocGetString(_wixLoc, L"#(loc.FailureWS2K8R2MissingSP1)", &pLocString);
3028+
} else if (IsWindowsVersionOrGreater(6, 0, 2)) {
3029+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows Server 2008 SP2 or later");
3030+
return;
3031+
} else if (IsWindowsVersionOrGreater(6, 0, 0)) {
3032+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008");
3033+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 2 is required to continue installation");
3034+
LocGetString(_wixLoc, L"#(loc.FailureWS2K8MissingSP2)", &pLocString);
3035+
} else {
3036+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2003 or earlier");
3037+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Server 2008 SP2 or later is required to continue installation");
3038+
LocGetString(_wixLoc, L"#(loc.FailureWS2K3OrEarlier)", &pLocString);
3039+
}
3040+
} else {
3041+
if (IsWindows7SP1OrGreater()) {
3042+
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 7 SP1 or later");
3043+
return;
3044+
} else if (IsWindows7OrGreater()) {
3045+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 7 RTM");
3046+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");
3047+
LocGetString(_wixLoc, L"#(loc.FailureWin7MissingSP1)", &pLocString);
3048+
} else if (IsWindowsVistaSP2OrGreater()) {
3049+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows Vista SP2");
3050+
return;
3051+
} else if (IsWindowsVistaOrGreater()) {
3052+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Vista RTM or SP1");
3053+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 2 is required to continue installation");
3054+
LocGetString(_wixLoc, L"#(loc.FailureVistaMissingSP2)", &pLocString);
3055+
} else {
3056+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows XP or earlier");
3057+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Vista SP2 or later is required to continue installation");
3058+
LocGetString(_wixLoc, L"#(loc.FailureXPOrEarlier)", &pLocString);
3059+
}
30383060
}
30393061

30403062
if (pLocString && pLocString->wzText) {

0 commit comments

Comments
 (0)