diff options
Diffstat (limited to 'src/VBox/Additions/WINNT/Installer')
20 files changed, 945 insertions, 577 deletions
diff --git a/src/VBox/Additions/WINNT/Installer/InstallHelper/VBoxGuestInstallHelper.cpp b/src/VBox/Additions/WINNT/Installer/InstallHelper/VBoxGuestInstallHelper.cpp index 5a27edf4..61492be0 100644 --- a/src/VBox/Additions/WINNT/Installer/InstallHelper/VBoxGuestInstallHelper.cpp +++ b/src/VBox/Additions/WINNT/Installer/InstallHelper/VBoxGuestInstallHelper.cpp @@ -4,7 +4,7 @@ */ /* - * Copyright (C) 2011 Oracle Corporation + * Copyright (C) 2011-2013 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -25,6 +25,12 @@ #include <strsafe.h> #include "exdll.h" +#include <iprt/err.h> +#include <iprt/initterm.h> +#include <iprt/localipc.h> +#include <iprt/mem.h> +#include <iprt/string.h> + /* Required structures/defines of VBoxTray. */ #include "../../VBoxTray/VBoxTrayMsg.h" @@ -48,6 +54,9 @@ HINSTANCE g_hInstance; HWND g_hwndParent; PFNSFCFILEEXCEPTION g_pfnSfcFileException = NULL; +/** + * @todo Clean up this DLL, use more IPRT in here! + */ /** * Pops (gets) a value from the internal NSIS stack. @@ -62,7 +71,7 @@ static HRESULT vboxPopString(TCHAR *pszDest, size_t cchDest) { HRESULT hr = S_OK; if (!g_stacktop || !*g_stacktop) - hr = __HRESULT_FROM_WIN32(ERROR_EMPTY); + hr = __HRESULT_FROM_WIN32(ERROR_INVALID_HANDLE); else { stack_t *pStack = (*g_stacktop); @@ -75,6 +84,8 @@ static HRESULT vboxPopString(TCHAR *pszDest, size_t cchDest) GlobalFree((HGLOBAL)pStack); } } + else + hr = __HRESULT_FROM_WIN32(ERROR_INVALID_HANDLE); } return hr; } @@ -114,6 +125,45 @@ static void vboxPushResultAsString(HRESULT hr) pushstring(szErr); } +/** + * Connects to VBoxTray IPC under the behalf of the user running + * in the current thread context. + * + * @return IPRT status code. + * @param phSession Where to store the IPC session. + */ +static int vboxConnectToVBoxTray(RTLOCALIPCSESSION *phSession) +{ + int rc = VINF_SUCCESS; + + RTUTF16 wszUserName[255]; + DWORD cchUserName = sizeof(wszUserName) / sizeof(RTUTF16); + BOOL fRc = GetUserNameW(wszUserName, &cchUserName); + if (!fRc) + rc = RTErrConvertFromWin32(GetLastError()); + + if (RT_SUCCESS(rc)) + { + char *pszUserName; + rc = RTUtf16ToUtf8(wszUserName, &pszUserName); + if (RT_SUCCESS(rc)) + { + char szPipeName[255]; + if (RTStrPrintf(szPipeName, sizeof(szPipeName), "%s%s", + VBOXTRAY_IPC_PIPE_PREFIX, pszUserName)) + { + rc = RTLocalIpcSessionConnect(phSession, szPipeName, 0 /* Flags */); + } + else + rc = VERR_NO_MEMORY; + + RTStrFree(pszUserName); + } + } + + return rc; +} + static void vboxChar2WCharFree(PWCHAR pwString) { if (pwString) @@ -143,56 +193,22 @@ static HRESULT vboxChar2WCharAlloc(const char *pszString, PWCHAR *ppwString) return hr; } -static HANDLE vboxIPCConnect(void) +/** + * Loads a system DLL. + * + * @returns Module handle or NULL + * @param pszName The DLL name. + */ +static HMODULE loadSystemDll(const char *pszName) { - HANDLE hPipe = NULL; - while (1) - { - hPipe = CreateFile(VBOXTRAY_PIPE_IPC, /* Pipe name. */ - GENERIC_READ | /* Read and write access. */ - GENERIC_WRITE, - 0, /* No sharing. */ - NULL, /* Default security attributes. */ - OPEN_EXISTING, /* Opens existing pipe. */ - 0, /* Default attributes. */ - NULL); /* No template file. */ - - /* Break if the pipe handle is valid. */ - if (hPipe != INVALID_HANDLE_VALUE) - break; - - /* Exit if an error other than ERROR_PIPE_BUSY occurs. */ - if (GetLastError() != ERROR_PIPE_BUSY) - return NULL; - - /* All pipe instances are busy, so wait for 20 seconds. */ - if (!WaitNamedPipe(VBOXTRAY_PIPE_IPC, 20000)) - return NULL; - } - - /* The pipe connected; change to message-read mode. */ - DWORD dwMode = PIPE_READMODE_MESSAGE; - BOOL fSuccess = SetNamedPipeHandleState(hPipe, /* Pipe handle. */ - &dwMode, /* New pipe mode. */ - NULL, /* Don't set maximum bytes. */ - NULL); /* Don't set maximum time. */ - if (!fSuccess) + char szPath[MAX_PATH]; + UINT cchPath = GetSystemDirectoryA(szPath, sizeof(szPath)); + size_t cbName = strlen(pszName) + 1; + if (cchPath + 1 + cbName > sizeof(szPath)) return NULL; - return hPipe; -} - -static void vboxIPCDisconnect(HANDLE hPipe) -{ - CloseHandle(hPipe); -} - -static HRESULT vboxIPCWriteMessage(HANDLE hPipe, BYTE *pMessage, DWORD cbMessage) -{ - HRESULT hr = S_OK; - DWORD cbWritten = 0; - if (!WriteFile(hPipe, pMessage, cbMessage - cbWritten, &cbWritten, 0)) - hr = HRESULT_FROM_WIN32(GetLastError()); - return hr; + szPath[cchPath] = '\\'; + memcpy(&szPath[cchPath + 1], pszName, cbName); + return LoadLibraryA(szPath); } /** @@ -213,7 +229,7 @@ VBOXINSTALLHELPER_EXPORT DisableWFP(HWND hwndParent, int string_size, HRESULT hr = vboxPopString(szFile, sizeof(szFile) / sizeof(TCHAR)); if (SUCCEEDED(hr)) { - HMODULE hSFC = LoadLibrary("sfc_os.dll"); + HMODULE hSFC = loadSystemDll("sfc_os.dll"); /** @todo Replace this by RTLdr APIs. */ if (NULL != hSFC) { g_pfnSfcFileException = (PFNSFCFILEEXCEPTION)GetProcAddress(hSFC, "SfcFileException"); @@ -426,31 +442,62 @@ VBOXINSTALLHELPER_EXPORT VBoxTrayShowBallonMsg(HWND hwndParent, int string_size, { EXDLL_INIT(); - VBOXTRAYIPCHEADER hdr; - hdr.ulMsg = VBOXTRAYIPCMSGTYPE_SHOWBALLOONMSG; - hdr.cbBody = sizeof(VBOXTRAYIPCMSG_SHOWBALLOONMSG); - - VBOXTRAYIPCMSG_SHOWBALLOONMSG msg; - HRESULT hr = vboxPopString(msg.szContent, sizeof(msg.szContent) / sizeof(TCHAR)); - if (SUCCEEDED(hr)) - hr = vboxPopString(msg.szTitle, sizeof(msg.szTitle) / sizeof(TCHAR)); + char szMsg[256]; + char szTitle[128]; + HRESULT hr = vboxPopString(szMsg, sizeof(szMsg) / sizeof(char)); if (SUCCEEDED(hr)) - hr = vboxPopULong(&msg.ulType); - if (SUCCEEDED(hr)) - hr = vboxPopULong(&msg.ulShowMS); + hr = vboxPopString(szTitle, sizeof(szTitle) / sizeof(char)); + + /** @todo Do we need to restore the stack on failure? */ if (SUCCEEDED(hr)) { - msg.ulFlags = 0; - - HANDLE hPipe = vboxIPCConnect(); - if (hPipe) + RTR3InitDll(0); + + uint32_t cbMsg = sizeof(VBOXTRAYIPCMSG_SHOWBALLOONMSG) + + strlen(szMsg) + 1 /* Include terminating zero */ + + strlen(szTitle) + 1; /* Dito. */ + Assert(cbMsg); + PVBOXTRAYIPCMSG_SHOWBALLOONMSG pIpcMsg = + (PVBOXTRAYIPCMSG_SHOWBALLOONMSG)RTMemAlloc(cbMsg); + if (pIpcMsg) { - hr = vboxIPCWriteMessage(hPipe, (BYTE*)&hdr, sizeof(VBOXTRAYIPCHEADER)); + /* Stuff in the strings. */ + memcpy(pIpcMsg->szMsgContent, szMsg, strlen(szMsg) + 1); + memcpy(pIpcMsg->szMsgTitle, szTitle, strlen(szTitle) + 1); + + /* Pop off the values in reverse order from the stack. */ + if (SUCCEEDED(hr)) + hr = vboxPopULong((ULONG*)&pIpcMsg->uType); + if (SUCCEEDED(hr)) + hr = vboxPopULong((ULONG*)&pIpcMsg->uShowMS); + if (SUCCEEDED(hr)) - hr = vboxIPCWriteMessage(hPipe, (BYTE*)&msg, sizeof(VBOXTRAYIPCMSG_SHOWBALLOONMSG)); - vboxIPCDisconnect(hPipe); + { + RTLOCALIPCSESSION hSession = 0; + int rc = vboxConnectToVBoxTray(&hSession); + if (RT_SUCCESS(rc)) + { + VBOXTRAYIPCHEADER ipcHdr = { VBOXTRAY_IPC_HDR_MAGIC, 0 /* Header version */, + VBOXTRAYIPCMSGTYPE_SHOWBALLOONMSG, cbMsg }; + + rc = RTLocalIpcSessionWrite(hSession, &ipcHdr, sizeof(ipcHdr)); + if (RT_SUCCESS(rc)) + rc = RTLocalIpcSessionWrite(hSession, pIpcMsg, cbMsg); + + int rc2 = RTLocalIpcSessionClose(hSession); + if (RT_SUCCESS(rc)) + rc = rc2; + } + + if (RT_FAILURE(rc)) + hr = __HRESULT_FROM_WIN32(ERROR_BROKEN_PIPE); + } + + RTMemFree(pIpcMsg); } + else + hr = __HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY); } /* Push simple return value on stack. */ diff --git a/src/VBox/Additions/WINNT/Installer/Languages/English.nsh b/src/VBox/Additions/WINNT/Installer/Languages/English.nsh index 45b64a3b..8bb69a28 100644 --- a/src/VBox/Additions/WINNT/Installer/Languages/English.nsh +++ b/src/VBox/Additions/WINNT/Installer/Languages/English.nsh @@ -3,7 +3,7 @@ ; ; -; Copyright (C) 2006-2012 Oracle Corporation +; Copyright (C) 2006-2014 Oracle Corporation ; ; This file is part of VirtualBox Open Source Edition (OSE), as ; available from http://www.virtualbox.org. This file is free software; @@ -14,24 +14,24 @@ ; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. ; -LangString VBOX_TEST ${LANG_ENGLISH} "This is a test message of $(^Name)!" +LangString VBOX_TEST ${LANG_ENGLISH} "This is a test message of $(^Name)!" -LangString VBOX_NOADMIN ${LANG_ENGLISH} "You need administrator rights to install or uninstall the $(^Name).$\r$\nThis application will exit now." +LangString VBOX_NOADMIN ${LANG_ENGLISH} "You need administrator rights to install or uninstall the $(^Name).$\r$\nThis application will exit now." -LangString VBOX_NOTICE_ARCH_X86 ${LANG_ENGLISH} "This application only runs on 32-bit Windows systems. Please install the 64-bit version of $(^Name)!" -LangString VBOX_NOTICE_ARCH_AMD64 ${LANG_ENGLISH} "This application only runs on 64-bit Windows systems. Please install the 32-bit version of $(^Name)!" -LangString VBOX_NT4_NO_SP6 ${LANG_ENGLISH} "You do not seem to have Service Pack 6 for Windows NT4 installed.$\r$\nWe recommend that you install it first. Do you wish to continue anyway?" +LangString VBOX_NOTICE_ARCH_X86 ${LANG_ENGLISH} "This application only runs on 32-bit Windows systems. Please install the 64-bit version of $(^Name)!" +LangString VBOX_NOTICE_ARCH_AMD64 ${LANG_ENGLISH} "This application only runs on 64-bit Windows systems. Please install the 32-bit version of $(^Name)!" +LangString VBOX_NT4_NO_SP6 ${LANG_ENGLISH} "You do not seem to have Service Pack 6 for Windows NT4 installed.$\r$\nWe recommend that you install it first. Do you wish to continue anyway?" -LangString VBOX_PLATFORM_UNSUPPORTED ${LANG_ENGLISH} "The VirtualBox Guest Additions cannot be installed on this version of Windows" +LangString VBOX_PLATFORM_UNSUPPORTED ${LANG_ENGLISH} "The VirtualBox Guest Additions cannot be installed on this version of Windows" -LangString VBOX_SUN_FOUND ${LANG_ENGLISH} "An old version of the Sun VirtualBox Guest Additions is installed in this virtual machine. This must be uninstalled before the current Guest Additions can be installed.$\r$\n$\r$\nDo you wish to uninstall the old Guest Additions now?" -LangString VBOX_SUN_ABORTED ${LANG_ENGLISH} "The VirtualBox Guest Additions cannot be installed until the old version has been removed. Please remove it and try again." +LangString VBOX_SUN_FOUND ${LANG_ENGLISH} "An old version of the Sun VirtualBox Guest Additions is installed in this virtual machine. This must be uninstalled before the current Guest Additions can be installed.$\r$\n$\r$\nDo you wish to uninstall the old Guest Additions now?" +LangString VBOX_SUN_ABORTED ${LANG_ENGLISH} "The VirtualBox Guest Additions cannot be installed until the old version has been removed. Please remove it and try again." -LangString VBOX_INNOTEK_FOUND ${LANG_ENGLISH} "An old version of the innotek VirtualBox Guest Additions is installed in this virtual machine. This must be uninstalled before the current Guest Additions can be installed.$\r$\n$\r$\nDo you wish to uninstall the old Guest Additions now?" -LangString VBOX_INNOTEK_ABORTED ${LANG_ENGLISH} "The VirtualBox Guest Additions cannot be installed until the old version has been removed. Please remove it and try again." +LangString VBOX_INNOTEK_FOUND ${LANG_ENGLISH} "An old version of the innotek VirtualBox Guest Additions is installed in this virtual machine. This must be uninstalled before the current Guest Additions can be installed.$\r$\n$\r$\nDo you wish to uninstall the old Guest Additions now?" +LangString VBOX_INNOTEK_ABORTED ${LANG_ENGLISH} "The VirtualBox Guest Additions cannot be installed until the old version has been removed. Please remove it and try again." -LangString VBOX_UNINSTALL_START ${LANG_ENGLISH} "Press OK to start the uninstallation process. This may take some time to complete." -LangString VBOX_UNINSTALL_REBOOT ${LANG_ENGLISH} "It is strongly recommended that you restart this virtual machine before installing the new version of the VirtualBox Guest Additions.$\r$\nPlease start the installation process again after restarting the machine.$\r$\n$\r$\nRestart now?" +LangString VBOX_UNINSTALL_START ${LANG_ENGLISH} "Press OK to start the uninstallation process. This may take some time to complete." +LangString VBOX_UNINSTALL_REBOOT ${LANG_ENGLISH} "It is strongly recommended that you restart this virtual machine before installing the new version of the VirtualBox Guest Additions.$\r$\nPlease start the installation process again after restarting the machine.$\r$\n$\r$\nRestart now?" LangString VBOX_COMPONENT_MAIN ${LANG_ENGLISH} "VirtualBox Guest Additions" LangString VBOX_COMPONENT_MAIN_DESC ${LANG_ENGLISH} "VirtualBox Guest Additions main files" @@ -47,15 +47,15 @@ LangString VBOX_COMPONENT_D3D_HINT_VRAM ${LANG_ENGLISH} "Please note LangString VBOX_COMPONENT_D3D_INVALID ${LANG_ENGLISH} "The setup detected a corrupt/invalid DirectX installation.$\r$\n$\r$\nIn order to get Direct3D support working, consulting the VirtualBox manual is highly recommended.$\r$\n$\r$\nContinue anyway?" LangString VBOX_COMPONENT_D3D_INVALID_MANUAL ${LANG_ENGLISH} "Shall the VirtualBox manual be displayed now to look for a solution?" -LangString VBOX_WFP_WARN_REPLACE ${LANG_ENGLISH} "In order to make ${PRODUCT_NAME} work correctly some system files have been replaced.$\r$\nIf the Windows File Protection service offers to restore the original files you should cancel the request to retain the newly installed functionality." -LangString VBOX_REBOOT_REQUIRED ${LANG_ENGLISH} "To apply all changes, the system must be restarted. Restart Windows now?" +LangString VBOX_WFP_WARN_REPLACE ${LANG_ENGLISH} "In order to make ${PRODUCT_NAME} work correctly some system files have been replaced.$\r$\nIf the Windows File Protection service offers to restore the original files you should cancel the request to retain the newly installed functionality." +LangString VBOX_REBOOT_REQUIRED ${LANG_ENGLISH} "To apply all changes, the system must be restarted. Restart Windows now?" -LangString VBOX_EXTRACTION_COMPLETE ${LANG_ENGLISH} "$(^Name): Files were successfully extracted to $\"$INSTDIR$\"!" +LangString VBOX_EXTRACTION_COMPLETE ${LANG_ENGLISH} "$(^Name): Files were successfully extracted to $\"$INSTDIR$\"!" -LangString VBOX_ERROR_INST_FAILED ${LANG_ENGLISH} "An error occurred during installation.$\r$\nPlease refer to the log file under '$INSTDIR\install_ui.log' for more information." -LangString VBOX_ERROR_OPEN_LINK ${LANG_ENGLISH} "Could not open link in the default browser." - -LangString VBOX_UNINST_CONFIRM ${LANG_ENGLISH} "Do you really want to uninstall $(^Name)?" -LangString VBOX_UNINST_SUCCESS ${LANG_ENGLISH} "$(^Name) have been uninstalled." -LangString VBOX_UNINST_INVALID_D3D ${LANG_ENGLISH} "Invalid installation of Direct3D support detected; uninstallation skipped." +LangString VBOX_ERROR_INST_FAILED ${LANG_ENGLISH} "An error occurred during installation.$\r$\nPlease refer to the log file under '$INSTDIR\install_ui.log' for more information." +LangString VBOX_ERROR_OPEN_LINK ${LANG_ENGLISH} "Could not open link in the default browser." +LangString VBOX_UNINST_CONFIRM ${LANG_ENGLISH} "Do you really want to uninstall $(^Name)?" +LangString VBOX_UNINST_SUCCESS ${LANG_ENGLISH} "$(^Name) have been uninstalled." +LangString VBOX_UNINST_INVALID_D3D ${LANG_ENGLISH} "Invalid installation of Direct3D support detected; uninstallation skipped." +LangString VBOX_UNINST_UNABLE_TO_RESTORE_D3D ${LANG_ENGLISH} "Could not restore original Direct3D files. Please re-install DirectX." diff --git a/src/VBox/Additions/WINNT/Installer/Languages/French.nsh b/src/VBox/Additions/WINNT/Installer/Languages/French.nsh index 6dc0d736..648a47aa 100644 --- a/src/VBox/Additions/WINNT/Installer/Languages/French.nsh +++ b/src/VBox/Additions/WINNT/Installer/Languages/French.nsh @@ -3,7 +3,7 @@ ; ; -; Copyright (C) 2006-2012 Oracle Corporation +; Copyright (C) 2006-2014 Oracle Corporation ; ; This file is part of VirtualBox Open Source Edition (OSE), as ; available from http://www.virtualbox.org. This file is free software; @@ -14,24 +14,24 @@ ; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. ; -LangString VBOX_TEST ${LANG_FRENCH} "Ceci est un message de test de $(^Name)!" +LangString VBOX_TEST ${LANG_FRENCH} "Ceci est un message de test de $(^Name)!" -LangString VBOX_NOADMIN ${LANG_FRENCH} "Vous avez besoin de droits d'administrateur pour (dés)installer $(^Name)!$\r$\nCe programme d'installation se terminera maintenant." +LangString VBOX_NOADMIN ${LANG_FRENCH} "Vous avez besoin de droits d'administrateur pour (dés)installer $(^Name)!$\r$\nCe programme d'installation se terminera maintenant." -LangString VBOX_NOTICE_ARCH_X86 ${LANG_FRENCH} "Cette application peut seulement être executée sur des systèmes Windows 32-bit. Veuillez installer la version 64-bit de $(^Name)!" -LangString VBOX_NOTICE_ARCH_AMD64 ${LANG_FRENCH} "Cette application peut seulement être executée sur des systèmes Windows 64-bit. Veuillez installer la version 32-bit de $(^Name)!" -LangString VBOX_NT4_NO_SP6 ${LANG_FRENCH} "Le programme d'installation a détécté que vous utilisez Windows NT4 sans Service Pack 6.$\r$\nNous vous conseillons d'installer ce Service Pack avant de continuer. Désirez vous cependant continuer?" +LangString VBOX_NOTICE_ARCH_X86 ${LANG_FRENCH} "Cette application peut seulement être executée sur des systèmes Windows 32-bit. Veuillez installer la version 64-bit de $(^Name)!" +LangString VBOX_NOTICE_ARCH_AMD64 ${LANG_FRENCH} "Cette application peut seulement être executée sur des systèmes Windows 64-bit. Veuillez installer la version 32-bit de $(^Name)!" +LangString VBOX_NT4_NO_SP6 ${LANG_FRENCH} "Le programme d'installation a détécté que vous utilisez Windows NT4 sans Service Pack 6.$\r$\nNous vous conseillons d'installer ce Service Pack avant de continuer. Désirez vous cependant continuer?" -LangString VBOX_PLATFORM_UNSUPPORTED ${LANG_FRENCH} "Les Additions invité ne sont pas encore supportés sur cette plateforme!" +LangString VBOX_PLATFORM_UNSUPPORTED ${LANG_FRENCH} "Les Additions invité ne sont pas encore supportés sur cette plateforme!" -LangString VBOX_SUN_FOUND ${LANG_FRENCH} "Une ancienne version des Additions invité Sun est installée dans cette machine virtuelle. Les Additions invité actuelles ne peuvent être installées avant que cette version ne soit désinstallée.$\r$\n$\r$\nVoulez-vous désinstaller l'ancienne version maintenant?" -LangString VBOX_SUN_ABORTED ${LANG_FRENCH} "Le programme ne peut pas continuer avec l'installation des Additions invité.$\r$\nVeuillez désinstaller d'abord les anciennes Additions Sun!" +LangString VBOX_SUN_FOUND ${LANG_FRENCH} "Une ancienne version des Additions invité Sun est installée dans cette machine virtuelle. Les Additions invité actuelles ne peuvent être installées avant que cette version ne soit désinstallée.$\r$\n$\r$\nVoulez-vous désinstaller l'ancienne version maintenant?" +LangString VBOX_SUN_ABORTED ${LANG_FRENCH} "Le programme ne peut pas continuer avec l'installation des Additions invité.$\r$\nVeuillez désinstaller d'abord les anciennes Additions Sun!" -LangString VBOX_INNOTEK_FOUND ${LANG_FRENCH} "Une ancienne version des Additions invité est installée dans cette machine virtuelle. Les Additions invité actuelles ne peuvent être installées avant que cette version ne soit désinstallée.$\r$\n$\r$\nVoulez-vous désinstaller l'ancienne version maintenant?" -LangString VBOX_INNOTEK_ABORTED ${LANG_FRENCH} "Le programme ne peut pas continuer avec l'installation des Additions invité.$\r$\nVeuillez désinstaller d'abord les anciennes Additions!" +LangString VBOX_INNOTEK_FOUND ${LANG_FRENCH} "Une ancienne version des Additions invité est installée dans cette machine virtuelle. Les Additions invité actuelles ne peuvent être installées avant que cette version ne soit désinstallée.$\r$\n$\r$\nVoulez-vous désinstaller l'ancienne version maintenant?" +LangString VBOX_INNOTEK_ABORTED ${LANG_FRENCH} "Le programme ne peut pas continuer avec l'installation des Additions invité.$\r$\nVeuillez désinstaller d'abord les anciennes Additions!" -LangString VBOX_UNINSTALL_START ${LANG_FRENCH} "Choisissez OK pour démarrer la désinstallation.$\r$\nLe processus nécessitera quelque temps et se déroulera en arrière-plan." -LangString VBOX_UNINSTALL_REBOOT ${LANG_FRENCH} "Nous vous conseillons fortement de redémarer cette machine virtuelle avant d'installer la nouvelle version des Additions invité.$\r$\nVeuillez recommencer l'installation des Additions après le redémarrage.$\r$\n$\r$\nRedémarrer maintenant?" +LangString VBOX_UNINSTALL_START ${LANG_FRENCH} "Choisissez OK pour démarrer la désinstallation.$\r$\nLe processus nécessitera quelque temps et se déroulera en arrière-plan." +LangString VBOX_UNINSTALL_REBOOT ${LANG_FRENCH} "Nous vous conseillons fortement de redémarer cette machine virtuelle avant d'installer la nouvelle version des Additions invité.$\r$\nVeuillez recommencer l'installation des Additions après le redémarrage.$\r$\n$\r$\nRedémarrer maintenant?" LangString VBOX_COMPONENT_MAIN ${LANG_FRENCH} "Additions invité VirtualBox" LangString VBOX_COMPONENT_MAIN_DESC ${LANG_FRENCH} "Fichiers prinipaux des Additions invité VirtualBox" @@ -47,15 +47,15 @@ LangString VBOX_COMPONENT_D3D_HINT_VRAM ${LANG_FRENCH} "Veuillez no LangString VBOX_COMPONENT_D3D_INVALID ${LANG_FRENCH} "Le programme d'installation a détecté une installation DirectX corrompue ou invalide.$\r$\n$\r$\nAfin d'assurer le bon fonctionnement du support DirectX, nous conseillons de réinstaller le moteur d'exécution DirectX.$\r$\n$\r$\nDésirez-vous cependant continuer?" LangString VBOX_COMPONENT_D3D_INVALID_MANUAL ${LANG_FRENCH} "Voulez-vous voir le manuel d'utilisateur VirtualBox pour chercher une solution?" -LangString VBOX_WFP_WARN_REPLACE ${LANG_FRENCH} "Le programme d'installation vient de remplacer certains fichiers systèmes afin de faire fonctionner correctement ${PRODUCT_NAME}.$\r$\nPour le cas qu'un avertissement de la Protection de fichiers Windows apparaisse, veuiller l'annuler sans restaurer les fichiers originaux!" -LangString VBOX_REBOOT_REQUIRED ${LANG_FRENCH} "Le système doit être redémarré pourque les changements prennent effet. Redémarrer Windows maintenant?" +LangString VBOX_WFP_WARN_REPLACE ${LANG_FRENCH} "Le programme d'installation vient de remplacer certains fichiers systèmes afin de faire fonctionner correctement ${PRODUCT_NAME}.$\r$\nPour le cas qu'un avertissement de la Protection de fichiers Windows apparaisse, veuiller l'annuler sans restaurer les fichiers originaux!" +LangString VBOX_REBOOT_REQUIRED ${LANG_FRENCH} "Le système doit être redémarré pourque les changements prennent effet. Redémarrer Windows maintenant?" -LangString VBOX_EXTRACTION_COMPLETE ${LANG_FRENCH} "$(^Name): Les fichiers ont été extrait avec succès dans $\"$INSTDIR$\"!" +LangString VBOX_EXTRACTION_COMPLETE ${LANG_FRENCH} "$(^Name): Les fichiers ont été extrait avec succès dans $\"$INSTDIR$\"!" -LangString VBOX_ERROR_INST_FAILED ${LANG_FRENCH} "Une erreur est survenue pendant l'installation!$\r$\nVeuillez consulter le fichier log '$INSTDIR\install_ui.log' pour plus d'informations." -LangString VBOX_ERROR_OPEN_LINK ${LANG_FRENCH} "Impossible d'ouvrir le lien dans le navigateur par defaut." - -LangString VBOX_UNINST_CONFIRM ${LANG_FRENCH} "Voulez-vous vraiment désinstaller $(^Name)?" -LangString VBOX_UNINST_SUCCESS ${LANG_FRENCH} "$(^Name) ont été désinstallés." -LangString VBOX_UNINST_INVALID_D3D ${LANG_FRENCH} "Installation incorrecte du support Direct3D detectée; une désinstallation ne sera pas tentée." +LangString VBOX_ERROR_INST_FAILED ${LANG_FRENCH} "Une erreur est survenue pendant l'installation!$\r$\nVeuillez consulter le fichier log '$INSTDIR\install_ui.log' pour plus d'informations." +LangString VBOX_ERROR_OPEN_LINK ${LANG_FRENCH} "Impossible d'ouvrir le lien dans le navigateur par défaut." +LangString VBOX_UNINST_CONFIRM ${LANG_FRENCH} "Voulez-vous vraiment désinstaller $(^Name)?" +LangString VBOX_UNINST_SUCCESS ${LANG_FRENCH} "$(^Name) ont été désinstallés." +LangString VBOX_UNINST_INVALID_D3D ${LANG_FRENCH} "Installation incorrecte du support Direct3D detectée; une désinstallation ne sera pas tentée." +LangString VBOX_UNINST_UNABLE_TO_RESTORE_D3D ${LANG_FRENCH} "La restauration des fichiers originaux Direct3D a echoué. Veuillez réinstaller DirectX." diff --git a/src/VBox/Additions/WINNT/Installer/Languages/German.nsh b/src/VBox/Additions/WINNT/Installer/Languages/German.nsh index 01904da1..c615dc7f 100644 --- a/src/VBox/Additions/WINNT/Installer/Languages/German.nsh +++ b/src/VBox/Additions/WINNT/Installer/Languages/German.nsh @@ -3,7 +3,7 @@ ; ; -; Copyright (C) 2006-2012 Oracle Corporation +; Copyright (C) 2006-2014 Oracle Corporation ; ; This file is part of VirtualBox Open Source Edition (OSE), as ; available from http://www.virtualbox.org. This file is free software; @@ -14,24 +14,24 @@ ; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. ; -LangString VBOX_TEST ${LANG_GERMAN} "Das ist eine Test-Nachricht von $(^Name)!" +LangString VBOX_TEST ${LANG_GERMAN} "Das ist eine Test-Nachricht von $(^Name)!" -LangString VBOX_NOADMIN ${LANG_GERMAN} "Sie benötigen Administrations-Rechte zum (De-)Installieren der $(^Name)!$\r$\nDas Setup wird nun beendet." +LangString VBOX_NOADMIN ${LANG_GERMAN} "Sie benötigen Administrations-Rechte zum (De-)Installieren der $(^Name)!$\r$\nDas Setup wird nun beendet." -LangString VBOX_NOTICE_ARCH_X86 ${LANG_GERMAN} "Diese Applikation läuft nur auf 32-bit Windows-Systemen. Bitte installieren Sie die 64-bit Version der $(^Name)!" -LangString VBOX_NOTICE_ARCH_AMD64 ${LANG_GERMAN} "Diese Applikation läuft nur auf 64-bit Windows-Systemen. Bitte installieren Sie die 32-bit Version der $(^Name)!" -LangString VBOX_NT4_NO_SP6 ${LANG_GERMAN} "Es ist kein Service Pack 6 für NT 4.0 installiert.$\r$\nEs wird empfohlen das Service-Pack vor dieser Installation zu installieren. Trotzdem jetzt ohne Service-Pack installieren?" +LangString VBOX_NOTICE_ARCH_X86 ${LANG_GERMAN} "Diese Applikation läuft nur auf 32-bit Windows-Systemen. Bitte installieren Sie die 64-bit Version der $(^Name)!" +LangString VBOX_NOTICE_ARCH_AMD64 ${LANG_GERMAN} "Diese Applikation läuft nur auf 64-bit Windows-Systemen. Bitte installieren Sie die 32-bit Version der $(^Name)!" +LangString VBOX_NT4_NO_SP6 ${LANG_GERMAN} "Es ist kein Service Pack 6 für NT 4.0 installiert.$\r$\nEs wird empfohlen das Service-Pack vor dieser Installation zu installieren. Trotzdem jetzt ohne Service-Pack installieren?" -LangString VBOX_PLATFORM_UNSUPPORTED ${LANG_GERMAN} "Diese Plattform wird noch nicht durch diese Guest Additions unterstützt!" +LangString VBOX_PLATFORM_UNSUPPORTED ${LANG_GERMAN} "Diese Plattform wird noch nicht durch diese Guest Additions unterstützt!" -LangString VBOX_SUN_FOUND ${LANG_GERMAN} "Eine veraltete Version der Sun Guest Additions ist auf diesem System bereits installiert. Diese muss erst deinstalliert werden bevor aktuelle Guest Additions installiert werden können.$\r$\n$\r$\nJetzt die alten Guest Additions deinstallieren?" -LangString VBOX_SUN_ABORTED ${LANG_GERMAN} "Die Installation der Guest Additions kann nicht fortgesetzt werden.$\r$\nBitte deinstallieren Sie erst die alten Sun Guest Additions!" +LangString VBOX_SUN_FOUND ${LANG_GERMAN} "Eine veraltete Version der Sun Guest Additions ist auf diesem System bereits installiert. Diese muss erst deinstalliert werden bevor aktuelle Guest Additions installiert werden können.$\r$\n$\r$\nJetzt die alten Guest Additions deinstallieren?" +LangString VBOX_SUN_ABORTED ${LANG_GERMAN} "Die Installation der Guest Additions kann nicht fortgesetzt werden.$\r$\nBitte deinstallieren Sie erst die alten Sun Guest Additions!" -LangString VBOX_INNOTEK_FOUND ${LANG_GERMAN} "Eine veraltete Version der innotek Guest Additions ist auf diesem System bereits installiert. Diese muss erst deinstalliert werden bevor aktuelle Guest Additions installiert werden können.$\r$\n$\r$\nJetzt die alten Guest Additions deinstallieren?" -LangString VBOX_INNOTEK_ABORTED ${LANG_GERMAN} "Die Installation der Guest Additions kann nicht fortgesetzt werden.$\r$\nBitte deinstallieren Sie erst die alten innotek Guest Additions!" +LangString VBOX_INNOTEK_FOUND ${LANG_GERMAN} "Eine veraltete Version der innotek Guest Additions ist auf diesem System bereits installiert. Diese muss erst deinstalliert werden bevor aktuelle Guest Additions installiert werden können.$\r$\n$\r$\nJetzt die alten Guest Additions deinstallieren?" +LangString VBOX_INNOTEK_ABORTED ${LANG_GERMAN} "Die Installation der Guest Additions kann nicht fortgesetzt werden.$\r$\nBitte deinstallieren Sie erst die alten innotek Guest Additions!" -LangString VBOX_UNINSTALL_START ${LANG_GERMAN} "Auf OK klicken um mit der Deinstallation zu beginnen.$\r$\nBitte warten Sie dann während die Deinstallation im Hintergrund ausgeführt wird ..." -LangString VBOX_UNINSTALL_REBOOT ${LANG_GERMAN} "Es wird dringend empfohlen das System neu zu starten bevor die neuen Guest Additions installiert werden.$\r$\nBitte starten Sie die Installation nach dem Neustart erneut.$\r$\n$\r$\nJetzt neu starten?" +LangString VBOX_UNINSTALL_START ${LANG_GERMAN} "Auf OK klicken um mit der Deinstallation zu beginnen.$\r$\nBitte warten Sie dann während die Deinstallation im Hintergrund ausgeführt wird ..." +LangString VBOX_UNINSTALL_REBOOT ${LANG_GERMAN} "Es wird dringend empfohlen das System neu zu starten bevor die neuen Guest Additions installiert werden.$\r$\nBitte starten Sie die Installation nach dem Neustart erneut.$\r$\n$\r$\nJetzt neu starten?" LangString VBOX_COMPONENT_MAIN ${LANG_GERMAN} "VirtualBox Guest Additions" LangString VBOX_COMPONENT_MAIN_DESC ${LANG_GERMAN} "Hauptkomponenten der VirtualBox Guest Additions" @@ -47,15 +47,15 @@ LangString VBOX_COMPONENT_D3D_HINT_VRAM ${LANG_GERMAN} "Bitte beach LangString VBOX_COMPONENT_D3D_INVALID ${LANG_GERMAN} "Das Setup hat eine ungültige/beschädigte DirectX-Installation festgestellt.$\r$\n$\r$\nUm die Direct3D-Unterstützung installieren zu können wird empfohlen, zuerst das VirtualBox Benutzerhandbuch zu konsultieren.$\r$\n$\r$\nMit der Installation jetzt trotzdem fortfahren?" LangString VBOX_COMPONENT_D3D_INVALID_MANUAL ${LANG_GERMAN} "Soll nun das VirtualBox-Handbuch angezeigt werden um nach einer Lösung zu suchen?" -LangString VBOX_WFP_WARN_REPLACE ${LANG_GERMAN} "Das Setup hat gerade Systemdateien ersetzt um die ${PRODUCT_NAME} korrekt installieren zu können.$\r$\nFalls nun ein Warn-Dialog des Windows-Dateischutzes erscheint, diesen bitte abbrechen und die Dateien nicht wiederherstellen lassen!" -LangString VBOX_REBOOT_REQUIRED ${LANG_GERMAN} "Um alle Änderungen durchführen zu können, muss das System neu gestartet werden. Jetzt neu starten?" +LangString VBOX_WFP_WARN_REPLACE ${LANG_GERMAN} "Das Setup hat gerade Systemdateien ersetzt um die ${PRODUCT_NAME} korrekt installieren zu können.$\r$\nFalls nun ein Warn-Dialog des Windows-Dateischutzes erscheint, diesen bitte abbrechen und die Dateien nicht wiederherstellen lassen!" +LangString VBOX_REBOOT_REQUIRED ${LANG_GERMAN} "Um alle Änderungen durchführen zu können, muss das System neu gestartet werden. Jetzt neu starten?" -LangString VBOX_EXTRACTION_COMPLETE ${LANG_GERMAN} "$(^Name): Die Dateien wurden erfolgreich nach $\"$INSTDIR$\" entpackt!" +LangString VBOX_EXTRACTION_COMPLETE ${LANG_GERMAN} "$(^Name): Die Dateien wurden erfolgreich nach $\"$INSTDIR$\" entpackt!" -LangString VBOX_ERROR_INST_FAILED ${LANG_GERMAN} "Es trat ein Fehler während der Installation auf!$\r$\nBitte werfen Sie einen Blick in die Log-Datei unter '$INSTDIR\install_ui.log' für mehr Informationen." -LangString VBOX_ERROR_OPEN_LINK ${LANG_GERMAN} "Link konnte nicht im Standard-Browser geöffnet werden." - -LangString VBOX_UNINST_CONFIRM ${LANG_GERMAN} "Wollen Sie wirklich die $(^Name) deinstallieren?" -LangString VBOX_UNINST_SUCCESS ${LANG_GERMAN} "$(^Name) wurden erfolgreich deinstalliert." -LangString VBOX_UNINST_INVALID_D3D ${LANG_GERMAN} "Unvollständige oder ungültige Installation der Direct3D-Unterstützung erkannt; Deinstallation wird übersprungen." +LangString VBOX_ERROR_INST_FAILED ${LANG_GERMAN} "Es trat ein Fehler während der Installation auf!$\r$\nBitte werfen Sie einen Blick in die Log-Datei unter '$INSTDIR\install_ui.log' für mehr Informationen." +LangString VBOX_ERROR_OPEN_LINK ${LANG_GERMAN} "Link konnte nicht im Standard-Browser geöffnet werden." +LangString VBOX_UNINST_CONFIRM ${LANG_GERMAN} "Wollen Sie wirklich die $(^Name) deinstallieren?" +LangString VBOX_UNINST_SUCCESS ${LANG_GERMAN} "$(^Name) wurden erfolgreich deinstalliert." +LangString VBOX_UNINST_INVALID_D3D ${LANG_GERMAN} "Unvollständige oder ungültige Installation der Direct3D-Unterstützung erkannt; Deinstallation wird übersprungen." +LangString VBOX_UNINST_UNABLE_TO_RESTORE_D3D ${LANG_GERMAN} "Konnte Direct3D-Originaldateien nicht wiederherstellen. Bitte DirectX neu installieren." diff --git a/src/VBox/Additions/WINNT/Installer/Loader/VBoxWindowsAdditions.rc b/src/VBox/Additions/WINNT/Installer/Loader/VBoxWindowsAdditions.rc index 2ae697d0..007e61e7 100644 --- a/src/VBox/Additions/WINNT/Installer/Loader/VBoxWindowsAdditions.rc +++ b/src/VBox/Additions/WINNT/Installer/Loader/VBoxWindowsAdditions.rc @@ -4,7 +4,7 @@ */ /* - * Copyright (C) 2008 Oracle Corporation + * Copyright (C) 2008-2010 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; diff --git a/src/VBox/Additions/WINNT/Installer/Loader/resource.h b/src/VBox/Additions/WINNT/Installer/Loader/resource.h index bf3a0d72..39f219c7 100644 --- a/src/VBox/Additions/WINNT/Installer/Loader/resource.h +++ b/src/VBox/Additions/WINNT/Installer/Loader/resource.h @@ -4,7 +4,7 @@ */ /* - * Copyright (C) 2008 Oracle Corporation + * Copyright (C) 2008-2010 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; diff --git a/src/VBox/Additions/WINNT/Installer/Makefile.kmk b/src/VBox/Additions/WINNT/Installer/Makefile.kmk index f2b8b215..ef8ce666 100644 --- a/src/VBox/Additions/WINNT/Installer/Makefile.kmk +++ b/src/VBox/Additions/WINNT/Installer/Makefile.kmk @@ -179,7 +179,7 @@ DRIVER_FILES += \ $(PATH_STAGE_BIN)/additions/VBoxMMRHook-x86.dll endif endif - + VB_WIN_ADD_NSIS_ENV := \ -E 'PATH_OUT=$(subst /,\,$(PATH_OUT))' \ diff --git a/src/VBox/Additions/WINNT/Installer/RegCleanup.cpp b/src/VBox/Additions/WINNT/Installer/RegCleanup.cpp index 84b2b86a..46d63826 100644 --- a/src/VBox/Additions/WINNT/Installer/RegCleanup.cpp +++ b/src/VBox/Additions/WINNT/Installer/RegCleanup.cpp @@ -2,7 +2,7 @@ * * delinvalid - remove "InvalidDisplay" key on NT4 * - * Copyright (C) 2006-2007 Oracle Corporation + * Copyright (C) 2006-2010 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; diff --git a/src/VBox/Additions/WINNT/Installer/VBoxDrvInst.cpp b/src/VBox/Additions/WINNT/Installer/VBoxDrvInst.cpp index a684b489..ef95fa7b 100644 --- a/src/VBox/Additions/WINNT/Installer/VBoxDrvInst.cpp +++ b/src/VBox/Additions/WINNT/Installer/VBoxDrvInst.cpp @@ -4,7 +4,7 @@ */ /* - * Copyright (C) 2011-2012 Oracle Corporation + * Copyright (C) 2011-2013 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -132,6 +132,48 @@ void LogCallback(DIFXAPI_LOG Event, DWORD dwError, PCWSTR pEventDescription, PVO } /** + * Loads a system DLL. + * + * @returns Module handle or NULL + * @param pwszName The DLL name. + */ +static HMODULE loadInstalledDll(const wchar_t *pwszName) +{ + /* Get the process image path. */ + WCHAR wszPath[MAX_PATH]; + UINT cwcPath = GetModuleFileNameW(NULL, wszPath, MAX_PATH); + if (!cwcPath || cwcPath >= MAX_PATH) + return NULL; + + /* Drop the image filename. */ + UINT off = cwcPath - 1; + for (;;) + { + if ( wszPath[off] == '\\' + || wszPath[off] == '/' + || wszPath[off] == ':') + { + wszPath[off] = '\0'; + cwcPath = off; + break; + } + if (!off--) + return NULL; /* No path? Shouldn't ever happen! */ + } + + /* Check if there is room in the buffer to construct the desired name. */ + size_t cwcName = 0; + while (pwszName[cwcName]) + cwcName++; + if (cwcPath + 1 + cwcName + 1 > MAX_PATH) + return NULL; + + wszPath[cwcPath] = '\\'; + memcpy(&wszPath[cwcPath + 1], pwszName, (cwcName + 1) * sizeof(wszPath[0])); + return LoadLibraryW(wszPath); +} + +/** * (Un)Installs a driver from/to the system. * * @return Exit code (EXIT_OK, EXIT_FAIL) @@ -145,7 +187,7 @@ int VBoxInstallDriver(const BOOL fInstall, const _TCHAR *pszDriverPath, BOOL fSi const _TCHAR *pszLogFile) { HRESULT hr = S_OK; - HMODULE hDIFxAPI = LoadLibrary(_T("DIFxAPI.dll")); + HMODULE hDIFxAPI = loadInstalledDll(L"DIFxAPI.dll"); if (NULL == hDIFxAPI) { _tprintf(_T("ERROR: Unable to locate DIFxAPI.dll!\n")); @@ -353,6 +395,33 @@ int VBoxInstallDriver(const BOOL fInstall, const _TCHAR *pszDriverPath, BOOL fSi return SUCCEEDED(hr) ? EXIT_OK : EXIT_FAIL; } +static UINT WINAPI vboxDrvInstExecuteInfFileCallback(PVOID Context, + UINT Notification, + UINT_PTR Param1, + UINT_PTR Param2) +{ +#ifdef DEBUG + _tprintf (_T( "Got installation notification %u\n"), Notification); +#endif + + switch (Notification) + { + case SPFILENOTIFY_NEEDMEDIA: + _tprintf (_T( "Requesting installation media ...\n")); + break; + + case SPFILENOTIFY_STARTCOPY: + _tprintf (_T( "Copying driver files to destination ...\n")); + break; + + case SPFILENOTIFY_TARGETNEWER: + case SPFILENOTIFY_TARGETEXISTS: + return TRUE; + } + + return SetupDefaultQueueCallback(Context, Notification, Param1, Param2); +} + /** * Executes a sepcified .INF section to install/uninstall drivers and/or services. * @@ -363,18 +432,67 @@ int VBoxInstallDriver(const BOOL fInstall, const _TCHAR *pszDriverPath, BOOL fSi */ int ExecuteInfFile(const _TCHAR *pszSection, int iMode, const _TCHAR *pszInf) { - _tprintf(_T("Executing INF-File: %ws (Section: %ws) ...\n"), pszInf, pszSection); + _tprintf(_T("Installing from INF-File: %ws (Section: %ws) ...\n"), + pszInf, pszSection); - /* Executed by the installer that already has proper privileges. */ - _TCHAR szCommandLine[_MAX_PATH + 1] = { 0 }; - swprintf(szCommandLine, sizeof(szCommandLine), TEXT( "%ws %d %ws" ), pszSection, iMode, pszInf); + UINT uErrorLine = 0; + HINF hINF = SetupOpenInfFile(pszInf, NULL, INF_STYLE_WIN4, &uErrorLine); + if (hINF != INVALID_HANDLE_VALUE) + { + PVOID pvQueue = SetupInitDefaultQueueCallback(NULL); + + BOOL fSuccess = SetupInstallFromInfSection(NULL, + hINF, + pszSection, + SPINST_ALL, + HKEY_LOCAL_MACHINE, + NULL, + SP_COPY_NEWER_OR_SAME | SP_COPY_NOSKIP, + vboxDrvInstExecuteInfFileCallback, + pvQueue, + NULL, + NULL + ); + if (fSuccess) + { + _tprintf (_T( "File installation stage successful\n")); -#ifdef DEBUG - _tprintf (_T( "Commandline: %ws\n"), szCommandLine); -#endif + fSuccess = SetupInstallServicesFromInfSection(hINF, + L"DefaultInstall.Services", + 0 /* Flags */); + if (fSuccess) + { + _tprintf (_T( "Service installation stage successful. Installation completed\n")); + } + else + { + DWORD dwErr = GetLastError(); + switch (dwErr) + { + case ERROR_SUCCESS_REBOOT_REQUIRED: + _tprintf (_T( "A reboot is required to complete the installation\n")); + break; - InstallHinfSection(NULL, NULL, szCommandLine, SW_SHOW); - /* No return value given! */ + case ERROR_SECTION_NOT_FOUND: + break; + + default: + _tprintf (_T( "Error %ld while installing service\n"), dwErr); + break; + } + } + } + else + _tprintf (_T( "Error %ld while installing files\n"), GetLastError()); + + if (pvQueue) + SetupTermDefaultQueueCallback(pvQueue); + + SetupCloseInfFile(hINF); + } + else + _tprintf (_T( "Unable to open %ws: %ld (error line %u)\n"), + pszInf, GetLastError(), uErrorLine); return EXIT_OK; } @@ -416,11 +534,11 @@ int RegistryAddStringToMultiSZ(const TCHAR *pszSubKey, const TCHAR *pszKeyValue, { /* Look if the network provider is already in the list. */ - int iPos = 0; + unsigned int iPos = 0; size_t cb = 0; /* Replace delimiting "\0"'s with "," to make tokenizing work. */ - for (int i = 0; i < cbKeyValue / sizeof(TCHAR); i++) + for (unsigned i = 0; i < cbKeyValue / sizeof(TCHAR); i++) if (szKeyValue[i] == '\0') szKeyValue[i] = ','; TCHAR *pszToken = wcstok(szKeyValue, _T(",")); @@ -517,7 +635,7 @@ int RegistryRemoveStringFromMultiSZ(const TCHAR *pszSubKey, const TCHAR *pszKeyV TCHAR szFinalString[1024] = { 0 }; int iIndex = 0; int iNewIndex = 0; - for (int i = 0; i < cbKeyValue / sizeof(TCHAR); i++) + for (unsigned i = 0; i < cbKeyValue / sizeof(TCHAR); i++) { if (szKeyValue[i] != _T('\0')) szCurString[iIndex++] = szKeyValue[i]; diff --git a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditions.nsi b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditions.nsi index 3787defd..539b4834 100644 --- a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditions.nsi +++ b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditions.nsi @@ -4,7 +4,7 @@ ; ; -; Copyright (C) 2012 Oracle Corporation +; Copyright (C) 2012-2014 Oracle Corporation ; ; This file is part of VirtualBox Open Source Edition (OSE), as ; available from http://www.virtualbox.org. This file is free software; @@ -78,6 +78,7 @@ VIAddVersionKey "InternalName" "${PRODUCT_OUTPUT}" !include "nsProcess.nsh" !include "Library.nsh" +!include "Sections.nsh" !include "strstr.nsh" ; Function "strstr" !include "servicepack.nsh" ; Function "GetServicePack" !include "winver.nsh" ; Function for determining Windows version @@ -212,7 +213,7 @@ Var g_strAddVerBuild ; Installed Guest Additions: Build numbe Var g_strAddVerRev ; Installed Guest Additions: SVN revision Var g_strWinVersion ; Current Windows version we're running on Var g_bLogEnable ; Do logging when installing? "true" or "false" -Var g_bWithWDDM ; Install the WDDM driver instead of the XPDM one +Var g_bWithWDDM ; Install the WDDM graphics driver instead of the XPDM one Var g_bCapDllCache ; Capability: Does the (Windows) guest have have a DLL cache which needs to be taken care of? Var g_bCapWDDM ; Capability: Is the guest able to handle/use our WDDM driver? @@ -239,9 +240,11 @@ Var g_bOnlyExtract ; Cmd line: Only extract all files, do * Var g_bPostInstallStatus ; Cmd line: Post the overall installation status to some external program (VBoxTray) ; Platform parts of this installer +!include "VBoxGuestAdditionsLog.nsh" +!include "VBoxGuestAdditionsExternal.nsh" !include "VBoxGuestAdditionsCommon.nsh" !if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit only -!include "VBoxGuestAdditionsNT4.nsh" + !include "VBoxGuestAdditionsNT4.nsh" !endif !include "VBoxGuestAdditionsW2KXP.nsh" !include "VBoxGuestAdditionsVista.nsh" @@ -365,11 +368,11 @@ Function HandleCommandLine StrCpy $g_iSfOrder $5 ${Break} - !ifdef WHQL_FAKE +!ifdef WHQL_FAKE ${Case} '/unsig_drv' StrCpy $g_bFakeWHQL "true" ${Break} - !endif +!endif ${Case} '/uninstall' StrCpy $g_bUninstall "true" @@ -385,12 +388,18 @@ Function HandleCommandLine ${Break} !endif - !if $%VBOX_WITH_CROGL% == "1" +!if $%VBOX_WITH_CROGL% == "1" ${Case} '/with_d3d' ${Case} '/with_direct3d' StrCpy $g_bWithD3D "true" ${Break} - !endif +!endif + +!if $%VBOX_WITH_WDDM% == "1" + ${Case} '/with_wddm' + StrCpy $g_bWithWDDM "true" + ${Break} +!endif ${Case} '/xres' ${Case} 'xres' @@ -405,7 +414,7 @@ Function HandleCommandLine ${Default} ; Unknown parameter, print usage message ; Prevent popping up usage message on (yet) unknown parameters ; in silent mode, just skip - IfSilent 0 +2 + IfSilent +1 +2 ${Break} goto usage ${Break} @@ -435,6 +444,8 @@ usage: /uninstall$\t$\tJust uninstalls the Guest Additions and exits$\r$\n \ /with_autologon$\tInstalls auto-logon support$\r$\n \ /with_d3d$\tInstalls D3D support$\r$\n \ + /with_vboxmmr$\tInstalls multimedia redirection (MMR) support$\r$\n \ + /with_wddm$\tInstalls the WDDM instead of the XPDM graphics driver$\r$\n \ /xres=X$\t$\tSets the guest's display resolution (width in pixels)$\r$\n \ /yres=Y$\t$\tSets the guest's display resolution (height in pixels)$\r$\n \ $\r$\n \ @@ -450,13 +461,12 @@ usage: done: - IfSilent 0 +2 - LogText "Installer is in silent mode!" - - LogText "Property: XRes: $g_iScreenX" - LogText "Property: YRes: $g_iScreenY" - LogText "Property: BPP: $g_iScreenBpp" - LogText "Property: Logging enabled: $g_bLogEnable" +!ifdef _DEBUG + ${LogVerbose} "Property: XRes: $g_iScreenX" + ${LogVerbose} "Property: YRes: $g_iScreenY" + ${LogVerbose} "Property: BPP: $g_iScreenBpp" + ${LogVerbose} "Property: Logging enabled: $g_bLogEnable" +!endif exit: @@ -477,6 +487,8 @@ Function CheckForOldGuestAdditions begin: + ${LogVerbose} "Checking for old Guest Additions ..." + sun_check: ; Check for old "Sun VirtualBox Guest Additions" @@ -548,8 +560,10 @@ FunctionEnd Function CheckForInstalledComponents Push $0 + Push $1 - DetailPrint "Checking for installed components ..." + ${LogVerbose} "Checking for installed components ..." + StrCpy $1 "" Call SetAppMode64 @@ -557,18 +571,40 @@ Function CheckForInstalledComponents ; regardless whether the user used "/with_autologon" or not ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL" ${If} $0 == "VBoxGINA.dll" - StrCpy $g_bWithAutoLogon "true" + StrCpy $1 "GINA" + ${Else} + ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}" "" + ${If} $0 == "VBoxCredProv" + StrCpy $1 "Credential Provider" + ${EndIf} ${EndIf} - - ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}" "" - ${If} $0 == "VBoxCredProv.dll" - StrCpy $g_bWithAutoLogon "true" + +!ifdef _DEBUG + ${LogVerbose} "Auto-logon module: $0" +!endif + + ${IfNot} $1 == "" + ${LogVerbose} "Auto-logon support ($1) was installed previously" + StrCpy $g_bWithAutoLogon "true" ; Force update + ${Else} + ${LogVerbose} "Auto-logon support was not installed previously" ${EndIf} - - ${If} $g_bWithAutoLogon == "true" - DetailPrint "Found already installed auto-logon support ..." + + ; Check for installed MMR support and enable updating + ; those modules if needed + ${If} ${FileExists} "$g_strSystemDir\VBoxMMR.exe" +!if $%BUILD_TARGET_ARCH% == "amd64" + ${AndIf} ${FileExists} "$g_strSysWow64\VBoxMMRHook.dll" +!else + ${AndIf} ${FileExists} "$g_strSystemDir\VBoxMMRHook.dll" +!endif + ${LogVerbose} "MultiMedia Redirection support (MMR) was installed previously" + StrCpy $g_bWithVBoxMMR "true" ; Force update + ${Else} + ${LogVerbose} "MultiMedia Redirection support (MMR) support was not installed previously" ${EndIf} + Pop $1 Pop $0 FunctionEnd @@ -577,10 +613,16 @@ FunctionEnd Section $(VBOX_COMPONENT_MAIN) SEC01 SectionIn RO ; Section cannot be unselected (read-only) + ${If} $g_bPostInstallStatus == "true" + ${LogToVBoxTray} "0" "${PRODUCT_NAME} update started, please wait ..." + ${EndIf} + + IfSilent +1 +2 + StrCpy $g_bLogEnable "true" ; Force logging in silent mode - Push "${PRODUCT_NAME} update started, please wait ..." - Push 0 ; Message type = info - Call WriteLogVBoxTray + ${LogEnable} "$g_bLogEnable" + IfSilent +1 +2 ; NSIS will expand ${LogVerbose} before doing relative jumps! + LogText "Installer runs in silent mode" SetOutPath "$INSTDIR" SetOverwrite on @@ -589,23 +631,21 @@ Section $(VBOX_COMPONENT_MAIN) SEC01 StrCpy $g_strSystemDir "$SYSDIR" - Call EnableLog - - DetailPrint "Version: $%VBOX_VERSION_STRING% (Rev $%VBOX_SVN_REV%)" + ${LogVerbose} "Version: $%VBOX_VERSION_STRING% (Rev $%VBOX_SVN_REV%)" ${If} $g_strAddVerMaj != "" - DetailPrint "Previous version: $g_strAddVerMaj.$g_strAddVerMin.$g_strAddVerBuild (Rev $g_strAddVerRev)" + ${LogVerbose} "Previous version: $g_strAddVerMaj.$g_strAddVerMin.$g_strAddVerBuild (Rev $g_strAddVerRev)" ${Else} - DetailPrint "No previous version of ${PRODUCT_NAME} detected." + ${LogVerbose} "No previous version of ${PRODUCT_NAME} detected" ${EndIf} !if $%BUILD_TARGET_ARCH% == "amd64" - DetailPrint "Detected OS: Windows $g_strWinVersion (64-bit)" + ${LogVerbose} "Detected OS: Windows $g_strWinVersion (64-bit)" !else - DetailPrint "Detected OS: Windows $g_strWinVersion (32-bit)" + ${LogVerbose} "Detected OS: Windows $g_strWinVersion (32-bit)" !endif - DetailPrint "System Directory: $g_strSystemDir" + ${LogVerbose} "System Directory: $g_strSystemDir" !ifdef _DEBUG - DetailPrint "Debug!" + ${LogVerbose} "Installer runs in debug mode" !endif ; @@ -613,6 +653,7 @@ Section $(VBOX_COMPONENT_MAIN) SEC01 ; ; Which OS are we using? + ; @todo Use logic lib here !if $%BUILD_TARGET_ARCH% == "x86" ; 32-bit StrCmp $g_strWinVersion "NT4" nt4 ; Windows NT 4.0 !endif @@ -622,6 +663,7 @@ Section $(VBOX_COMPONENT_MAIN) SEC01 StrCmp $g_strWinVersion "Vista" vista ; Windows Vista StrCmp $g_strWinVersion "7" vista ; Windows 7 StrCmp $g_strWinVersion "8" vista ; Windows 8 + StrCmp $g_strWinVersion "8_1" vista ; Windows 8.1 / Windows 2012 Server R2 ${If} $g_bForceInstall == "true" Goto vista ; Assume newer OS than we know of ... @@ -657,7 +699,7 @@ w2k: ; Windows 2000 and XP ... Call W2K_Main goto success -vista: ; Windows Vista / Windows 7 / Windows 8 +vista: ; Windows Vista / Windows 7 / Windows 8(.1) ; Check requirments; this function can abort the installation if necessary! Call Vista_CheckForRequirements @@ -688,8 +730,6 @@ success: exit: - Call WriteLogUI - SectionEnd ; Auto-logon support (section is hidden at the moment -- only can be enabled via command line switch) @@ -700,14 +740,16 @@ Section /o -$(VBOX_COMPONENT_AUTOLOGON) SEC02 Call GetWindowsVersion Pop $R0 ; Windows Version - DetailPrint "Installing auto-logon support ..." + ${LogVerbose} "Installing auto-logon support ..." ; Another GINA already is installed? Check if this is ours, otherwise let the user decide (unless it's a silent setup) ; whether to replace it with the VirtualBox one or not ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL" ${If} $0 != "" ${If} $0 != "VBoxGINA.dll" + ${LogVerbose} "Found another already installed GINA module: $0" MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON1 $(VBOX_COMPONENT_AUTOLOGON_WARN_3RDPARTY) /SD IDYES IDYES install + ${LogVerbose} "Skipping GINA installation, keeping: $0" goto skip ${EndIf} ${EndIf} @@ -715,14 +757,19 @@ Section /o -$(VBOX_COMPONENT_AUTOLOGON) SEC02 install: ; Do we need VBoxCredProv or VBoxGINA? - ${If} $R0 == 'Vista' ; Use VBoxCredProv on newer Windows OSes (>= Vista) - ${OrIf} $R0 == '7' + ${If} $R0 == 'Vista' ; Windows Vista. + ${OrIf} $R0 == '7' ; Windows 7. + ${OrIf} $R0 == '8' ; Windows 8. + ${OrIf} $R0 == '8_1' ; Windows 8.1 / Windows Server 2012 R2. + ; Use VBoxCredProv on Vista and up. + ${LogVerbose} "Installing VirtualBox credential provider ..." !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxCredProv.dll" "$g_strSystemDir\VBoxCredProv.dll" "$INSTDIR" WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}" "" "VBoxCredProv" ; adding to (default) key WriteRegStr HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}" "" "VBoxCredProv" ; adding to (Default) key WriteRegStr HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}\InprocServer32" "" "VBoxCredProv.dll" ; adding to (Default) key WriteRegStr HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}\InprocServer32" "ThreadingModel" "Apartment" ${Else} ; Use VBoxGINA on older Windows OSes (< Vista) + ${LogVerbose} "Installing VirtualBox GINA ..." !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxGINA.dll" "$g_strSystemDir\VBoxGINA.dll" "$INSTDIR" WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL" "VBoxGINA.dll" ; Add Windows notification package callbacks for VBoxGINA @@ -739,53 +786,22 @@ exit: SectionEnd -; Prepares the access rights for replacing -; a WRP (Windows Resource Protection) protected file -Function PrepareWRPFile - - Pop $0 - - ${IfNot} ${FileExists} "$0" - LogText "WRP: File $0 does not exist, skipping" - Return - ${EndIf} - - ${If} ${FileExists} "$g_strSystemDir\takeown.exe" - nsExec::ExecToLog '"$g_strSystemDir\takeown.exe" /F "$0"' - Pop $1 ; Ret value - LogText "WRP: Taking ownership for $0 returned: $1" - ${Else} - LogText "WRP: Warning: takeown.exe not found, skipping" - ${EndIf} - - AccessControl::SetFileOwner "$0" "(S-1-5-32-545)" - Pop $1 - DetailPrint "WRP: Setting file owner for $0 returned: $1" - - AccessControl::GrantOnFile "$0" "(S-1-5-32-545)" "FullAccess" - Pop $1 - DetailPrint "WRP: Setting access rights for $0 returned: $1" - -!if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1" - !ifdef WFP_FILE_EXCEPTION - VBoxGuestInstallHelper::DisableWFP "$0" - Pop $1 ; Get return value (ignored for now) - DetailPrint "WRP: Setting WFP exception for $0 returned: $1" - !endif -!endif - -FunctionEnd - ; Direct3D support Section /o $(VBOX_COMPONENT_D3D) SEC03 !if $%VBOX_WITH_WDDM% == "1" ${If} $g_bWithWDDM == "true" - ; All D3D components are installed with WDDM driver package, nothing to be done here + ${LogVerbose} "Installing WDDM Direct3D support ..." + + ; Do we need to restore the original d3d8.dll/d3d9.dll files because the guest + ; installation was upgraded from XPDM to WDDM driver? In a XPDM installation + ; those DLLs were replaced by our own stub files. + Call RestoreFilesDirect3D Return ${EndIf} !endif + Call SetAppMode64 SetOverwrite on ${If} $g_strSystemDir == '' @@ -793,7 +809,7 @@ Section /o $(VBOX_COMPONENT_D3D) SEC03 ${EndIf} SetOutPath $g_strSystemDir - DetailPrint "Installing Direct3D support ..." + ${LogVerbose} "Installing XPDM Direct3D support ..." FILE "$%PATH_OUT%\bin\additions\VBoxD3D8.dll" FILE "$%PATH_OUT%\bin\additions\VBoxD3D9.dll" FILE "$%PATH_OUT%\bin\additions\wined3d.dll" @@ -807,20 +823,16 @@ Section /o $(VBOX_COMPONENT_D3D) SEC03 ${CopyFileEx} "" "$g_strSystemDir\dllcache\d3d8.dll" "$g_strSystemDir\dllcache\msd3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" ${CopyFileEx} "" "$g_strSystemDir\dllcache\d3d9.dll" "$g_strSystemDir\dllcache\msd3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" - Push "$g_strSystemDir\dllcache\d3d8.dll" - Call PrepareWRPFile - - Push "$g_strSystemDir\dllcache\d3d9.dll" - Call PrepareWRPFile - ; Exchange DLLs + ${PrepareWRPFileEx} "" "$g_strSystemDir\dllcache\d3d8.dll" ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\dllcache\d3d8.dll" "$TEMP" + ${PrepareWRPFileEx} "" "$g_strSystemDir\dllcache\d3d9.dll" ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\dllcache\d3d9.dll" "$TEMP" ${Else} - DetailPrint "DLL cache does not exist, skipping" + ${LogVerbose} "DLL cache does not exist, skipping" ${EndIf} ${EndIf} - + ; ; Save original DLLs (only if msd3d*.dll does not exist) ... ; @@ -828,21 +840,17 @@ Section /o $(VBOX_COMPONENT_D3D) SEC03 ${CopyFileEx} "" "$g_strSystemDir\d3d8.dll" "$g_strSystemDir\msd3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" ${CopyFileEx} "" "$g_strSystemDir\d3d9.dll" "$g_strSystemDir\msd3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" - Push "$g_strSystemDir\d3d8.dll" - Call PrepareWRPFile - - Push "$g_strSystemDir\d3d9.dll" - Call PrepareWRPFile - ; Exchange DLLs + ${PrepareWRPFileEx} "" "$g_strSystemDir\d3d8.dll" ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d8.dll" "$g_strSystemDir\d3d8.dll" "$TEMP" + ${PrepareWRPFileEx} "" "$g_strSystemDir\d3d9.dll" ${InstallFileEx} "" "$%PATH_OUT%\bin\additions\d3d9.dll" "$g_strSystemDir\d3d9.dll" "$TEMP" !if $%BUILD_TARGET_ARCH% == "amd64" ; Only 64-bit installer: ; Also copy 32-bit DLLs on 64-bit Windows in SysWOW64 node SetOutPath $g_strSysWow64 - DetailPrint "Installing Direct3D support for 32-bit applications (SysWOW64: $g_strSysWow64) ..." + ${LogVerbose} "Installing Direct3D support for 32-bit applications (SysWOW64: $g_strSysWow64) ..." FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxD3D8.dll" FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\VBoxD3D9.dll" FILE "$%VBOX_PATH_ADDITIONS_WIN_X86%\wined3d.dll" @@ -856,17 +864,13 @@ Section /o $(VBOX_COMPONENT_D3D) SEC03 ${CopyFileEx} "" "$g_strSysWow64\dllcache\d3d8.dll" "$g_strSysWow64\dllcache\msd3d8.dll" "Microsoft Corporation" "x86" ${CopyFileEx} "" "$g_strSysWow64\dllcache\d3d9.dll" "$g_strSysWow64\dllcache\msd3d9.dll" "Microsoft Corporation" "x86" - Push "$g_strSysWow64\dllcache\d3d8.dll" - Call PrepareWRPFile - - Push "$g_strSysWow64\dllcache\d3d9.dll" - Call PrepareWRPFile - ; Exchange DLLs + ${PrepareWRPFileEx} "" "$g_strSysWow64\dllcache\d3d8.dll" ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$g_strSysWow64\dllcache\d3d8.dll" "$TEMP" + ${PrepareWRPFileEx} "" "$g_strSysWow64\dllcache\d3d9.dll" ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$g_strSysWow64\dllcache\d3d9.dll" "$TEMP" ${Else} - DetailPrint "DLL cache does not exist, skipping" + ${LogVerbose} "DLL cache does not exist, skipping" ${EndIf} ${EndIf} @@ -878,14 +882,9 @@ Section /o $(VBOX_COMPONENT_D3D) SEC03 ${CopyFileEx} "" "$g_strSysWow64\d3d8.dll" "$g_strSysWow64\msd3d8.dll" "Microsoft Corporation" "x86" ${CopyFileEx} "" "$g_strSysWow64\d3d9.dll" "$g_strSysWow64\msd3d9.dll" "Microsoft Corporation" "x86" - Push "$g_strSysWow64\d3d8.dll" - Call PrepareWRPFile - - Push "$g_strSysWow64\d3d9.dll" - Call PrepareWRPFile - - ; Exchange DLLs + ${PrepareWRPFileEx} "" "$g_strSysWow64\d3d8.dll" ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d8.dll" "$g_strSysWow64\d3d8.dll" "$TEMP" + ${PrepareWRPFileEx} "" "$g_strSysWow64\d3d9.dll" ${InstallFileEx} "" "$%VBOX_PATH_ADDITIONS_WIN_X86%\d3d9.dll" "$g_strSysWow64\d3d9.dll" "$TEMP" !endif ; amd64 @@ -935,7 +934,7 @@ SectionEnd Section -Post !ifdef _DEBUG - DetailPrint "Doing post install ..." + ${LogVerbose} "Doing post install ..." !endif !ifdef EXTERNAL_UNINSTALLER @@ -965,7 +964,7 @@ Section -Post WriteRegStr HKLM "SOFTWARE\Oracle\Sun Ray\ClientInfoAgent\DisconnectActions" "" "" !endif - DetailPrint "Installation completed." + ${LogVerbose} "Installation completed." SectionEnd @@ -1024,7 +1023,8 @@ d3d_install: ${Else} ; D3D unselected again - ${If} $g_strWinVersion != "8" ; On Windows 8 WDDM is mandatory + ${If} $g_strWinVersion != "8" ; On Windows 8 WDDM is mandatory + ${AndIf} $g_strWinVersion != "8_1" ; ... also on Windows 8.1 / Windows 2012 Server R2 StrCpy $g_bWithWDDM "false" ${EndIf} @@ -1044,17 +1044,18 @@ exit: FunctionEnd -; This function is called when a critical error occurred +; This function is called when a critical error occurred, caused by +; the Abort command Function .onInstFailed + ${LogVerbose} "$(VBOX_ERROR_INST_FAILED)" MessageBox MB_ICONSTOP $(VBOX_ERROR_INST_FAILED) /SD IDOK - Push "Error while installing ${PRODUCT_NAME}!" - Push 2 ; Message type = error - Call WriteLogVBoxTray + ${If} $g_bPostInstallStatus == "true" + ${LogToVBoxTray} "2" "Error while installing ${PRODUCT_NAME}!" + ${EndIf} - StrCpy $g_bLogEnable "true" - Call WriteLogUI + ; Set overall exit code SetErrorLevel 1 FunctionEnd @@ -1062,9 +1063,13 @@ FunctionEnd ; This function is called when installation was successful! Function .onInstSuccess - Push "${PRODUCT_NAME} successfully updated!" - Push 0 ; Message type = info - Call WriteLogVBoxTray + ${LogVerbose} "${PRODUCT_NAME} successfully installed" + + ${If} $g_bPostInstallStatus == "true" + ${LogToVBoxTray} "0" "${PRODUCT_NAME} successfully updated!" + ${EndIf} + + SetErrorLevel 0 FunctionEnd @@ -1137,7 +1142,8 @@ Function .onInit ${EndIf} ; Retrieve Windows version and store result in $g_strWinVersion - Call GetWindowsVer + Call GetWindowsVersionEx + Pop $g_strWinVersion ; Retrieve capabilities Call CheckForCapabilities @@ -1145,7 +1151,7 @@ Function .onInit ; Get user Name AccessControl::GetCurrentUserName Pop $g_strCurUser - DetailPrint "Current user: $g_strCurUser" + ${LogVerbose} "Current user: $g_strCurUser" ; Only extract files? This action can be called even from non-Admin users ; and non-compatible architectures @@ -1164,7 +1170,7 @@ Function .onInit !else MessageBox MB_ICONSTOP $(VBOX_NOTICE_ARCH_X86) /SD IDOK !endif - Abort + Abort "$(VBOX_NOTICE_ARCH_AMD64)" ${EndIf} ; Has the user who calls us admin rights? @@ -1187,16 +1193,20 @@ Function .onInit ; Set section bits ${If} $g_bWithAutoLogon == "true" ; Auto-logon support - SectionSetFlags ${SEC02} ${SF_SELECTED} + !insertmacro SelectSection ${SEC02} ${EndIf} !if $%VBOX_WITH_CROGL% == "1" ${If} $g_bWithD3D == "true" ; D3D support - SectionSetFlags ${SEC03} ${SF_SELECTED} + !insertmacro SelectSection ${SEC03} ${EndIf} !endif - ; On Windows 8 we always select the 3D section and - ; disable it so that it cannot be deselected again - ${If} $g_strWinVersion == "8" + ${If} $g_bWithWDDM == "true" ; D3D / WDDM support + !insertmacro SelectSection ${SEC03} + ${EndIf} + ; On Windows 8 / 8.1 / Windows Server 2012 R2 we always select the 3D + ; section and disable it so that it cannot be deselected again + ${If} $g_strWinVersion == "8" + ${OrIf} $g_strWinVersion == "8_1" IntOp $0 ${SF_SELECTED} | ${SF_RO} SectionSetFlags ${SEC03} $0 ${EndIf} @@ -1264,7 +1274,8 @@ proceed: StrCpy $g_strSysWow64 "$WINDIR\SysWOW64" ; Retrieve Windows version we're running on and store it in $g_strWinVersion - Call un.GetWindowsVer + Call un.GetWindowsVersionEx + Pop $g_strWinVersion ; Retrieve capabilities Call un.CheckForCapabilities @@ -1274,8 +1285,7 @@ FunctionEnd Section Uninstall !ifdef _DEBUG - ; Enable logging - Call un.EnableLog + ${LogEnable} "true" !endif Call un.SetAppMode64 @@ -1296,7 +1306,7 @@ Section Uninstall restart: - DetailPrint "Rebooting ..." + ${LogVerbose} "Rebooting ..." Reboot exit: diff --git a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh index 6e377ddc..61615221 100644 --- a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh +++ b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh @@ -4,7 +4,7 @@ ; ; -; Copyright (C) 2006-2012 Oracle Corporation +; Copyright (C) 2006-2014 Oracle Corporation ; ; This file is part of VirtualBox Open Source Edition (OSE), as ; available from http://www.virtualbox.org. This file is free software; @@ -136,7 +136,7 @@ Function ExtractFiles FILE "$%PATH_OUT%\bin\additions\wined3dwddm-x86.dll" !endif ; $%VBOX_WITH_CROGL% == "1" !endif ; $%BUILD_TARGET_ARCH% == "amd64" - + !if $%VBOX_WITH_WDDM_W8% == "1" ; WDDM Video driver for Win8 SetOutPath "$0\VBoxVideoW8" @@ -246,83 +246,6 @@ Function ExtractFiles FunctionEnd !endif ; UNINSTALLER_ONLY -!macro EnableLog un -Function ${un}EnableLog - -!ifdef _DEBUG - Goto log -!endif - - StrCmp $g_bLogEnable "true" log - Goto exit - -log: - - LogSet on - LogText "Start logging." - -exit: - -FunctionEnd -!macroend -!insertmacro EnableLog "" -!insertmacro EnableLog "un." - -!macro WriteLogUI un -Function ${un}WriteLogUI - - IfSilent exit - -!ifdef _DEBUG - Goto log -!endif - - StrCmp $g_bLogEnable "true" log - Goto exit - -log: - - ; Dump log to see what happened - StrCpy $0 "$INSTDIR\${un}install_ui.log" - Push $0 - Call ${un}DumpLog - -exit: - -FunctionEnd -!macroend -!insertmacro WriteLogUI "" -!insertmacro WriteLogUI "un." - -!macro WriteLogVBoxTray un -Function ${un}WriteLogVBoxTray - - ; Pop function parameters off the stack - ; in reverse order - Exch $1 ; Message type (0=Info, 1=Warning, 2=Error) - Exch - Exch $0 ; Body string - - ; @todo Add more paramters here! -!if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1" - ${If} $g_bPostInstallStatus == "true" - ; Parameters: - ; - String: Description / Body - ; - String: Title / Name of application - ; - Integer: Type of message: 0 (Info), 1 (Warning), 2 (Error) - ; - Integer: Time (in msec) to show the notification - VBoxGuestInstallHelper::VBoxTrayShowBallonMsg "$0" "VirtualBox Guest Additions Setup" $1 5000 - Pop $0 ; Get return value (ignored for now) - ${EndIf} -!endif - Pop $0 - Pop $1 - -FunctionEnd -!macroend -!insertmacro WriteLogVBoxTray "" -!insertmacro WriteLogVBoxTray "un." - !macro CheckArchitecture un Function ${un}CheckArchitecture @@ -353,43 +276,51 @@ FunctionEnd !insertmacro CheckArchitecture "" !insertmacro CheckArchitecture "un." -!macro GetWindowsVer un -Function ${un}GetWindowsVer +; +; Macro for retrieving the Windows version this installer is running on. +; +; @return Stack: Windows version string. Empty on error / +; if not able to identify. +; +!macro GetWindowsVersionEx un +Function ${un}GetWindowsVersionEx - ; Check if we are running on w2k or above - ; For other windows versions (>XP) it may be necessary to change winver.nsh - Call ${un}GetWindowsVersion - Pop $R3 ; Windows Version + Push $0 + Push $1 - Push $R3 ; The windows version string - Push "NT" ; String to search for. Win 2k family returns no string containing 'NT' - Call ${un}StrStr - Pop $R0 - StrCmp $R0 '' nt5plus ; Not NT 3.XX or 4.XX + ; Check if we are running on Windows 2000 or above + ; For other windows versions (> XP) it may be necessary to change winver.nsh + Call ${un}GetWindowsVersion + Pop $0 ; Windows Version - ; Ok we know it is NT. Must be a string like NT X.XX - Push $R3 ; The windows version string - Push "4." ; String to search for + Push $0 ; The windows version string + Push "NT" ; String to search for. W2K+ returns no string containing "NT" Call ${un}StrStr - Pop $R0 - StrCmp $R0 "" nt5plus nt4 ; If empty -> not NT 4 - -nt5plus: ; Windows 2000+ (XP, Vista, ...) - - StrCpy $g_strWinVersion $R3 - goto exit - -nt4: ; NT 4.0 + Pop $1 - StrCpy $g_strWinVersion "NT4" - goto exit + ${If} $1 == "" ; If empty -> not NT 3.XX or 4.XX + ; $0 contains the original version string + ${Else} + ; Ok we know it is NT. Must be a string like NT X.XX + Push $0 ; The windows version string + Push "4." ; String to search for + Call ${un}StrStr + Pop $1 + ${If} $1 == "" ; If empty -> not NT 4 + ;; @todo NT <= 3.x ? + ; $0 contains the original version string + ${Else} + StrCpy $0 "NT4" + ${EndIf} + ${EndIf} -exit: + Pop $1 + Exch $0 FunctionEnd !macroend -!insertmacro GetWindowsVer "" -!insertmacro GetWindowsVer "un." +!insertmacro GetWindowsVersionEx "" +!insertmacro GetWindowsVersionEx "un." !macro GetAdditionsVersion un Function ${un}GetAdditionsVersion @@ -465,22 +396,22 @@ Function ${un}StopVBoxService Push $3 ; Safety counter StrCpy $3 "0" ; Init counter - DetailPrint "Stopping VBoxService ..." + ${LogVerbose} "Stopping VBoxService ..." svc_stop: - LogText "Stopping VBoxService (as service) ..." + ${LogVerbose} "Stopping VBoxService via SCM ..." ${If} $g_strWinVersion == "NT4" - nsExec::Exec '"$SYSDIR\net.exe" stop VBoxService' + nsExec::Exec '"$SYSDIR\net.exe" stop VBoxService' ${Else} - nsExec::Exec '"$SYSDIR\SC.exe" stop VBoxService' + nsExec::Exec '"$SYSDIR\SC.exe" stop VBoxService' ${EndIf} Sleep "1000" ; Wait a bit exe_stop: !ifdef _DEBUG - DetailPrint "Stopping VBoxService (as exe) ..." + ${LogVerbose} "Stopping VBoxService (as exe) ..." !endif exe_stop_loop: @@ -488,7 +419,9 @@ exe_stop_loop: IntCmp $3 10 exit ; Only try this loop 10 times max IntOp $3 $3 + 1 ; Increment - LogText "Try: $3" +!ifdef _DEBUG + ${LogVerbose} "Stopping attempt #$3" +!endif ${If} $g_strWinVersion == "NT4" StrCpy $2 "VBoxServiceNT.exe" @@ -500,12 +433,12 @@ exe_stop_loop: StrCmp $0 0 0 exit ${nsProcess::KillProcess} $2 $0 - Sleep "1000" ; Wait a bit + Sleep "1000" ; Wait a bit Goto exe_stop_loop exit: - DetailPrint "Stopping VBoxService done." + ${LogVerbose} "Stopping VBoxService done" Pop $3 Pop $2 @@ -524,7 +457,7 @@ Function ${un}StopVBoxTray Push $1 ; Safety counter StrCpy $1 "0" ; Init counter - DetailPrint "Stopping VBoxTray ..." + ${LogVerbose} "Stopping VBoxTray ..." exe_stop: @@ -540,7 +473,7 @@ exe_stop: exit: - DetailPrint "Stopping VBoxTray done." + ${LogVerbose} "Stopping VBoxTray done" Pop $1 Pop $0 @@ -590,12 +523,12 @@ FunctionEnd !macro AbortShutdown un Function ${un}AbortShutdown - Push $0 - - ; Try to abort the shutdown - nsExec::ExecToLog '"$g_strSystemDir\shutdown.exe" -a' $0 - - Pop $0 + ${If} ${FileExists} "$g_strSystemDir\shutdown.exe" + ; Try to abort the shutdown + ${CmdExecute} "$\"$g_strSystemDir\shutdown.exe$\" -a" "true" + ${Else} + ${LogVerbose} "Shutting down not supported: Binary $\"$g_strSystemDir\shutdown.exe$\" not found" + ${EndIf} FunctionEnd !macroend @@ -607,15 +540,19 @@ Function ${un}CheckForWDDMCapability !if $%VBOX_WITH_WDDM% == "1" ; If we're on a 32-bit Windows Vista / 7 / 8 we can use the WDDM driver - ${If} $g_strWinVersion == "Vista" + ${If} $g_strWinVersion == "Vista" ${OrIf} $g_strWinVersion == "7" ${OrIf} $g_strWinVersion == "8" + ${OrIf} $g_strWinVersion == "8_1" StrCpy $g_bCapWDDM "true" + ${LogVerbose} "OS is WDDM driver capable" ${EndIf} ; If we're on Windows 8 we *have* to use the WDDM driver, so select it ; by default - ${If} $g_strWinVersion == "8" + ${If} $g_strWinVersion == "8" + ${OrIf} $g_strWinVersion == "8_1" StrCpy $g_bWithWDDM "true" + ${LogVerbose} "OS needs WDDM driver by default" ${EndIf} !endif @@ -634,10 +571,12 @@ Function ${un}CheckForCapabilities StrCpy $g_iSystemMode $0 ; Does the guest have a DLL cache? - ${If} $g_strWinVersion == "Vista" + ${If} $g_strWinVersion == "Vista" ${OrIf} $g_strWinVersion == "7" ${OrIf} $g_strWinVersion == "8" + ${OrIf} $g_strWinVersion == "8_1" StrCpy $g_bCapDllCache "true" + ${LogVerbose} "OS has a DLL cache" ${EndIf} ; Check whether this OS is capable of handling WDDM drivers @@ -836,15 +775,15 @@ FunctionEnd Push "${Architecture}" Push "${Vendor}" Push "${File}" - DetailPrint "Verifying file $\"${File}$\" ..." + ${LogVerbose} "Verifying file $\"${File}$\" ..." Call ${un}VerifyFile Pop $0 ${If} $0 == "0" - DetailPrint "Verification of file $\"${File}$\" successful (Vendor: ${Vendor}, Architecture: ${Architecture})" + ${LogVerbose} "Verification of file $\"${File}$\" successful (Vendor: ${Vendor}, Architecture: ${Architecture})" ${ElseIf} $0 == "1" - DetailPrint "Verification of file $\"${File}$\" failed (not Vendor: ${Vendor}, and/or not Architecture: ${Architecture})" + ${LogVerbose} "Verification of file $\"${File}$\" failed (not Vendor: ${Vendor}, and/or not Architecture: ${Architecture})" ${Else} - DetailPrint "Skipping to file $\"${File}$\"; not found" + ${LogVerbose} "Skipping to file $\"${File}$\"; not found" ${EndIf} ; Push result popped off the stack to stack again Push $0 @@ -852,7 +791,7 @@ FunctionEnd !define VerifyFileEx "!insertmacro VerifyFileEx" ; -; Macro for copying a file only if the source file is verified +; Macro for copying a file only if the source file is verified ; to be from a certain vendor and architecture. ; @return Stack: "0" if copied, "1" if not, "2" on error / not found. ; @param Un/Installer prefix; either "" or "un". @@ -865,14 +804,24 @@ FunctionEnd Push $0 Push "${Architecture}" Push "${Vendor}" - Push "${FileSrc}" + Push "${FileSrc}" Call ${un}VerifyFile Pop $0 ${If} $0 == "0" - DetailPrint "Copying verified file $\"${FileSrc}$\" to $\"${FileDest}$\" ..." + ${LogVerbose} "Copying verified file $\"${FileSrc}$\" to $\"${FileDest}$\" ..." + ClearErrors + SetOverwrite on CopyFiles /SILENT "${FileSrc}" "${FileDest}" + ${If} ${Errors} + CreateDirectory "$TEMP\${PRODUCT_NAME}" + ${GetFileName} "${FileSrc}" $0 ; Get the base name + CopyFiles /SILENT "${FileSrc}" "$TEMP\${PRODUCT_NAME}\$0" + ${LogVerbose} "Immediate installation failed, postponing to next reboot (temporary location is: $\"$TEMP\${PRODUCT_NAME}\$0$\") ..." + ;${InstallFileEx} "${un}" "${FileSrc}" "${FileDest}" "$TEMP" ; Only works with compile time files! + System::Call "kernel32::MoveFileEx(t '$TEMP\${PRODUCT_NAME}\$0', t '${FileDest}', i 5)" + ${EndIf} ${Else} - DetailPrint "Skipping to copy file $\"${FileSrc}$\" to $\"${FileDest}$\" (not Vendor: ${Vendor}, Architecture: ${Architecture})" + ${LogVerbose} "Skipping to copy file $\"${FileSrc}$\" to $\"${FileDest}$\" (not Vendor: ${Vendor}, Architecture: ${Architecture})" ${EndIf} ; Push result popped off the stack to stack again Push $0 @@ -883,12 +832,12 @@ FunctionEnd ; Macro for installing a library/DLL. ; @return Stack: "0" if copied, "1" if not, "2" on error / not found. ; @param Un/Installer prefix; either "" or "un". -; @param Name of lib/DLL to verify and copy to destination. -; @param Destination name to copy verified file to. +; @param Name of lib/DLL to copy to destination. +; @param Destination name to copy the source file to. ; @param Temporary folder used for exchanging the (locked) lib/DLL after a reboot. ; !macro InstallFileEx un FileSrc FileDest DirTemp - DetailPrint "Installing library $\"${FileSrc}$\" to $\"${FileDest}$\" ..." + ${LogVerbose} "Installing library $\"${FileSrc}$\" to $\"${FileDest}$\" ..." ; Try the gentle way and replace the file instantly !insertmacro InstallLib DLL NOTSHARED NOREBOOT_NOTPROTECTED "${FileSrc}" "${FileDest}" "${DirTemp}" ; If the above call didn't help, use a (later) reboot to replace the file @@ -911,19 +860,75 @@ FunctionEnd Push "${Architecture}" Push "${Vendor}" Push "${FileSrc}" - DetailPrint "Verifying library $\"${FileSrc}$\" ..." + ${LogVerbose} "Verifying library $\"${FileSrc}$\" ..." Call ${un}VerifyFile Pop $0 ${If} $0 == "0" ${InstallFileEx} ${un} ${FileSrc} ${FileDest} ${DirTemp} ${Else} - DetailPrint "File $\"${FileSrc}$\" did not pass verification (Vendor: ${Vendor}, Architecture: ${Architecture})" + ${LogVerbose} "File $\"${FileSrc}$\" did not pass verification (Vendor: ${Vendor}, Architecture: ${Architecture})" ${EndIf} ; Push result popped off the stack to stack again. Push $0 !macroend !define InstallFileVerify "!insertmacro InstallFileVerify" +; Prepares the access rights for replacing +; a WRP (Windows Resource Protection) protected file +!macro PrepareWRPFile un +Function ${un}PrepareWRPFile + + Pop $0 + Push $1 + + ${IfNot} ${FileExists} "$0" + ${LogVerbose} "WRP: File $\"$0$\" does not exist, skipping" + Return + ${EndIf} + + ${If} ${FileExists} "$g_strSystemDir\takeown.exe" + ${CmdExecute} "$\"$g_strSystemDir\takeown.exe$\" /F $\"$0$\"" "true" + ${Else} + ${LogVerbose} "WRP: Warning: takeown.exe not found, skipping" + ${EndIf} + + AccessControl::SetFileOwner "$0" "(S-1-5-32-545)" + Pop $1 + ${LogVerbose} "WRP: Setting file owner for $\"$0$\" returned: $1" + + AccessControl::GrantOnFile "$0" "(S-1-5-32-545)" "FullAccess" + Pop $1 + ${LogVerbose} "WRP: Setting access rights for $\"$0$\" returned: $1" + +!if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1" + !ifdef WFP_FILE_EXCEPTION + VBoxGuestInstallHelper::DisableWFP "$0" + Pop $1 ; Get return value (ignored for now) + ${LogVerbose} "WRP: Setting WFP exception for $\"$0$\" returned: $1" + !endif +!endif + + Pop $1 + +FunctionEnd +!macroend +!insertmacro PrepareWRPFile "" +!insertmacro PrepareWRPFile "un." + +; +; Macro for preparing the access rights for replacing +; a WRP (Windows Resource Protection) protected file. +; @return None. +; @param Path of file to prepare. +; +!macro PrepareWRPFileEx un FileSrc + Push $0 + Push "${FileSrc}" + Call ${un}PrepareWRPFile + Pop $0 +!macroend +!define PrepareWRPFileEx "!insertmacro PrepareWRPFileEx" + ; ; Validates backed up and replaced Direct3D files; either the d3d*.dll have ; to be from Microsoft or the (already) backed up msd3d*.dll files. If both @@ -936,13 +941,13 @@ Function ${un}ValidateD3DFiles Push $0 ; We need to switch to 64-bit app mode to handle the "real" 64-bit files in - ; ""system32" on a 64-bit guest + ; "system32" on a 64-bit guest Call ${un}SetAppMode64 ; Note: Not finding a file (like *d3d8.dll) on Windows Vista/7 is fine; ; it simply is not present there. - - ; Note 2: On 64-bit systems there are no 64-bit *d3d8 DLLs, only 32-bit ones + + ; Note 2: On 64-bit systems there are no 64-bit *d3d8 DLLs, only 32-bit ones ; in SysWOW64 (or in system32 on 32-bit systems). !if $%BUILD_TARGET_ARCH% == "x86" @@ -952,7 +957,7 @@ Function ${un}ValidateD3DFiles Goto verify_msd3d ${EndIf} !endif - + ${VerifyFileEx} "${un}" "$SYSDIR\d3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" Pop $0 ${If} $0 == "1" @@ -1079,3 +1084,70 @@ FunctionEnd !macroend !insertmacro ValidateFilesDirect3D "" !insertmacro ValidateFilesDirect3D "un." + +; +; Restores formerly backed up Direct3D original files, which were replaced by +; a VBox XPDM driver installation before. This might be necessary for upgrading a +; XPDM installation to a WDDM one. +; @return Stack: "0" if files were restored successfully; otherwise "1". +; +!macro RestoreFilesDirect3D un +Function ${un}RestoreFilesDirect3D + + Push $0 + + ; We need to switch to 64-bit app mode to handle the "real" 64-bit files in + ; "system32" on a 64-bit guest + Call ${un}SetAppMode64 + + ; Note: Not finding a file (like *d3d8.dll) on Windows Vista/7 is fine; + ; it simply is not present there. + + ; Note 2: On 64-bit systems there are no 64-bit *d3d8 DLLs, only 32-bit ones + ; in SysWOW64 (or in system32 on 32-bit systems). + + ${LogVerbose} "Restoring original D3D files ..." +!if $%BUILD_TARGET_ARCH% == "x86" + ${PrepareWRPFileEx} "${un}" "$SYSDIR\d3d8.dll" + ${CopyFileEx} "${un}" "$SYSDIR\msd3d8.dll" "$SYSDIR\d3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" +!endif + ${PrepareWRPFileEx} "${un}" "$SYSDIR\d3d9.dll" + ${CopyFileEx} "${un}" "$SYSDIR\msd3d9.dll" "$SYSDIR\d3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" + + ${If} $g_bCapDllCache == "true" +!if $%BUILD_TARGET_ARCH% == "x86" + ${PrepareWRPFileEx} "${un}" "$SYSDIR\dllcache\d3d8.dll" + ${CopyFileEx} "${un}" "$SYSDIR\dllcache\msd3d8.dll" "$SYSDIR\dllcache\d3d8.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" +!endif + ${PrepareWRPFileEx} "${un}" "$SYSDIR\dllcache\d3d9.dll" + ${CopyFileEx} "${un}" "$SYSDIR\dllcache\msd3d9.dll" "$SYSDIR\dllcache\d3d9.dll" "Microsoft Corporation" "$%BUILD_TARGET_ARCH%" + ${EndIf} + +!if $%BUILD_TARGET_ARCH% == "amd64" + ${PrepareWRPFileEx} "${un}" "$g_strSysWow64\d3d8.dll" + ${CopyFileEx} "${un}" "$g_strSysWow64\msd3d8.dll" "$g_strSysWow64\d3d8.dll" "Microsoft Corporation" "x86" + ${PrepareWRPFileEx} "${un}" "$g_strSysWow64\d3d9.dll" + ${CopyFileEx} "${un}" "$g_strSysWow64\msd3d9.dll" "$g_strSysWow64\d3d9.dll" "Microsoft Corporation" "x86" + + ${If} $g_bCapDllCache == "true" + ${PrepareWRPFileEx} "${un}" "$g_strSysWow64\dllcache\d3d8.dll" + ${CopyFileEx} "${un}" "$g_strSysWow64\dllcache\msd3d8.dll" "$g_strSysWow64\dllcache\d3d8.dll" "Microsoft Corporation" "x86" + ${PrepareWRPFileEx} "${un}" "$g_strSysWow64\dllcache\d3d9.dll" + ${CopyFileEx} "${un}" "$g_strSysWow64\dllcache\msd3d9.dll" "$g_strSysWow64\dllcache\d3d9.dll" "Microsoft Corporation" "x86" + ${EndIf} +!endif + + ; Do a re-validation afterwards. + Call ${un}ValidateD3DFiles + Pop $0 + ${If} $0 == "1" ; D3D files are invalid + ${LogVerbose} $(VBOX_UNINST_UNABLE_TO_RESTORE_D3D) + MessageBox MB_ICONSTOP|MB_OK $(VBOX_UNINST_UNABLE_TO_RESTORE_D3D) /SD IDOK + ${EndIf} + + Exch $0 + +FunctionEnd +!macroend +!insertmacro RestoreFilesDirect3D "" +!insertmacro RestoreFilesDirect3D "un." diff --git a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsExternal.nsh b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsExternal.nsh new file mode 100644 index 00000000..11a94451 --- /dev/null +++ b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsExternal.nsh @@ -0,0 +1,75 @@ +; $Id: VBoxGuestAdditionsExternal.nsh $ +;; @file +; VBoxGuestAdditionExternal.nsh - Utility function for invoking external +; applications. +; + +; +; Copyright (C) 2013 Oracle Corporation +; +; This file is part of VirtualBox Open Source Edition (OSE), as +; available from http://www.virtualbox.org. This file is free software; +; you can redistribute it and/or modify it under the terms of the GNU +; General Public License (GPL) as published by the Free Software +; Foundation, in version 2 as it comes in the "COPYING" file of the +; VirtualBox OSE distribution. VirtualBox OSE is distributed in the +; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +; + +; +; Macro for executing external applications. Uses the nsExec plugin +; in different styles, depending on whether this installer runs in silent mode +; or not. If the external program reports an exit code other than 0 the installer +; will be aborted. +; +; @param Command line (full qualified and quoted). +; @param If set to "true" the installer aborts if the external program reports +; an exit code other than 0, "false" just prints a warning and continues +; execution. +; +!macro _cmdExecute cmdline optional + + Push $0 + Push $1 + + !define _macroLoc ${__LINE__} + + ${LogVerbose} "Executing: ${cmdline}" + IfSilent silent_${_macroLoc} +1 + nsExec::ExecToLog "${cmdline}" + Pop $0 ; Return value (exit code) + goto done_${_macroLoc} + +silent_${_macroLoc}: + + nsExec::ExecToStack "${cmdline}" + Pop $0 ; Return value (exit code) + Pop $1 ; Stdout/stderr output (up to ${NSIS_MAX_STRLEN}) + ${LogVerbose} "$1" + goto done_${_macroLoc} + +done_${_macroLoc}: + + ${LogVerbose} "Execution returned exit code: $0" + IntCmp $0 0 +1 error_${_macroLoc} error_${_macroLoc} ; Check ret value (0=OK, 1=Error) + goto return_${_macroLoc} + +error_${_macroLoc}: + + ${If} ${optional} == "false" + ${LogVerbose} "Error excuting $\"${cmdline}$\" (exit code: $0) -- aborting installation" + Abort "Error excuting $\"${cmdline}$\" (exit code: $0) -- aborting installation" + ${Else} + ${LogVerbose} "Warning: Executing $\"${cmdline}$\" returned with exit code $0" + ${EndIf} + goto return_${_macroLoc} + +return_${_macroLoc}: + + Pop $1 + Pop $0 + + !undef _macroLoc + +!macroend +!define CmdExecute "!insertmacro _cmdExecute" diff --git a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsLog.nsh b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsLog.nsh new file mode 100644 index 00000000..2ce2412e --- /dev/null +++ b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsLog.nsh @@ -0,0 +1,73 @@ +; $Id: VBoxGuestAdditionsLog.nsh $ +;; @file +; VBoxGuestAdditionLog.nsh - Logging functions. +; + +; +; Copyright (C) 2013 Oracle Corporation +; +; This file is part of VirtualBox Open Source Edition (OSE), as +; available from http://www.virtualbox.org. This file is free software; +; you can redistribute it and/or modify it under the terms of the GNU +; General Public License (GPL) as published by the Free Software +; Foundation, in version 2 as it comes in the "COPYING" file of the +; VirtualBox OSE distribution. VirtualBox OSE is distributed in the +; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +; + +; +; Macro for enable/disable logging +; @param "true" to enable logging, "false" to disable. +; +!macro _logEnable enable + + ${If} ${enable} == "true" + LogSet on + ${LogVerbose} "Started logging into separate file" + ${Else} + ${LogVerbose} "Stopped logging into separate file" + LogSet off + ${EndIf} + +!macroend +!define LogEnable "!insertmacro _logEnable" + +; +; Macro for (verbose) logging +; @param Text to log. +; +!macro _logVerbose text + + LogText "${text}" + IfSilent +2 + DetailPrint "${text}" + +!macroend +!define LogVerbose "!insertmacro _logVerbose" + +; +; Sends a logging text to the running instance of VBoxTray +; which then presents to text via balloon popup in the system tray (if enabled). +; +; @param Message type (0=Info, 1=Warning, 2=Error). +; @param Message text. +; +; @todo Add message timeout as parameter. +; +!macro _logToVBoxTray type text + + ${LogVerbose} "${text}" +!if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1" + Push $0 + ; Parameters: + ; - String: Description / Body + ; - String: Title / Name of application + ; - Integer: Type of message: 0 (Info), 1 (Warning), 2 (Error) + ; - Integer: Time (in msec) to show the notification + VBoxGuestInstallHelper::VBoxTrayShowBallonMsg "${text}" "VirtualBox Guest Additions Setup" ${type} 5000 + Pop $0 ; Get return value (ignored for now) + Pop $0 ; Restore original $0 from stack +!endif + +!macroend +!define LogToVBoxTray "!insertmacro _logToVBoxTray"
\ No newline at end of file diff --git a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsNT4.nsh b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsNT4.nsh index 39228180..0076ed39 100644 --- a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsNT4.nsh +++ b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsNT4.nsh @@ -4,7 +4,7 @@ ; ; -; Copyright (C) 2006-2012 Oracle Corporation +; Copyright (C) 2006-2013 Oracle Corporation ; ; This file is part of VirtualBox Open Source Edition (OSE), as ; available from http://www.virtualbox.org. This file is free software; @@ -25,7 +25,7 @@ Function NT4_SetVideoResolution missingParms: - DetailPrint "Missing display parameters for NT4, setting default (640x480, 8 BPP) ..." + ${LogVerbose} "Missing display parameters for NT4, setting default (640x480, 8 BPP) ..." StrCpy $g_iScreenX '640' ; Default value StrCpy $g_iScreenY '480' ; Default value @@ -36,7 +36,7 @@ missingParms: haveParms: - DetailPrint "Setting display parameters for NT4 ($g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP) ..." + ${LogVerbose} "Setting display parameters for NT4 ($g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP) ..." WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\vboxvideo\Device0" "DefaultSettings.BitsPerPel" $g_iScreenBpp WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\vboxvideo\Device0" "DefaultSettings.Flags" 0x00000000 @@ -67,20 +67,20 @@ Function NT4_SaveMouseDriverInfo ReadRegStr $0 HKLM "${PRODUCT_UNINST_KEY}" ${ORG_MOUSE_PATH} StrCmp $0 "" 0 exists - DetailPrint "Saving mouse driver info ..." + ${LogVerbose} "Saving mouse driver info ..." ReadRegStr $0 HKLM "SYSTEM\CurrentControlSet\Services\i8042prt" "ImagePath" WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" ${ORG_MOUSE_PATH} $0 Goto exit exists: - DetailPrint "Mouse driver info already saved." + ${LogVerbose} "Mouse driver info already saved." Goto exit exit: !ifdef _DEBUG - DetailPrint "Mouse driver info: $0" + ${LogVerbose} "Mouse driver info: $0" !endif Pop $0 @@ -109,7 +109,7 @@ FunctionEnd Function NT4_CopyFiles - DetailPrint "Copying files for NT4 ..." + ${LogVerbose} "Copying files for NT4 ..." SetOutPath "$INSTDIR" FILE "$%PATH_OUT%\bin\additions\VBoxGuestDrvInst.exe" @@ -136,10 +136,10 @@ FunctionEnd Function NT4_InstallFiles - DetailPrint "Installing drivers for NT4 ..." + ${LogVerbose} "Installing drivers for NT4 ..." ; Install guest driver - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service create "VBoxGuest" "VBoxGuest Support Driver" 1 1 "$SYSDIR\drivers\VBoxGuestNT.sys" "Base"' + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxGuest$\" $\"VBoxGuest Support Driver$\" 1 1 $\"$SYSDIR\drivers\VBoxGuestNT.sys$\" $\"Base$\"" "false" ; Bugfix: Set "Start" to 1, otherwise, VBoxGuest won't start on boot-up! ; Bugfix: Correct invalid "ImagePath" (\??\C:\WINNT\...) @@ -150,22 +150,20 @@ Function NT4_InstallFiles WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray" '"$SYSDIR\VBoxTray.exe"' ; Video driver - nsExec::ExecToLog '"$INSTDIR\VBoxGuestDrvInst.exe" /i' - Pop $0 ; Ret value - IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error) + ${CmdExecute} "$\"$INSTDIR\VBoxGuestDrvInst.exe$\" /i" "false" - DetailPrint "Installing VirtualBox service ..." + ${LogVerbose} "Installing VirtualBox service ..." ; Create the VBoxService service ; No need to stop/remove the service here! Do this only on uninstallation! - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service create "VBoxService" "VirtualBox Guest Additions Service" 16 2 "system32\VBoxServiceNT.exe" "Base"' + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxService$\" $\"VirtualBox Guest Additions Service$\" 16 2 $\"system32\VBoxServiceNT.exe$\" $\"Base$\"" "false" ; Create the Shared Folders service ... ;nsSCM::Install /NOUNLOAD "VBoxSF" "VirtualBox Shared Folders" 1 1 "$SYSDIR\drivers\VBoxSFNT.sys" "Network" "" "" "" ;Pop $0 ; Ret value !ifdef _DEBUG - ;DetailPrint "SCM::Install VBoxSFNT.sys: $0" + ;${LogVerbose} "SCM::Install VBoxSFNT.sys: $0" !endif ;IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error) @@ -176,9 +174,7 @@ Function NT4_InstallFiles ;WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "ProviderPath" "$SYSDIR\VBoxMRXNP.dll" ; Add the shared folders network provider - ;nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider add VBoxSF' - ;Pop $0 ; Ret value - ;IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error) + ;${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add VBoxSF" "false" Goto done @@ -226,13 +222,12 @@ Function ${un}NT4_Uninstall Push $0 ; Remove the guest driver service - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxGuest' + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxGuest" "true" Delete /REBOOTOK "$SYSDIR\drivers\VBoxGuestNT.sys" ; Delete the VBoxService service Call ${un}StopVBoxService - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxService' - Pop $0 ; Ret value + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxService" "true" DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService" Delete /REBOOTOK "$SYSDIR\VBoxServiceNT.exe" @@ -247,7 +242,7 @@ Function ${un}NT4_Uninstall Delete /REBOOTOK "$SYSDIR\VBoxControl.exe" ; Delete the VBoxVideo service - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxVideo' + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideo" "true" ; Delete the VBox video driver files Delete /REBOOTOK "$SYSDIR\drivers\VBoxVideo.sys" @@ -259,7 +254,7 @@ Function ${un}NT4_Uninstall ; warn the user and set it to the default driver to not screw up NT4 here ${If} $0 == "System32\DRIVERS\VBoxMouseNT.sys" WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\i8042prt" "ImagePath" "System32\DRIVERS\i8042prt.sys" - DetailPrint "Old mouse driver is set to VBoxMouseNT.sys, defaulting to i8042prt.sys ..." + ${LogVerbose} "Old mouse driver is set to VBoxMouseNT.sys, defaulting to i8042prt.sys ..." ${Else} WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\i8042prt" "ImagePath" $0 ${EndIf} diff --git a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsUninstall.nsh b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsUninstall.nsh index 7138102c..d99bd55b 100644 --- a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsUninstall.nsh +++ b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsUninstall.nsh @@ -4,7 +4,7 @@ ; ; -; Copyright (C) 2006-2012 Oracle Corporation +; Copyright (C) 2006-2013 Oracle Corporation ; ; This file is part of VirtualBox Open Source Edition (OSE), as ; available from http://www.virtualbox.org. This file is free software; @@ -69,10 +69,10 @@ FunctionEnd !macro Uninstall un Function ${un}Uninstall - DetailPrint "Uninstalling system files ..." + ${LogVerbose} "Uninstalling system files ..." !ifdef _DEBUG - DetailPrint "Detected OS version: Windows $g_strWinVersion" - DetailPrint "System Directory: $g_strSystemDir" + ${LogVerbose} "Detected OS version: Windows $g_strWinVersion" + ${LogVerbose} "System Directory: $g_strSystemDir" !endif ; Which OS are we using? @@ -85,6 +85,7 @@ Function ${un}Uninstall StrCmp $g_strWinVersion "Vista" vista ; Windows Vista StrCmp $g_strWinVersion "7" vista ; Windows 7 StrCmp $g_strWinVersion "8" vista ; Windows 8 + StrCmp $g_strWinVersion "8_1" vista ; Windows 8.1 / Windows Server 2012 R2 ${If} $g_bForceInstall == "true" Goto vista ; Assume newer OS than we know of ... @@ -127,10 +128,10 @@ FunctionEnd !macro UninstallInstDir un Function ${un}UninstallInstDir - DetailPrint "Uninstalling directory ..." + ${LogVerbose} "Uninstalling directory ..." !ifdef _DEBUG - DetailPrint "Detected OS version: Windows $g_strWinVersion" - DetailPrint "System Directory: $g_strSystemDir" + ${LogVerbose} "Detected OS version: Windows $g_strWinVersion" + ${LogVerbose} "System Directory: $g_strSystemDir" !endif ; Which OS are we using? @@ -143,6 +144,7 @@ Function ${un}UninstallInstDir StrCmp $g_strWinVersion "Vista" vista ; Windows Vista StrCmp $g_strWinVersion "7" vista ; Windows 7 StrCmp $g_strWinVersion "8" vista ; Windows 8 + StrCmp $g_strWinVersion "8_1" vista ; Windows 8.1 / Windows Server 2012 R2 ${If} $g_bForceInstall == "true" Goto vista ; Assume newer OS than we know of ... diff --git a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsUninstallOld.nsh b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsUninstallOld.nsh index f241cee7..46cd4e58 100644 --- a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsUninstallOld.nsh +++ b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsUninstallOld.nsh @@ -5,7 +5,7 @@ ; ; -; Copyright (C) 2006-2011 Oracle Corporation +; Copyright (C) 2006-2013 Oracle Corporation ; ; This file is part of VirtualBox Open Source Edition (OSE), as ; available from http://www.virtualbox.org. This file is free software; @@ -90,7 +90,7 @@ Function ${un}Uninstall_WipeInstallationDirectory Push $2 ; Do some basic sanity checks for not screwing up too fatal ... - DetailPrint "Removing old installation directory ($0) ..." + ${LogVerbose} "Removing old installation directory ($0) ..." ${If} $0 != $PROGRAMFILES ${AndIf} $0 != $PROGRAMFILES32 ${AndIf} $0 != $PROGRAMFILES64 @@ -98,7 +98,7 @@ Function ${un}Uninstall_WipeInstallationDirectory ${AndIf} $0 != $COMMONFILES64 ${AndIf} $0 != $WINDIR ${AndIf} $0 != $SYSDIR - DetailPrint "Wiping ($0) ..." + ${LogVerbose} "Wiping ($0) ..." Goto wipe ${EndIf} Goto wipe_abort @@ -111,7 +111,7 @@ wipe: wipe_abort: - DetailPrint "Won't remove directory ($0)!" + ${LogVerbose} "Won't remove directory ($0)!" StrCpy $0 1 ; Signal some failure Goto exit diff --git a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsVista.nsh b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsVista.nsh index 87020af2..a2f7e15d 100644 --- a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsVista.nsh +++ b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsVista.nsh @@ -19,10 +19,10 @@ Function Vista_CheckForRequirements Push $0 - DetailPrint "Checking for installation requirements for Vista / Windows 7 / Windows 8 ..." + ${LogVerbose} "Checking for installation requirements for Vista / Windows 7 / Windows 8 ..." ${If} $g_bForceInstall == "true" - DetailPrint "Forcing installatoin, checking requirements skipped" + ${LogVerbose} "Forcing installation, checking requirements skipped" goto success ${EndIf} @@ -101,7 +101,7 @@ FunctionEnd Function Vista_InstallFiles - DetailPrint "Installing drivers for Vista / Windows 7 / Windows 8 ..." + ${LogVerbose} "Installing drivers for Vista / Windows 7 / Windows 8 ..." SetOutPath "$INSTDIR" ; Nothing here yet @@ -168,7 +168,7 @@ FunctionEnd Function ${un}Vista_Uninstall ; Remove credential provider - DetailPrint "Removing auto-logon support ..." + ${LogVerbose} "Removing auto-logon support ..." DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}" DeleteRegKey HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}" Delete /REBOOTOK "$g_strSystemDir\VBoxCredProv.dll" diff --git a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsW2KXP.nsh b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsW2KXP.nsh index 202116d9..8c74f169 100644 --- a/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsW2KXP.nsh +++ b/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsW2KXP.nsh @@ -1,10 +1,10 @@ ; $Id$ -; @file +;; @file ; VBoxGuestAdditionsW2KXP.nsh - Guest Additions installation for Windows 2000/XP. ; ; -; Copyright (C) 2006-2012 Oracle Corporation +; Copyright (C) 2006-2013 Oracle Corporation ; ; This file is part of VirtualBox Open Source Edition (OSE), as ; available from http://www.virtualbox.org. This file is free software; @@ -29,7 +29,7 @@ Function W2K_SetVideoResolution StrCmp $g_iScreenY "0" exit StrCmp $g_iScreenBpp "0" exit - DetailPrint "Setting display parameters ($g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP) ..." + ${LogVerbose} "Setting display parameters ($g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP) ..." ; Enumerate all video devices (up to 32 at the moment, use key "MaxObjectNumber" key later) ${For} $i 0 32 @@ -55,13 +55,13 @@ Function W2K_SetVideoResolution ; Get device description ReadRegStr $dev_desc HKLM "$tmppath" "Device Description" !ifdef _DEBUG - DetailPrint "Registry path: $tmppath" - DetailPrint "Registry path to device name: $temp" + ${LogVerbose} "Registry path: $tmppath" + ${LogVerbose} "Registry path to device name: $temp" !endif - DetailPrint "Detected video device: $dev_desc" + ${LogVerbose} "Detected video device: $dev_desc" ${If} $dev_desc == "VirtualBox Graphics Adapter" - DetailPrint "VirtualBox video device found!" + ${LogVerbose} "VirtualBox video device found!" Goto dev_found ${EndIf} ${Next} @@ -78,7 +78,7 @@ dev_found: dev_found_detect_id: StrCpy $i 0 ; Start at index 0 - DetailPrint "Detecting device ID ..." + ${LogVerbose} "Detecting device ID ..." dev_found_detect_id_loop: @@ -86,11 +86,11 @@ dev_found_detect_id_loop: EnumRegKey $dev_id HKLM "SYSTEM\CurrentControlSet\Control\Video" $i StrCmp $dev_id "" dev_not_found ; No more entries? Jump out !ifdef _DEBUG - DetailPrint "Got device ID: $dev_id" + ${LogVerbose} "Got device ID: $dev_id" !endif ReadRegStr $dev_desc HKLM "SYSTEM\CurrentControlSet\Control\Video\$dev_id\0000" "Device Description" ; Try to read device name ${If} $dev_desc == "VirtualBox Graphics Adapter" - DetailPrint "Device ID of $dev_desc: $dev_id" + ${LogVerbose} "Device ID of $dev_desc: $dev_id" Goto change_res ${EndIf} @@ -99,20 +99,20 @@ dev_found_detect_id_loop: dev_not_found: - DetailPrint "No VirtualBox video device (yet) detected! No custom mode set." + ${LogVerbose} "No VirtualBox video device (yet) detected! No custom mode set." Goto exit change_res: !ifdef _DEBUG - DetailPrint "Device description: $dev_desc" - DetailPrint "Device ID: $dev_id" + ${LogVerbose} "Device description: $dev_desc" + ${LogVerbose} "Device ID: $dev_id" !endif Var /GLOBAL reg_path_device Var /GLOBAL reg_path_monitor - DetailPrint "Custom mode set: Platform is Windows $g_strWinVersion" + ${LogVerbose} "Custom mode set: Platform is Windows $g_strWinVersion" ${If} $g_strWinVersion == "2000" ${OrIf} $g_strWinVersion == "Vista" StrCpy $reg_path_device "SYSTEM\CurrentControlSet\SERVICES\VBoxVideo\Device0" @@ -120,17 +120,18 @@ change_res: ${ElseIf} $g_strWinVersion == "XP" ${OrIf} $g_strWinVersion == "7" ${OrIf} $g_strWinVersion == "8" + ${OrIf} $g_strWinVersion == "8_1" StrCpy $reg_path_device "SYSTEM\CurrentControlSet\Control\Video\$dev_id\0000" StrCpy $reg_path_monitor "SYSTEM\CurrentControlSet\Control\VIDEO\$dev_id\0000\Mon00000001" ${Else} - DetailPrint "Custom mode set: Windows $g_strWinVersion not supported yet" + ${LogVerbose} "Custom mode set: Windows $g_strWinVersion not supported yet" Goto exit ${EndIf} ; Write the new value in the adapter config (VBoxVideo.sys) using hex values in binary format - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry write HKLM $reg_path_device CustomXRes REG_BIN $g_iScreenX DWORD' - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry write HKLM $reg_path_device CustomYRes REG_BIN $g_iScreenY DWORD' - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry write HKLM $reg_path_device CustomBPP REG_BIN $g_iScreenBpp DWORD' + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry write HKLM $reg_path_device CustomXRes REG_BIN $g_iScreenX DWORD" "false" + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry write HKLM $reg_path_device CustomYRes REG_BIN $g_iScreenY DWORD" "false" + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry write HKLM $reg_path_device CustomBPP REG_BIN $g_iScreenBpp DWORD" "false" ; ... and tell Windows to use that mode on next start! WriteRegDWORD HKCC $reg_path_device "DefaultSettings.XResolution" "$g_iScreenX" @@ -141,7 +142,7 @@ change_res: WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.YResolution" "$g_iScreenY" WriteRegDWORD HKCC $reg_path_monitor "DefaultSettings.BitsPerPixel" "$g_iScreenBpp" - DetailPrint "Custom mode set to $g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP on next restart." + ${LogVerbose} "Custom mode set to $g_iScreenXx$g_iScreenY, $g_iScreenBpp BPP on next restart." exit: @@ -213,15 +214,15 @@ Function W2K_CopyFiles ClearErrors GetTempFileName $0 IfErrors 0 +3 - DetailPrint "Error getting temp file for VBoxService.exe" + ${LogVerbose} "Error getting temp file for VBoxService.exe" StrCpy "$0" "$INSTDIR\VBoxServiceTemp.exe" - DetailPrint "VBoxService is in use, will be installed on next reboot (from '$0')" + ${LogVerbose} "VBoxService is in use, will be installed on next reboot (from '$0')" File "/oname=$0" "$%PATH_OUT%\bin\additions\VBoxService.exe" IfErrors 0 +2 - DetailPrint "Error copying VBoxService.exe to '$0'" + ${LogVerbose} "Error copying VBoxService.exe to '$0'" Rename /REBOOTOK "$0" "$g_strSystemDir\VBoxService.exe" IfErrors 0 +2 - DetailPrint "Error renaming '$0' to '$g_strSystemDir\VBoxService.exe'" + ${LogVerbose} "Error renaming '$0' to '$g_strSystemDir\VBoxService.exe'" Pop $0 ${EndIf} @@ -232,6 +233,7 @@ Function W2K_CopyFiles !if $%VBOX_WITH_WDDM_W8% == "1" ${If} $g_strWinVersion == "8" + ${OrIf} $g_strWinVersion == "8_1" !ifdef VBOX_SIGN_ADDITIONS FILE "$%PATH_OUT%\bin\additions\VBoxVideoW8.cat" !endif @@ -336,8 +338,8 @@ Function W2K_WHQLFakeOn do: - DetailPrint "Turning off WHQL protection..." - nsExec::ExecToLog '"$INSTDIR\VBoxWHQLFake.exe" "ignore"' + ${LogVerbose} "Turning off WHQL protection..." + ${CmdExecute} "$\"$INSTDIR\VBoxWHQLFake.exe$\" $\"ignore$\"" "true" exit: @@ -350,8 +352,8 @@ Function W2K_WHQLFakeOff do: - DetailPrint "Turning back on WHQL protection..." - nsExec::ExecToLog '"$INSTDIR\VBoxWHQLFake.exe" "warn"' + ${LogVerbose} "Turning back on WHQL protection..." + ${CmdExecute} "$\"$INSTDIR\VBoxWHQLFake.exe$\" $\"warn$\"" "true" exit: @@ -375,76 +377,66 @@ Function W2K_InstallFiles !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxHook.dll" "$g_strSystemDir\VBoxHook.dll" "$INSTDIR" AccessControl::GrantOnFile "$g_strSystemDir\VBoxHook.dll" "(BU)" "GenericRead" - DetailPrint "Installing drivers ..." + ${LogVerbose} "Installing drivers ..." Push $0 ; For fetching results SetOutPath "$INSTDIR" ${If} $g_bNoGuestDrv == "false" - DetailPrint "Installing guest driver ..." - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxGuest.inf" "$INSTDIR\install_drivers.log"' - Pop $0 ; Ret value - LogText "Guest driver returned: $0" - IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error) + ${LogVerbose} "Installing guest driver ..." + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxGuest.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false" ${Else} - LogText "Guest driver installation skipped!" + ${LogVerbose} "Guest driver installation skipped!" ${EndIf} ${If} $g_bNoVideoDrv == "false" ${If} $g_bWithWDDM == "true" !if $%VBOX_WITH_WDDM_W8% == "1" ${If} $g_strWinVersion == "8" - DetailPrint "Installing WDDM video driver for Windows 8..." - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxVideoW8.inf" "$INSTDIR\install_drivers.log"' + ${OrIf} $g_strWinVersion == "8_1" + ${LogVerbose} "Installing WDDM video driver for Windows 8..." + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxVideoW8.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false" ${Else} !endif - DetailPrint "Installing WDDM video driver for Windows Vista and 7..." - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxVideoWddm.inf" "$INSTDIR\install_drivers.log"' + ${LogVerbose} "Installing WDDM video driver for Windows Vista and 7..." + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxVideoWddm.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false" !if $%VBOX_WITH_WDDM_W8% == "1" ${EndIf} !endif ${Else} - DetailPrint "Installing video driver ..." - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxVideo.inf" "$INSTDIR\install_drivers.log"' + ${LogVerbose} "Installing video driver ..." + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver install $\"$INSTDIR\VBoxVideo.inf$\" $\"$INSTDIR\install_drivers.log$\"" "false" ${EndIf} - Pop $0 ; Ret value - LogText "Video driver returned: $0" - IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error) ${Else} - LogText "Video driver installation skipped!" + ${LogVerbose} "Video driver installation skipped!" ${EndIf} ${If} $g_bNoMouseDrv == "false" - DetailPrint "Installing mouse driver ..." + ${LogVerbose} "Installing mouse driver ..." ; The mouse filter does not contain any device IDs but a "DefaultInstall" section; ; so this .INF file needs to be installed using "InstallHinfSection" which is implemented ; with VBoxDrvInst's "driver executeinf" routine - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver executeinf "$INSTDIR\VBoxMouse.inf"' - Pop $0 ; Ret value - LogText "Mouse driver returned: $0" - IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error) + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver executeinf $\"$INSTDIR\VBoxMouse.inf$\"" "false" ${Else} - LogText "Mouse driver installation skipped!" + ${LogVerbose} "Mouse driver installation skipped!" ${EndIf} ; Create the VBoxService service ; No need to stop/remove the service here! Do this only on uninstallation! - DetailPrint "Installing VirtualBox service ..." - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service create "VBoxService" "VirtualBox Guest Additions Service" 16 2 "system32\VBoxService.exe" "Base"' - Pop $0 ; Ret value - LogText "VBoxService returned: $0" + ${LogVerbose} "Installing VirtualBox service ..." + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxService$\" $\"VirtualBox Guest Additions Service$\" 16 2 $\"system32\VBoxService.exe$\" $\"Base$\"" "false" ; Set service description WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxService" "Description" "Manages VM runtime information, time synchronization, remote sysprep execution and miscellaneous utilities for guest operating systems." sf: - DetailPrint "Installing Shared Folders service ..." + ${LogVerbose} "Installing Shared Folders service ..." ; Create the Shared Folders service ... ; No need to stop/remove the service here! Do this only on uninstallation! - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service create "VBoxSF" "VirtualBox Shared Folders" 2 1 "system32\drivers\VBoxSF.sys" "NetworkProvider"' + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service create $\"VBoxSF$\" $\"VirtualBox Shared Folders$\" 2 1 $\"system32\drivers\VBoxSF.sys$\" $\"NetworkProvider$\"" "false" ; ... and the link to the network provider WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "DeviceName" "\Device\VBoxMiniRdr" @@ -452,22 +444,20 @@ sf: WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\VBoxSF\NetworkProvider" "ProviderPath" "$SYSDIR\VBoxMRXNP.dll" ; Add default network providers (if not present or corrupted) - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider add WebClient' - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider add LanmanWorkstation' - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider add RDPNP' + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add WebClient" "false" + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add LanmanWorkstation" "false" + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add RDPNP" "false" ; Add the shared folders network provider - DetailPrint "Adding network provider (Order = $g_iSfOrder) ..." - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider add VBoxSF $g_iSfOrder' - Pop $0 ; Ret value - IntCmp $0 0 +1 error error ; Check ret value (0=OK, 1=Error) + ${LogVerbose} "Adding network provider (Order = $g_iSfOrder) ..." + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider add VBoxSF $g_iSfOrder" "false" !if $%VBOX_WITH_CROGL% == "1" cropengl: ${If} $g_bWithWDDM == "true" ; Nothing to do here ${Else} - DetailPrint "Installing 3D OpenGL support ..." + ${LogVerbose} "Installing 3D OpenGL support ..." WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Version" 2 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "DriverVersion" 1 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\VBoxOGL" "Flags" 1 @@ -475,7 +465,8 @@ cropengl: !if $%BUILD_TARGET_ARCH% == "amd64" SetRegView 32 ; Write additional keys required for Windows XP, Vista and 7 64-bit (but for 32-bit stuff) - ${If} $g_strWinVersion == '8' + ${If} $g_strWinVersion == '8_1' + ${OrIf} $g_strWinVersion == '8' ${OrIf} $g_strWinVersion == '7' ${OrIf} $g_strWinVersion == 'Vista' ${OrIf} $g_strWinVersion == '2003' ; Windows XP 64-bit is a renamed Windows 2003 really @@ -491,10 +482,6 @@ cropengl: Goto done -error: - - Abort "ERROR: Could not install files for Windows 2000 / XP / Vista! Installation aborted." - done: Pop $0 @@ -605,11 +592,9 @@ Function ${un}W2K_Uninstall Push $0 ; Remove VirtualBox video driver - DetailPrint "Uninstalling video driver ..." - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver uninstall "$INSTDIR\VBoxVideo.inf' - Pop $0 ; Ret value - ; @todo Add error handling here! - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxVideo' + ${LogVerbose} "Uninstalling video driver ..." + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideo.inf$\"" "true" + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideo" "true" Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideo.sys" Delete /REBOOTOK "$g_strSystemDir\VBoxDisp.dll" @@ -617,23 +602,18 @@ Function ${un}W2K_Uninstall !if $%VBOX_WITH_WDDM% == "1" !if $%VBOX_WITH_WDDM_W8% == "1" - DetailPrint "Uninstalling WDDM video driver for Windows 8..." - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver uninstall "$INSTDIR\VBoxVideoW8.inf"' - Pop $0 ; Ret value - ; Always try to remove both VBoxVideoW8 & VBoxVideoWddm services no matter what is installed currently - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxVideoW8' - Pop $0 ; Ret value + ${LogVerbose} "Uninstalling WDDM video driver for Windows 8..." + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoW8.inf$\"" "true" + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoW8" "true" ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall ; could be done with "VBoxDrvInst.exe /u", e.g. by passing additional arg to it denoting that driver package is to be uninstalled Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideoW8.sys" !endif ; $%VBOX_WITH_WDDM_W8% == "1" - DetailPrint "Uninstalling WDDM video driver for Windows Vista and 7..." - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver uninstall "$INSTDIR\VBoxVideoWddm.inf"' - Pop $0 ; Ret value + ${LogVerbose} "Uninstalling WDDM video driver for Windows Vista and 7..." + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxVideoWddm.inf$\"" "true" ; Always try to remove both VBoxVideoWddm & VBoxVideo services no matter what is installed currently - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxVideoWddm' - Pop $0 ; Ret value + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxVideoWddm" "true" ;misha> @todo driver file removal (as well as service removal) should be done as driver package uninstall ; could be done with "VBoxDrvInst.exe /u", e.g. by passing additional arg to it denoting that driver package is to be uninstalled Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxVideoWddm.sys" @@ -642,13 +622,13 @@ Function ${un}W2K_Uninstall !if $%VBOX_WITH_CROGL% == "1" - DetailPrint "Removing Direct3D support ..." + ${LogVerbose} "Removing Direct3D support ..." ; Do file validation before we uninstall Call ${un}ValidateD3DFiles Pop $0 ${If} $0 == "1" ; D3D files are invalid - DetailPrint $(VBOX_UNINST_INVALID_D3D) + ${LogVerbose} $(VBOX_UNINST_INVALID_D3D) MessageBox MB_ICONSTOP|MB_OK $(VBOX_UNINST_INVALID_D3D) /SD IDOK Goto d3d_uninstall_end ${EndIf} @@ -730,18 +710,14 @@ d3d_uninstall_end: !endif ; VBOX_WITH_CROGL ; Remove mouse driver - DetailPrint "Removing mouse driver ..." - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxMouse' - Pop $0 ; Ret value + ${LogVerbose} "Removing mouse driver ..." + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxMouse" "true" Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxMouse.sys" - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" registry delmultisz "SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}" "UpperFilters" "VBoxMouse"' - Pop $0 ; Ret value - ; @todo Add error handling here! + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" registry delmultisz $\"SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}$\" $\"UpperFilters$\" $\"VBoxMouse$\"" "true" ; Delete the VBoxService service Call ${un}StopVBoxService - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxService' - Pop $0 ; Ret value + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxService" "true" DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxService" Delete /REBOOTOK "$g_strSystemDir\VBoxService.exe" @@ -749,7 +725,7 @@ d3d_uninstall_end: Delete /REBOOTOK "$g_strSystemDir\VBoxGINA.dll" ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL" ${If} $0 == "VBoxGINA.dll" - DetailPrint "Removing auto-logon support ..." + ${LogVerbose} "Removing auto-logon support ..." DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL" ${EndIf} DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\VBoxGINA" @@ -759,13 +735,10 @@ d3d_uninstall_end: DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "VBoxTray" ; Remove guest driver - DetailPrint "Removing guest driver ..." - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver uninstall "$INSTDIR\VBoxGuest.inf"' - Pop $0 ; Ret value - ; @todo Add error handling here! + ${LogVerbose} "Removing guest driver ..." + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" driver uninstall $\"$INSTDIR\VBoxGuest.inf$\"" "true" - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxGuest' - Pop $0 ; Ret value + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxGuest" "true" Delete /REBOOTOK "$g_strSystemDir\drivers\VBoxGuest.sys" Delete /REBOOTOK "$g_strSystemDir\VBCoInst.dll" ; Deprecated, does not get installed anymore Delete /REBOOTOK "$g_strSystemDir\VBoxTray.exe" @@ -774,11 +747,9 @@ d3d_uninstall_end: Delete /REBOOTOK "$g_strSystemDir\VBoxControl.exe" ; Remove shared folders driver - DetailPrint "Removing shared folders driver ..." - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" netprovider remove VBoxSF' - Pop $0 ; Ret value - nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" service delete VBoxSF' - Pop $0 ; Ret value + ${LogVerbose} "Removing shared folders driver ..." + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" netprovider remove VBoxSF" "true" + ${CmdExecute} "$\"$INSTDIR\VBoxDrvInst.exe$\" service delete VBoxSF" "true" Delete /REBOOTOK "$g_strSystemDir\VBoxMRXNP.dll" ; The network provider DLL will be locked !if $%BUILD_TARGET_ARCH% == "amd64" ; Only 64-bit installer: Also remove 32-bit DLLs on 64-bit target arch in Wow64 node diff --git a/src/VBox/Additions/WINNT/Installer/VBoxGuestDrvInst.cpp b/src/VBox/Additions/WINNT/Installer/VBoxGuestDrvInst.cpp index 944baa86..22a90955 100644 --- a/src/VBox/Additions/WINNT/Installer/VBoxGuestDrvInst.cpp +++ b/src/VBox/Additions/WINNT/Installer/VBoxGuestDrvInst.cpp @@ -2,7 +2,7 @@ * * instdrvmain - Install guest drivers on NT4 * - * Copyright (C) 2006-2007 Oracle Corporation + * Copyright (C) 2006-2010 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; diff --git a/src/VBox/Additions/WINNT/Installer/winver.nsh b/src/VBox/Additions/WINNT/Installer/winver.nsh index bfee71c6..9f407a4a 100644 --- a/src/VBox/Additions/WINNT/Installer/winver.nsh +++ b/src/VBox/Additions/WINNT/Installer/winver.nsh @@ -65,7 +65,8 @@ Function ${un}GetWindowsVersion StrCmp $R1 '5.2' lbl_winnt_2003 StrCmp $R1 '6.0' lbl_winnt_vista StrCmp $R1 '6.1' lbl_winnt_7 - StrCmp $R1 '6.2' lbl_winnt_8 lbl_error + StrCmp $R1 '6.2' lbl_winnt_8 + StrCmp $R1 '6.3' lbl_winnt_8_1 lbl_error lbl_winnt_x: StrCpy $R0 "NT $R0" 6 @@ -95,6 +96,10 @@ Function ${un}GetWindowsVersion Strcpy $R0 '8' Goto lbl_done + lbl_winnt_8_1: ; Also includes Windows Server 2012 R2 + Strcpy $R0 '8_1' + Goto lbl_done + lbl_error: Strcpy $R0 '' lbl_done: |