VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditionsLog.nsh@ 109120

Last change on this file since 109120 was 108772, checked in by vboxsync, 6 weeks ago

Windows Guest Additions installer: Big revamp of the overall source code structure to (hopefully) make it a lot more clear and removed code duplication. There has been a lot of code rot being accumulated over the last decade. Added lots of missing and fixes for documentation. Also revamped the installed files structure so that we have component sub folders to make it more clear which file belongs to what. Older Guest Additions will be migrated automatically. Tested upgrades with 7.1, 7.0 and 6.1 Guest Additions. bugref:10881

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1; $Id: VBoxGuestAdditionsLog.nsh 108772 2025-03-27 15:32:33Z vboxsync $
2;; @file
3; VBoxGuestAdditionLog.nsh - Logging functions.
4;
5
6;
7; Copyright (C) 2013-2024 Oracle and/or its affiliates.
8;
9; This file is part of VirtualBox base platform packages, as
10; available from https://www.virtualbox.org.
11;
12; This program is free software; you can redistribute it and/or
13; modify it under the terms of the GNU General Public License
14; as published by the Free Software Foundation, in version 3 of the
15; License.
16;
17; This program is distributed in the hope that it will be useful, but
18; WITHOUT ANY WARRANTY; without even the implied warranty of
19; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20; General Public License for more details.
21;
22; You should have received a copy of the GNU General Public License
23; along with this program; if not, see <https://www.gnu.org/licenses>.
24;
25; SPDX-License-Identifier: GPL-3.0-only
26;
27
28
29;
30; Macro for enable/disable logging.
31;
32; @param "true" to enable logging, "false" to disable.
33;
34!macro _logEnable enable
35
36 ${If} ${enable} == "true"
37 LogSet on
38 ${LogVerbose} "Started logging into separate file"
39 ${Else}
40 ${LogVerbose} "Stopped logging into separate file"
41 LogSet off
42 ${EndIf}
43
44!macroend
45!define LogEnable "!insertmacro _logEnable"
46
47
48;
49; Macro for (verbose) logging.
50;
51; @param Text to log.
52;
53!macro _logVerbose text
54
55 LogText "${text}"
56 IfSilent +2
57 DetailPrint "${text}"
58
59!macroend
60!define LogVerbose "!insertmacro _logVerbose"
61
62
63;
64; Sends a logging text to the running instance of VBoxTray
65; which then presents to text via balloon popup in the system tray (if enabled).
66;
67; @param Message type (0=Info, 1=Warning, 2=Error).
68; @param Message text.
69;
70; @todo Add message timeout as parameter.
71;
72!macro _logToVBoxTray type text
73
74 ${LogVerbose} "To VBoxTray: ${text}"
75!if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1"
76 Push $0
77 ; Parameters:
78 ; - String: Description / Body
79 ; - String: Title / Name of application
80 ; - Integer: Type of message: 1 (Info), 2 (Warning), 3 (Error)
81 ; - Integer: Time (in msec) to show the notification
82 VBoxGuestInstallHelper::VBoxTrayShowBallonMsg "${text}" "VirtualBox Guest Additions Setup" ${type} 5000
83 Pop $0 ; Get return value (ignored for now)
84 Pop $0 ; Restore original $0 from stack
85!endif
86
87!macroend
88!define LogToVBoxTray "!insertmacro _logToVBoxTray"
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette