Detect Winsock2?
-
Hey gang, I still have to continue to support Windows 95 (grumble). At least our minimum support is 'B'. Anyway, we also require PWS for Win 9x and IIS for 2000/XP in order to run in "Offline" mode. (Don't ask - bleh). Anyway, a ghosted "virgin" Windows 95B machine (even if you install IE 5.5 SP2) does not include Winsock2 by default, even after installing a network card and setting up Internet access and all that. Winsock2 is a required component for installing Personal Web Server. I found a download that works for me from Microsoft that puts Winsock2 in place. However, in order to make things as easy as possible for the user, we've written a "Launcher" program that steps the user through the variety of setups that are required. Bottom line: Does anyone know how I can programatically check for Winsock2 installation? Obviously the PWS install is doing it. Thanks,
-
Hey gang, I still have to continue to support Windows 95 (grumble). At least our minimum support is 'B'. Anyway, we also require PWS for Win 9x and IIS for 2000/XP in order to run in "Offline" mode. (Don't ask - bleh). Anyway, a ghosted "virgin" Windows 95B machine (even if you install IE 5.5 SP2) does not include Winsock2 by default, even after installing a network card and setting up Internet access and all that. Winsock2 is a required component for installing Personal Web Server. I found a download that works for me from Microsoft that puts Winsock2 in place. However, in order to make things as easy as possible for the user, we've written a "Launcher" program that steps the user through the variety of setups that are required. Bottom line: Does anyone know how I can programatically check for Winsock2 installation? Obviously the PWS install is doing it. Thanks,
Option 1. On detection of Win95 you should format the system-drive or similar. :-) Option 2. Check the registy key below exists. HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\WinSock2\Parameters and check the Winsock_Registry_Version value, I'd go for option 1 of course. :-) Regardz Colin J Davies
Sonork ID 100.9197:Colin
I live in Bob's HungOut now
-
Hey gang, I still have to continue to support Windows 95 (grumble). At least our minimum support is 'B'. Anyway, we also require PWS for Win 9x and IIS for 2000/XP in order to run in "Offline" mode. (Don't ask - bleh). Anyway, a ghosted "virgin" Windows 95B machine (even if you install IE 5.5 SP2) does not include Winsock2 by default, even after installing a network card and setting up Internet access and all that. Winsock2 is a required component for installing Personal Web Server. I found a download that works for me from Microsoft that puts Winsock2 in place. However, in order to make things as easy as possible for the user, we've written a "Launcher" program that steps the user through the variety of setups that are required. Bottom line: Does anyone know how I can programatically check for Winsock2 installation? Obviously the PWS install is doing it. Thanks,
Do a LoadLibrary("ws2_32"); If it fails, WinSock 2 is not installed. --Mike-- "COM didn't solve the old version of DLL hell - it just provided us with a new and improved version of hell." -- John Simmons, 1/22/2002 My really out-of-date homepage Sonork - 100.10414 AcidHelm Big fan of Alyson Hannigan.
-
Option 1. On detection of Win95 you should format the system-drive or similar. :-) Option 2. Check the registy key below exists. HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\WinSock2\Parameters and check the Winsock_Registry_Version value, I'd go for option 1 of course. :-) Regardz Colin J Davies
Sonork ID 100.9197:Colin
I live in Bob's HungOut now
Colin Davies wrote: Option 1. On detection of Win95 you should format the system-drive or similar. That's the last time I run anything you send me, Colin. :P Simon C++: Only friends can see your private parts. Sonork ID 100.10024
-
Hey gang, I still have to continue to support Windows 95 (grumble). At least our minimum support is 'B'. Anyway, we also require PWS for Win 9x and IIS for 2000/XP in order to run in "Offline" mode. (Don't ask - bleh). Anyway, a ghosted "virgin" Windows 95B machine (even if you install IE 5.5 SP2) does not include Winsock2 by default, even after installing a network card and setting up Internet access and all that. Winsock2 is a required component for installing Personal Web Server. I found a download that works for me from Microsoft that puts Winsock2 in place. However, in order to make things as easy as possible for the user, we've written a "Launcher" program that steps the user through the variety of setups that are required. Bottom line: Does anyone know how I can programatically check for Winsock2 installation? Obviously the PWS install is doing it. Thanks,
You could try the API function int WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData); You can check the highest version supplied in lpWSAData->wHighVersion. (version encoded as: MAKEWORD(2, 0) for Winsock 2.0). Well, anyway this is what the manual says... Jan "It could have been worse, it could have been ME!"
-
You could try the API function int WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData); You can check the highest version supplied in lpWSAData->wHighVersion. (version encoded as: MAKEWORD(2, 0) for Winsock 2.0). Well, anyway this is what the manual says... Jan "It could have been worse, it could have been ME!"
Yep, here's what we do at the shop to test for 2.2: iErr = WSAStartup(wVersionRequested, &wsaData); if (!iErr) { // Confirm that the WinSock DLL supports 2.2. // Note that if the DLL supports versions greater // than 2.2 in addition to 2.2, it will still return // 2.2 in wVersion since that is the version we // requested. if ( LOBYTE( wsaData.wVersion ) != 2 || HIBYTE( wsaData.wVersion ) != 2 ) { BarkAndWhine(_T("CIdsSocket::WinsockInit() - Could not find a usable WinSock DLL for version %d.%d"), byVersionHigh, byVersionLow); } else { // The WinSock DLL is acceptable. Proceed. } } Chistopher Duncan Author - The Career Programmer: Guerilla Tactics for an Imperfect World (Apress)