Index: trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditions.nsi
===================================================================
--- trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditions.nsi	(revision 44341)
+++ trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditions.nsi	(revision 44352)
@@ -5,5 +5,5 @@
 
 ;
-; Copyright (C) 2012 Oracle Corporation
+; Copyright (C) 2012-2013 Oracle Corporation
 ;
 ; This file is part of VirtualBox Open Source Edition (OSE), as
@@ -240,7 +240,8 @@
 
 ; Platform parts of this installer
+!include "VBoxGuestAdditionsLog.nsh"
 !include "VBoxGuestAdditionsCommon.nsh"
 !if $%BUILD_TARGET_ARCH% == "x86"       ; 32-bit only
-!include "VBoxGuestAdditionsNT4.nsh"
+  !include "VBoxGuestAdditionsNT4.nsh"
 !endif
 !include "VBoxGuestAdditionsW2KXP.nsh"
@@ -445,12 +446,11 @@
 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:
 
@@ -545,6 +545,7 @@
   Push $1
 
-  DetailPrint "Checking for installed components ..."
-
+  ${LogVerbose} "Checking for installed components ..."
+  StrCpy $1 ""
+  
   Call SetAppMode64
 
@@ -553,20 +554,21 @@
   ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
   ${If} $0 == "VBoxGINA.dll"
-    StrCpy $g_bWithAutoLogon "true"
-    StrCpy $1 "1"
-  ${EndIf}
-
-  ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}" ""
-  ${If} $0 == "VBoxCredProv.dll"
-    StrCpy $g_bWithAutoLogon "true"
-    StrCpy $1 "1"
-  ${EndIf}
-
-  ${If} $1 == "1"
-    DetailPrint "Auto-logon support was not installed previously"
-  ${EndIf}
-
-  ${If} $g_bWithAutoLogon == "true"
-    DetailPrint "Found already installed auto-logon support ..."
+    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}
+
+!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}
 
@@ -580,8 +582,7 @@
 
   SectionIn RO ; Section cannot be unselected (read-only)
-
-  Push "${PRODUCT_NAME} update started, please wait ..."
-  Push 0 ; Message type = info
-  Call WriteLogVBoxTray
+  ${If} $g_bPostInstallStatus == "true"
+    ${LogToVBoxTray} "0" "${PRODUCT_NAME} update started, please wait ..."
+  ${EndIf}
 
   SetOutPath "$INSTDIR"
@@ -592,21 +593,21 @@
   StrCpy $g_strSystemDir "$SYSDIR"
 
-  Call EnableLog
-
-  DetailPrint "Version: $%VBOX_VERSION_STRING% (Rev $%VBOX_SVN_REV%)"
+  ${LogVerbose}  "$g_bLogEnable"
+
+  ${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)"
-!endif
-  DetailPrint "System Directory: $g_strSystemDir"
+  ${LogVerbose} "Detected OS: Windows $g_strWinVersion (32-bit)"
+!endif
+  ${LogVerbose} "System Directory: $g_strSystemDir"
 
 !ifdef _DEBUG
-  DetailPrint "Debug!"
+  ${LogVerbose} "Installer runs in debug mode"
 !endif
 
@@ -691,6 +692,4 @@
 exit:
 
-  Call WriteLogUI
-
 SectionEnd
 
@@ -703,5 +702,5 @@
   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)
@@ -710,7 +709,7 @@
   ${If} $0 != ""
     ${If} $0 != "VBoxGINA.dll"
-      DetailPrint "Found another already installed GINA module: $0"
+      ${LogVerbose} "Found another already installed GINA module: $0"
       MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON1 $(VBOX_COMPONENT_AUTOLOGON_WARN_3RDPARTY) /SD IDYES IDYES install
-      DetailPrint "Skipping GINA installation, keeping: $0"
+      ${LogVerbose} "Skipping GINA installation, keeping: $0"
       goto skip
     ${EndIf}
@@ -724,5 +723,5 @@
   ${OrIf} $R0 == '8'     ; Windows 8.
     ; Use VBoxCredProv on Vista and up.
-    DetailPrint "Installing VirtualBox credential provider ..."
+    ${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
@@ -731,5 +730,5 @@
     WriteRegStr HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}\InprocServer32" "ThreadingModel" "Apartment"
   ${Else} ; Use VBoxGINA on older Windows OSes (< Vista)
-    DetailPrint "Installing VirtualBox GINA ..."
+    ${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"
@@ -755,5 +754,5 @@
 
   ${IfNot} ${FileExists} "$0"
-    LogText "WRP: File $0 does not exist, skipping"
+    ${LogVerbose} "WRP: File $0 does not exist, skipping"
     Return
   ${EndIf}
@@ -762,16 +761,16 @@
     nsExec::ExecToLog '"$g_strSystemDir\takeown.exe" /F "$0"'
     Pop $1 ; Ret value
-    LogText "WRP: Taking ownership for $0 returned: $1"
+    ${LogVerbose} "WRP: Taking ownership for $0 returned: $1"
   ${Else}
-    LogText "WRP: Warning: takeown.exe not found, skipping"
+    ${LogVerbose} "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"
+  ${LogVerbose} "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"
+  ${LogVerbose} "WRP: Setting access rights for $0 returned: $1"
 
 !if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1"
@@ -779,5 +778,5 @@
     VBoxGuestInstallHelper::DisableWFP "$0"
     Pop $1 ; Get return value (ignored for now)
-    DetailPrint "WRP: Setting WFP exception for $0 returned: $1"
+    ${LogVerbose} "WRP: Setting WFP exception for $0 returned: $1"
   !endif
 !endif
@@ -802,5 +801,5 @@
 
   SetOutPath $g_strSystemDir
-  DetailPrint "Installing Direct3D support ..."
+  ${LogVerbose} "Installing Direct3D support ..."
   FILE "$%PATH_OUT%\bin\additions\VBoxD3D8.dll"
   FILE "$%PATH_OUT%\bin\additions\VBoxD3D9.dll"
@@ -826,5 +825,5 @@
       ${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}
@@ -851,5 +850,5 @@
     ; 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"
@@ -875,5 +874,5 @@
         ${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}
@@ -944,5 +943,5 @@
 
 !ifdef _DEBUG
-  DetailPrint "Doing post install ..."
+  ${LogVerbose} "Doing post install ..."
 !endif
 
@@ -974,5 +973,5 @@
 !endif
 
-  DetailPrint "Installation completed."
+  ${LogVerbose} "Installation completed."
 
 SectionEnd
@@ -1058,10 +1057,9 @@
   MessageBox MB_ICONSTOP $(VBOX_ERROR_INST_FAILED) /SD IDOK
 
-  Push "Error while installing ${PRODUCT_NAME}!"
-  Push 2 ; Message type = error
-  Call WriteLogVBoxTray
-
-  StrCpy $g_bLogEnable "true"
-  Call WriteLogUI
+  ${If} $g_bPostInstallStatus == "true"
+    ${LogToVBoxTray} "2" "Error while installing ${PRODUCT_NAME}!"
+  ${EndIf}
+
+  ; Set overall exit code
   SetErrorLevel 1
 
@@ -1071,7 +1069,7 @@
 Function .onInstSuccess
 
-  Push "${PRODUCT_NAME} successfully updated!"
-  Push 0 ; Message type = info
-  Call WriteLogVBoxTray
+  ${If} $g_bPostInstallStatus == "true"
+    ${LogToVBoxTray} "0" "${PRODUCT_NAME} successfully updated!"
+  ${EndIf}
 
 FunctionEnd
@@ -1144,4 +1142,8 @@
   ${EndIf}
 
+  IfSilent 0 +3
+    ${LogEnable} "true" ; Force logging in silent mode
+    ${LogVerbose} "Installer runs in silent mode"
+
   ; Retrieve Windows version and store result in $g_strWinVersion
   Call GetWindowsVer
@@ -1153,5 +1155,5 @@
   AccessControl::GetCurrentUserName
   Pop $g_strCurUser
-  DetailPrint "Current user: $g_strCurUser"
+  ${LogVerbose} "Current user is: $g_strCurUser"
 
   ; Only extract files? This action can be called even from non-Admin users
@@ -1282,6 +1284,5 @@
 
 !ifdef _DEBUG
-  ; Enable logging
-  Call un.EnableLog
+  ${LogEnable} "true"
 !endif
 
@@ -1304,5 +1305,5 @@
 restart:
 
-  DetailPrint "Rebooting ..."
+  ${LogVerbose} "Rebooting ..."
   Reboot
 
Index: trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh
===================================================================
--- trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh	(revision 44341)
+++ trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsCommon.nsh	(revision 44352)
@@ -5,5 +5,5 @@
 
 ;
-; Copyright (C) 2006-2012 Oracle Corporation
+; Copyright (C) 2006-2013 Oracle Corporation
 ;
 ; This file is part of VirtualBox Open Source Edition (OSE), as
@@ -247,81 +247,4 @@
 !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
@@ -466,13 +389,13 @@
 
   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
@@ -481,5 +404,5 @@
 
 !ifdef _DEBUG
-  DetailPrint "Stopping VBoxService (as exe) ..."
+  ${LogVerbose} "Stopping VBoxService (as exe) ..."
 !endif
 
@@ -489,6 +412,8 @@
   IntOp  $3 $3 + 1       ; Increment
 
-  LogText "Try: $3"
-
+!ifdef _DEBUG
+  ${LogVerbose} "Stopping attempt #$3"
+!endif
+  
   ${If} $g_strWinVersion == "NT4"
     StrCpy $2 "VBoxServiceNT.exe"
@@ -501,10 +426,10 @@
 
   ${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
@@ -525,5 +450,5 @@
 
   StrCpy $1 "0" ; Init counter
-  DetailPrint "Stopping VBoxTray ..."
+  ${LogVerbose} "Stopping VBoxTray ..."
 
 exe_stop:
@@ -541,5 +466,5 @@
 exit:
 
-  DetailPrint "Stopping VBoxTray done."
+  ${LogVerbose} "Stopping VBoxTray done"
 
   Pop $1
@@ -579,4 +504,5 @@
   ${OrIf} $g_strWinVersion == "8"
     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
@@ -584,4 +510,5 @@
   ${If} $g_strWinVersion == "8"
     StrCpy $g_bWithWDDM "true"
+    ${LogVerbose}  "OS needs WDDM driver by default"
   ${EndIf}
 !endif
@@ -606,4 +533,5 @@
   ${OrIf} $g_strWinVersion == "8"
     StrCpy $g_bCapDllCache "true"
+    ${LogVerbose}  "OS has a DLL cache"
   ${EndIf}
 
@@ -804,13 +732,13 @@
   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
@@ -837,8 +765,8 @@
   Pop $0
   ${If} $0 == "0"
-    DetailPrint "Copying verified file $\"${FileSrc}$\" to $\"${FileDest}$\" ..."
+    ${LogVerbose} "Copying verified file $\"${FileSrc}$\" to $\"${FileDest}$\" ..."
     CopyFiles /SILENT "${FileSrc}" "${FileDest}"
   ${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
@@ -856,5 +784,5 @@
 ;
 !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}"
@@ -879,5 +807,5 @@
   Push "${Vendor}"
   Push "${FileSrc}"
-  DetailPrint "Verifying library $\"${FileSrc}$\" ..."
+  ${LogVerbose} "Verifying library $\"${FileSrc}$\" ..."
   Call ${un}VerifyFile
   Pop $0
@@ -885,5 +813,5 @@
     ${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.
Index: trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsLog.nsh
===================================================================
--- trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsLog.nsh	(revision 44352)
+++ trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsLog.nsh	(revision 44352)
@@ -0,0 +1,73 @@
+; $Id$
+;; @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"
Index: trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsW2KXP.nsh
===================================================================
--- trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsW2KXP.nsh	(revision 44341)
+++ trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsW2KXP.nsh	(revision 44352)
@@ -1,9 +1,9 @@
 ; $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
@@ -386,8 +386,8 @@
     nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver install "$INSTDIR\VBoxGuest.inf" "$INSTDIR\install_drivers.log"'
     Pop $0 ; Ret value
-    LogText "Guest driver returned: $0"
+    ${LogVerbose} "Guest driver returned: $0"
     IntCmp $0 0 +1 error error  ; Check ret value (0=OK, 1=Error)
   ${Else}
-    LogText "Guest driver installation skipped!"
+    ${LogVerbose} "Guest driver installation skipped!"
   ${EndIf}
 
@@ -410,8 +410,8 @@
     ${EndIf}
     Pop $0 ; Ret value
-    LogText "Video driver returned: $0"
+    ${LogVerbose} "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}
 
@@ -423,8 +423,8 @@
     nsExec::ExecToLog '"$INSTDIR\VBoxDrvInst.exe" driver executeinf "$INSTDIR\VBoxMouse.inf"'
     Pop $0  ; Ret value
-    LogText "Mouse driver returned: $0"
+    ${LogVerbose} "Mouse driver returned: $0"
     IntCmp $0 0 +1 error error  ; Check ret value (0=OK, 1=Error)
   ${Else}
-    LogText "Mouse driver installation skipped!"
+    ${LogVerbose} "Mouse driver installation skipped!"
   ${EndIf}
 
@@ -434,5 +434,5 @@
   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} "VBoxService returned: $0"
 
   ; Set service description
