mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	Issue #26619: Improves error message when installing on out-of-date Windows Server
This commit is contained in:
		
							parent
							
								
									41519b2ca8
								
							
						
					
					
						commit
						2fadfc0ead
					
				
					 2 changed files with 50 additions and 18 deletions
				
			
		| 
						 | 
					@ -131,5 +131,15 @@ Please <a href="https://www.bing.com/search?q=how%20to%20install%20windows%20
 | 
				
			||||||
Please <a href="https://www.bing.com/search?q=how%20to%20install%20windows%20vista%20service%20pack%202">update your machine</a> and then restart the installation.</String>
 | 
					Please <a href="https://www.bing.com/search?q=how%20to%20install%20windows%20vista%20service%20pack%202">update your machine</a> and then restart the installation.</String>
 | 
				
			||||||
  <String Id="FailureXPOrEarlier">Windows Vista or later is required to install and use [WixBundleName].
 | 
					  <String Id="FailureXPOrEarlier">Windows Vista or later is required to install and use [WixBundleName].
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Visit <a href="https://www.python.org/">python.org</a> to download Python 3.4.</String>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <String Id="FailureWS2K8R2MissingSP1">Windows Server 2008 R2 Service Pack 1 and all applicable updates are required to install [WixBundleName].
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Please <a href="https://www.bing.com/search?q=how%20to%20install%20windows%20server%202008%20r2%20service%20pack%201">update your machine</a> and then restart the installation.</String>
 | 
				
			||||||
 | 
					  <String Id="FailureWS2K8MissingSP2">Windows Server 2008 Service Pack 2 and all applicable updates are required to install [WixBundleName].
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Please <a href="https://www.bing.com/search?q=how%20to%20install%20windows%20server%202008%20service%20pack%202">update your machine</a> and then restart the installation.</String>
 | 
				
			||||||
 | 
					  <String Id="FailureWS2K3OrEarlier">Windows Server 2008 SP2 or later is required to install and use [WixBundleName].
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Visit <a href="https://www.python.org/">python.org</a> to download Python 3.4.</String>
 | 
					Visit <a href="https://www.python.org/">python.org</a> to download Python 3.4.</String>
 | 
				
			||||||
</WixLocalization>
 | 
					</WixLocalization>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3032,24 +3032,46 @@ private:
 | 
				
			||||||
    void ValidateOperatingSystem() {
 | 
					    void ValidateOperatingSystem() {
 | 
				
			||||||
        LOC_STRING *pLocString = nullptr;
 | 
					        LOC_STRING *pLocString = nullptr;
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        if (IsWindows7SP1OrGreater()) {
 | 
					        if (IsWindowsServer()) {
 | 
				
			||||||
            BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows 7 SP1 or later");
 | 
					            if (IsWindowsVersionOrGreater(6, 1, 1)) {
 | 
				
			||||||
            return;
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows Server 2008 R2 or later");
 | 
				
			||||||
        } else if (IsWindows7OrGreater()) {
 | 
					                return;
 | 
				
			||||||
            BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 7 RTM");
 | 
					            } else if (IsWindowsVersionOrGreater(6, 1, 0)) {
 | 
				
			||||||
            BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008 R2");
 | 
				
			||||||
            LocGetString(_wixLoc, L"#(loc.FailureWin7MissingSP1)", &pLocString);
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");
 | 
				
			||||||
        } else if (IsWindowsVistaSP2OrGreater()) {
 | 
					                LocGetString(_wixLoc, L"#(loc.FailureWS2K8R2MissingSP1)", &pLocString);
 | 
				
			||||||
            BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows Vista SP2");
 | 
					            } else if (IsWindowsVersionOrGreater(6, 0, 2)) {
 | 
				
			||||||
            return;
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows Server 2008 SP2 or later");
 | 
				
			||||||
        } else if (IsWindowsVistaOrGreater()) {
 | 
					                return;
 | 
				
			||||||
            BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Vista RTM or SP1");
 | 
					            } else if (IsWindowsVersionOrGreater(6, 0, 0)) {
 | 
				
			||||||
            BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 2 is required to continue installation");
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008");
 | 
				
			||||||
            LocGetString(_wixLoc, L"#(loc.FailureVistaMissingSP2)", &pLocString);
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 2 is required to continue installation");
 | 
				
			||||||
 | 
					                LocGetString(_wixLoc, L"#(loc.FailureWS2K8MissingSP2)", &pLocString);
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2003 or earlier");
 | 
				
			||||||
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Server 2008 SP2 or later is required to continue installation");
 | 
				
			||||||
 | 
					                LocGetString(_wixLoc, L"#(loc.FailureWS2K3OrEarlier)", &pLocString);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows XP or earlier");
 | 
					            if (IsWindows7SP1OrGreater()) {
 | 
				
			||||||
            BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Vista SP2 or later is required to continue installation");
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 7 SP1 or later");
 | 
				
			||||||
            LocGetString(_wixLoc, L"#(loc.FailureXPOrEarlier)", &pLocString);
 | 
					                return;
 | 
				
			||||||
 | 
					            } else if (IsWindows7OrGreater()) {
 | 
				
			||||||
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 7 RTM");
 | 
				
			||||||
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");
 | 
				
			||||||
 | 
					                LocGetString(_wixLoc, L"#(loc.FailureWin7MissingSP1)", &pLocString);
 | 
				
			||||||
 | 
					            } else if (IsWindowsVistaSP2OrGreater()) {
 | 
				
			||||||
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Target OS is Windows Vista SP2");
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					            } else if (IsWindowsVistaOrGreater()) {
 | 
				
			||||||
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Vista RTM or SP1");
 | 
				
			||||||
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 2 is required to continue installation");
 | 
				
			||||||
 | 
					                LocGetString(_wixLoc, L"#(loc.FailureVistaMissingSP2)", &pLocString);
 | 
				
			||||||
 | 
					            } else { 
 | 
				
			||||||
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows XP or earlier");
 | 
				
			||||||
 | 
					                BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Windows Vista SP2 or later is required to continue installation");
 | 
				
			||||||
 | 
					                LocGetString(_wixLoc, L"#(loc.FailureXPOrEarlier)", &pLocString);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (pLocString && pLocString->wzText) {
 | 
					        if (pLocString && pLocString->wzText) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue