Skip to content

Commit 2fadfc0

Browse files
committed
Issue python#26619: Improves error message when installing on out-of-date Windows Server
1 parent 41519b2 commit 2fadfc0

File tree

2 files changed

+50
-18
lines changed

2 files changed

+50
-18
lines changed

Tools/msi/bundle/Default.wxl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,15 @@ 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
</WixLocalization>

Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp

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

3035-
if (IsWindows7SP1OrGreater()) {
3036-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows 7 SP1 or later");
3037-
return;
3038-
} else if (IsWindows7OrGreater()) {
3039-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 7 RTM");
3040-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");
3041-
LocGetString(_wixLoc, L"#(loc.FailureWin7MissingSP1)", &pLocString);
3042-
} else if (IsWindowsVistaSP2OrGreater()) {
3043-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows Vista SP2");
3044-
return;
3045-
} else if (IsWindowsVistaOrGreater()) {
3046-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Vista RTM or SP1");
3047-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 2 is required to continue installation");
3048-
LocGetString(_wixLoc, L"#(loc.FailureVistaMissingSP2)", &pLocString);
3049-
} else {
3050-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows XP or earlier");
3051-
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Vista SP2 or later is required to continue installation");
3052-
LocGetString(_wixLoc, L"#(loc.FailureXPOrEarlier)", &pLocString);
3035+
if (IsWindowsServer()) {
3036+
if (IsWindowsVersionOrGreater(6, 1, 1)) {
3037+
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows Server 2008 R2 or later");
3038+
return;
3039+
} else if (IsWindowsVersionOrGreater(6, 1, 0)) {
3040+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008 R2");
3041+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");
3042+
LocGetString(_wixLoc, L"#(loc.FailureWS2K8R2MissingSP1)", &pLocString);
3043+
} else if (IsWindowsVersionOrGreater(6, 0, 2)) {
3044+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows Server 2008 SP2 or later");
3045+
return;
3046+
} else if (IsWindowsVersionOrGreater(6, 0, 0)) {
3047+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008");
3048+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 2 is required to continue installation");
3049+
LocGetString(_wixLoc, L"#(loc.FailureWS2K8MissingSP2)", &pLocString);
3050+
} else {
3051+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2003 or earlier");
3052+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Server 2008 SP2 or later is required to continue installation");
3053+
LocGetString(_wixLoc, L"#(loc.FailureWS2K3OrEarlier)", &pLocString);
3054+
}
3055+
} else {
3056+
if (IsWindows7SP1OrGreater()) {
3057+
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 7 SP1 or later");
3058+
return;
3059+
} else if (IsWindows7OrGreater()) {
3060+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 7 RTM");
3061+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");
3062+
LocGetString(_wixLoc, L"#(loc.FailureWin7MissingSP1)", &pLocString);
3063+
} else if (IsWindowsVistaSP2OrGreater()) {
3064+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows Vista SP2");
3065+
return;
3066+
} else if (IsWindowsVistaOrGreater()) {
3067+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Vista RTM or SP1");
3068+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 2 is required to continue installation");
3069+
LocGetString(_wixLoc, L"#(loc.FailureVistaMissingSP2)", &pLocString);
3070+
} else {
3071+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows XP or earlier");
3072+
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Vista SP2 or later is required to continue installation");
3073+
LocGetString(_wixLoc, L"#(loc.FailureXPOrEarlier)", &pLocString);
3074+
}
30533075
}
30543076

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

0 commit comments

Comments
 (0)