VBoxHostVersion.cpp revision ccb71e178f4485d3f944134b5d453faada549800
0N/A/* $Id$ */
0N/A/** @file
0N/A * VBoxHostVersion - Checks the host's VirtualBox version and notifies
0N/A * the user in case of an update.
0N/A */
0N/A
0N/A/*
0N/A * Copyright (C) 2009 Sun Microsystems, Inc.
0N/A *
0N/A * This file is part of VirtualBox Open Source Edition (OSE), as
0N/A * available from http://www.virtualbox.org. This file is free software;
0N/A * you can redistribute it and/or modify it under the terms of the GNU
0N/A * General Public License (GPL) as published by the Free Software
0N/A * Foundation, in version 2 as it comes in the "COPYING" file of the
0N/A * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
0N/A * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
0N/A *
0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
0N/A * Clara, CA 95054 USA or visit http://www.sun.com if you need
0N/A * additional information or have any questions.
0N/A */
0N/A
0N/A#include "VBoxHostVersion.h"
0N/A#include "VBoxTray.h"
0N/A#include "helpers.h"
0N/A
0N/A#include <VBox/VBoxGuestLib.h>
0N/A
0N/A
0N/Aint VBoxCheckHostVersion ()
0N/A{
0N/A int rc;
0N/A char *pszHostVersion;
0N/A char *pszGuestVersion;
0N/A rc = VbglR3HostVersionCheckForUpdate(&pszHostVersion, &pszGuestVersion);
0N/A if (RT_SUCCESS(rc))
0N/A {
0N/A char szMsg[256]; /* Sizes according to MSDN. */
0N/A char szTitle[64];
0N/A
0N/A /** @todo add some translation macros here */
0N/A _snprintf(szTitle, sizeof(szTitle), "VirtualBox Guest Additions update available!");
0N/A _snprintf(szMsg, sizeof(szMsg), "Your guest is currently running the Guest Additions version %s. "
0N/A "We recommend updating to the latest version (%s) by choosing the "
0N/A "install option from the Devices menu.", pszGuestVersion, pszHostVersion);
0N/A
0N/A rc = showBalloonTip(gInstance, gToolWindow, ID_TRAYICON, szMsg, szTitle, 5000, 0);
0N/A if (RT_FAILURE(rc))
0N/A Log(("VBoxTray: Could not show version notifier balloon tooltip! rc = %d\n", rc));
0N/A
0N/A VbglR3GuestPropReadValueFree(pszHostVersion);
0N/A VbglR3GuestPropReadValueFree(pszGuestVersion);
0N/A }
0N/A
0N/A /* If we didn't have to check for the host version then this is not an error */
0N/A if (rc == VERR_NOT_SUPPORTED)
0N/A rc = VINF_SUCCESS;
0N/A return rc;
0N/A}
0N/A
0N/A