Skip to content

Commit

Permalink
Merge commit '5bedd6bf4afc39fea08e5e44c2e074221b0cc826' into mac_bran…
Browse files Browse the repository at this point in the history
…ded_installer_build_script

* commit '5bedd6bf4afc39fea08e5e44c2e074221b0cc826':
  Mac: Finish implementing fixes to installer for issues under OS 10.13 High Sierra when multiple users are to be allowed to run BOINC Manager
  [Client] [WSL] Fix xml output
  Mac: continue implementing fixes to installer for issues under OS 10.13 High Sierra when multiple users are to be allowed to run BOINC Manager
  Mac: continue implementing fixes to installer for issues under OS 10.13 High Sierra when multiple users are to be allowed to run BOINC Manager
  [Client] [WSL] Add missed CloseHandle()
  Mac: begin fixes to installer for issues under OS 10.13 High Sierra when multiple users are to be allowed to run BOINC Manager  - fix setting or deleting Login Items for users other than the one running the installer  - fix setting the screensaver for users other than the one running the installer
  [Client] [WSL] Fix Windows build
  [Client] [WSL] Extend detection.
  web: let project customize "Want to help more?" list
  web: home page: don't show credit as FLOPS.  Might not be correct.
  web: finish (I think) handling all the "join" scenarios sensibly. The degrees of freedom include - whether the project is vetted, has an ID an therefore can use autoattach - whether the user already has an account - whether the user is logged in
  web: tweaks to sample home page
  web: change semantics of download.php?dev=1 so that it uses the dev version if there is one, else the recommended version
  - add some tra()s
  - parse project ID correctly
  Web: tweaks to signup logic and forum tables
  • Loading branch information
Charlie Fenton committed Jun 28, 2018
2 parents 2260ee5 + 5bedd6b commit c486905
Show file tree
Hide file tree
Showing 38 changed files with 2,059 additions and 998 deletions.
1 change: 1 addition & 0 deletions client/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ boinc_client_LDFLAGS = $(AM_LDFLAGS) $(SSL_LDFLAGS) -L$(top_srcdir)/lib
if OS_WIN32
boinc_client_CXXFLAGS += -I$(top_srcdir)/coprocs/NVIDIA/include
boinc_client_SOURCES += hostinfo_win.cpp \
hostinfo_wsl.cpp \
sysmon_win.cpp \
win/boinc_cli.rc \
win/res/boinc.ico
Expand Down
18 changes: 14 additions & 4 deletions client/client_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,20 @@ void CLIENT_STATE::show_host_info() {
);

#ifdef _WIN64
if (host_info.os_wsl_enabled) {
msg_printf(NULL, MSG_INFO,
"WSL detected: %s: %s", host_info.os_wsl_name, host_info.os_wsl_version
);
if (host_info.wsl_available) {
msg_printf(NULL, MSG_INFO, "WSL detected:");
for (size_t i = 0; i < host_info.wsls.wsls.size(); ++i) {
const WSL& wsl = host_info.wsls.wsls[i];
if (wsl.is_default) {
msg_printf(NULL, MSG_INFO,
" [%s] (default): %s (%s)", wsl.distro_name.c_str(), wsl.name.c_str(), wsl.version.c_str()
);
} else {
msg_printf(NULL, MSG_INFO,
" [%s]: %s (%s)", wsl.distro_name.c_str(), wsl.name.c_str(), wsl.version.c_str()
);
}
}
} else {
msg_printf(NULL, MSG_INFO, "No WSL found.");
}
Expand Down
46 changes: 24 additions & 22 deletions client/hostinfo_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,21 @@ int get_memory_info(double& bytes, double& swap) {

typedef BOOL (WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);

BOOL get_OSVERSIONINFO(OSVERSIONINFOEX& osvi) {
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
// Try calling GetVersionEx using the OSVERSIONINFOEX structure.
// If that fails, try using the OSVERSIONINFO structure.
BOOL bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO*)&osvi);
if (!bOsVersionInfoEx) {
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO*)&osvi);
}
return bOsVersionInfoEx;
}

int get_os_information(
char* os_name, const int os_name_size, char* os_version, const int os_version_size,
bool& os_wsl_enabled, char* os_wsl_name, const int os_wsl_name_size, char* os_wsl_version, const int os_wsl_version_size
char* os_name, const int os_name_size, char* os_version, const int os_version_size
) {
// This code snip-it was copied straight out of the MSDN Platform SDK
// Getting the System Version example and modified to dump the output
Expand All @@ -330,29 +342,18 @@ int get_os_information(
OSVERSIONINFOEX osvi;
SYSTEM_INFO si;
PGPI pGPI;
BOOL bOsVersionInfoEx;
DWORD dwType = 0;

ZeroMemory(szVersion, sizeof(szVersion));
ZeroMemory(szSKU, sizeof(szSKU));
ZeroMemory(szServicePack, sizeof(szServicePack));
ZeroMemory(&si, sizeof(SYSTEM_INFO));
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);


// GetProductInfo is a Vista+ API
pGPI = (PGPI) GetProcAddress(GetModuleHandle(_T("kernel32.dll")), "GetProductInfo");


// Try calling GetVersionEx using the OSVERSIONINFOEX structure.
// If that fails, try using the OSVERSIONINFO structure.
bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO*)&osvi);
if(!bOsVersionInfoEx) {
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx ((OSVERSIONINFO*)&osvi);
}

BOOL bOsVersionInfoEx = get_OSVERSIONINFO(osvi);

GetNativeSystemInfo(&si);

Expand Down Expand Up @@ -943,12 +944,6 @@ int get_os_information(

snprintf( os_version, os_version_size, "%s%s%s", szSKU, szServicePack, szVersion );

#ifdef _WIN64
if (osvi.dwMajorVersion >= 10) {
return get_wsl_information(os_wsl_enabled, os_wsl_name, os_wsl_name_size, os_wsl_version, os_wsl_version_size);
}
#endif

return 0;
}

Expand Down Expand Up @@ -1436,9 +1431,16 @@ int HOST_INFO::get_host_info(bool init) {
if (!init) return 0;
::get_memory_info(m_nbytes, m_swap);
get_os_information(
os_name, sizeof(os_name), os_version, sizeof(os_version),
os_wsl_enabled, os_wsl_name, sizeof(os_wsl_name), os_wsl_version, sizeof(os_wsl_version)
os_name, sizeof(os_name), os_version, sizeof(os_version)
);
#ifdef _WIN64
if (!cc_config.dont_use_wsl) {
OSVERSIONINFOEX osvi;
if (get_OSVERSIONINFO(osvi) && osvi.dwMajorVersion >= 10) {
get_wsl_information(wsl_available, wsls);
}
}
#endif
if (!cc_config.dont_use_vbox) {
get_virtualbox_version();
}
Expand Down
Loading

0 comments on commit c486905

Please sign in to comment.