VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Installer/VBoxGuestAdditions.nsi@ 95649

Last change on this file since 95649 was 95649, checked in by vboxsync, 3 years ago

Additions/WINNT/Installer: Remove the VBoxFakeWHQL tool which requires AutoIt and needs to be activated by a special CLI switch and is probably unused for a long time now, bugref:8515

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 36.2 KB
Line 
1; $Id: VBoxGuestAdditions.nsi 95649 2022-07-14 13:00:56Z vboxsync $
2; @file
3; VBoxGuestAdditions.nsi - Main file for Windows Guest Additions installation.
4;
5
6;
7; Copyright (C) 2012-2022 Oracle Corporation
8;
9; This file is part of VirtualBox Open Source Edition (OSE), as
10; available from http://www.virtualbox.org. This file is free software;
11; you can redistribute it and/or modify it under the terms of the GNU
12; General Public License (GPL) as published by the Free Software
13; Foundation, in version 2 as it comes in the "COPYING" file of the
14; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16;
17
18!if $%KBUILD_TYPE% == "debug"
19 !define _DEBUG ; Turn this on to get extra output
20!endif
21
22!ifdef _DEBUG
23 ; Scratch directory for plugin tests
24 !addincludedir .\PluginTest
25 !addplugindir .\PluginTest
26!endif
27
28!if $%VBOX_WITH_GUEST_INSTALLER_UNICODE% == "1"
29 ; Whether to use the Unicode version of NSIS
30 ; Note: Using Unicode will result in the installer not working on a Windows 95/98/ME guest
31 Unicode true
32!endif
33
34; Defines for special functions
35!define WFP_FILE_EXCEPTION ; Enables setting a temporary file exception for WFP proctected files
36
37!define VENDOR_ROOT_KEY "SOFTWARE\$%VBOX_VENDOR_SHORT%"
38
39; Product defines
40!define PRODUCT_NAME "$%VBOX_PRODUCT% Guest Additions"
41!define PRODUCT_DESC "$%VBOX_PRODUCT% Guest Additions"
42!define PRODUCT_VERSION "$%VBOX_VERSION_MAJOR%.$%VBOX_VERSION_MINOR%.$%VBOX_VERSION_BUILD%.$%VBOX_SVN_REV%"
43!define PRODUCT_PUBLISHER "$%VBOX_VENDOR%"
44!define PRODUCT_COPYRIGHT "(C) $%VBOX_C_YEAR% $%VBOX_VENDOR%"
45!define PRODUCT_OUTPUT "VBoxWindowsAdditions-$%KBUILD_TARGET_ARCH%.exe"
46!define PRODUCT_WEB_SITE "http://www.virtualbox.org"
47!define PRODUCT_INSTALL_KEY "${VENDOR_ROOT_KEY}\VirtualBox Guest Additions"
48!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
49!define PRODUCT_UNINST_ROOT_KEY "HKLM"
50
51!define LICENSE_FILE_RTF "license.rtf"
52
53; Needed for InstallLib macro: Install libraries in every case
54!define LIBRARY_IGNORE_VERSION
55
56VIProductVersion "${PRODUCT_VERSION}"
57VIAddVersionKey "FileVersion" "$%VBOX_VERSION_STRING%"
58VIAddVersionKey "ProductName" "${PRODUCT_NAME}"
59VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
60VIAddVersionKey "CompanyName" "${PRODUCT_PUBLISHER}"
61VIAddVersionKey "FileDescription" "${PRODUCT_DESC}"
62VIAddVersionKey "LegalCopyright" "${PRODUCT_COPYRIGHT}"
63VIAddVersionKey "InternalName" "${PRODUCT_OUTPUT}"
64
65; This registry key will hold the mouse driver path before install (NT4 only)
66!define ORG_MOUSE_PATH "MousePath"
67
68; If we have our guest install helper DLL, add the
69; plugin path so that NSIS can find it when compiling the installer
70; Note: NSIS plugins *always* have to be compiled in 32-bit!
71!if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1"
72 !addplugindir "$%PATH_TARGET_X86%\VBoxGuestInstallHelper"
73!endif
74
75!include "LogicLib.nsh"
76!include "FileFunc.nsh"
77 !insertmacro GetParameters
78 !insertmacro GetOptions
79!include "WordFunc.nsh"
80 !insertmacro WordFind
81 !insertmacro StrFilter
82
83!include "nsProcess.nsh"
84!include "Library.nsh"
85!include "Sections.nsh"
86!include "strstr.nsh" ; Function "strstr"
87!include "servicepack.nsh" ; Function "GetServicePack"
88!include "winver.nsh" ; Function for determining Windows version
89!define REPLACEDLL_NOREGISTER ; Replace in use DLL function
90!include "ReplaceDLL.nsh"
91
92!if $%KBUILD_TARGET_ARCH% == "amd64"
93 !include "x64.nsh"
94!endif
95
96; Set Modern UI (MUI) as default
97!define USE_MUI
98
99!ifdef USE_MUI
100 ; Use modern UI, version 2
101 !include "MUI2.nsh"
102
103 ; MUI Settings
104 !define MUI_WELCOMEFINISHPAGE_BITMAP "$%VBOX_BRAND_WIN_ADD_INST_DLGBMP%"
105 !define MUI_ABORTWARNING
106 !define MUI_WELCOMEPAGE_TITLE_3LINES "Welcome to the ${PRODUCT_NAME} Additions Setup"
107
108 ; API defines
109 !define SM_CLEANBOOT 67
110
111 ; Icons
112 !if $%KBUILD_TARGET_ARCH% == "x86" ; 32-bit
113 !define MUI_ICON "$%VBOX_NSIS_ICON_FILE%"
114 !define MUI_UNICON "$%VBOX_NSIS_ICON_FILE%"
115 !else ; 64-bit
116 !define MUI_ICON "$%VBOX_WINDOWS_ADDITIONS_ICON_FILE%"
117 !define MUI_UNICON "$%VBOX_WINDOWS_ADDITIONS_ICON_FILE%"
118 !endif
119
120 ; Welcome page
121 !insertmacro MUI_PAGE_WELCOME
122!ifdef VBOX_WITH_LICENSE_DISPLAY
123 ; License page
124 !insertmacro MUI_PAGE_LICENSE "$(VBOX_LICENSE)"
125 !define MUI_LICENSEPAGE_RADIOBUTTONS
126!endif
127 ; Directory page
128 !insertmacro MUI_PAGE_DIRECTORY
129 ; Components Page
130 !insertmacro MUI_PAGE_COMPONENTS
131 ; Instfiles page
132 !insertmacro MUI_PAGE_INSTFILES
133
134 !ifndef _DEBUG
135 !define MUI_FINISHPAGE_TITLE_3LINES ; Have a bit more vertical space for text
136 !insertmacro MUI_PAGE_FINISH ; Only show in release mode - useful information for debugging!
137 !endif
138
139 ; Uninstaller pages
140 !insertmacro MUI_UNPAGE_INSTFILES
141
142 ; Define languages we will use
143 !insertmacro MUI_LANGUAGE "English"
144 !insertmacro MUI_LANGUAGE "French"
145 !insertmacro MUI_LANGUAGE "German"
146
147 ; Set branding text which appears on the horizontal line at the bottom
148!ifdef _DEBUG
149 BrandingText "VirtualBox Windows Additions $%VBOX_VERSION_STRING% (r$%VBOX_SVN_REV%) - Debug Build"
150!else
151 BrandingText "VirtualBox Windows Additions $%VBOX_VERSION_STRING% r$%VBOX_SVN_REV%"
152!endif
153
154!ifdef VBOX_WITH_LICENSE_DISPLAY
155 ; Set license language
156 LicenseLangString VBOX_LICENSE ${LANG_ENGLISH} "$%VBOX_BRAND_LICENSE_RTF%"
157
158 ; If license files not available (OSE / PUEL) build, then use the English one as default
159 !ifdef VBOX_BRAND_fr_FR_LICENSE_RTF
160 LicenseLangString VBOX_LICENSE ${LANG_FRENCH} "$%VBOX_BRAND_fr_FR_LICENSE_RTF%"
161 !else
162 LicenseLangString VBOX_LICENSE ${LANG_FRENCH} "$%VBOX_BRAND_LICENSE_RTF%"
163 !endif
164 !ifdef VBOX_BRAND_de_DE_LICENSE_RTF
165 LicenseLangString VBOX_LICENSE ${LANG_GERMAN} "$%VBOX_BRAND_de_DE_LICENSE_RTF%"
166 !else
167 LicenseLangString VBOX_LICENSE ${LANG_GERMAN} "$%VBOX_BRAND_LICENSE_RTF%"
168 !endif
169!endif
170
171 !insertmacro MUI_RESERVEFILE_LANGDLL
172!else ; !USE_MUI
173 XPStyle on
174!ifdef VBOX_WITH_LICENSE_DISPLAY
175 Page license
176!endif
177 Page components
178 Page directory
179 Page instfiles
180!endif
181
182; Must come after MUI includes to have certain defines set for DumpLog
183!include "dumplog.nsh" ; Dump log to file function
184
185; Language files
186!include "Languages\English.nsh"
187!include "Languages\French.nsh"
188!include "Languages\German.nsh"
189
190; Variables and output files
191Name "${PRODUCT_NAME} $%VBOX_VERSION_STRING%"
192!ifdef UNINSTALLER_ONLY
193 !echo "Uninstaller only!"
194 OutFile "$%PATH_TARGET%\VBoxWindowsAdditions-$%KBUILD_TARGET_ARCH%-uninst.exe"
195!else
196 OutFile "VBoxWindowsAdditions-$%KBUILD_TARGET_ARCH%.exe"
197!endif ; UNINSTALLER_ONLY
198
199; Define default installation directory
200!if $%KBUILD_TARGET_ARCH% == "x86" ; 32-bit
201 InstallDir "$PROGRAMFILES32\$%VBOX_VENDOR_SHORT%\VirtualBox Guest Additions"
202!else ; 64-bit
203 InstallDir "$PROGRAMFILES64\$%VBOX_VENDOR_SHORT%\VirtualBox Guest Additions"
204!endif
205
206InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
207ShowInstDetails show
208ShowUnInstDetails show
209RequestExecutionLevel highest
210
211; Internal parameters
212Var g_iSystemMode ; Current system mode (0 = Normal boot, 1 = Fail-safe boot, 2 = Fail-safe with network boot)
213Var g_strSystemDir ; Windows system directory
214Var g_strSysWow64 ; The SysWow64 directory on 64-bit systems
215Var g_strCurUser ; Current user using the system
216Var g_strAddVerMaj ; Installed Guest Additions: Major version
217Var g_strAddVerMin ; Installed Guest Additions: Minor version
218Var g_strAddVerBuild ; Installed Guest Additions: Build number
219Var g_strAddVerRev ; Installed Guest Additions: SVN revision
220Var g_strWinVersion ; Current Windows version we're running on
221Var g_bLogEnable ; Do logging when installing? "true" or "false"
222Var g_bCapDllCache ; Capability: Does the (Windows) guest have have a DLL cache which needs to be taken care of?
223Var g_bCapXPDM ; Capability: Is the guest able to handle/use our XPDM driver?
224Var g_bCapWDDM ; Capability: Is the guest able to handle/use our WDDM driver?
225
226; Command line parameters - these can be set/modified
227; on the command line
228Var g_bForceInstall ; Cmd line: Force installation on unknown Windows OS version
229Var g_bUninstall ; Cmd line: Just uninstall any previous Guest Additions and exit
230Var g_bRebootOnExit ; Cmd line: Auto-Reboot on successful installation. Good for unattended installations ("/reboot")
231Var g_iScreenBpp ; Cmd line: Screen depth ("/depth=X")
232Var g_iScreenX ; Cmd line: Screen resolution X ("/resx=X")
233Var g_iScreenY ; Cmd line: Screen resolution Y ("/resy=Y")
234Var g_iSfOrder ; Cmd line: Order of Shared Folders network provider (0=first, 1=second, ...)
235Var g_bIgnoreUnknownOpts ; Cmd line: Ignore unknown options (don't display the help)
236Var g_bNoVBoxServiceExit ; Cmd line: Do not quit VBoxService before updating - install on next reboot
237Var g_bNoVBoxTrayExit ; Cmd line: Do not quit VBoxTray before updating - install on next reboot
238Var g_bNoVideoDrv ; Cmd line: Do not install the VBoxVideo driver
239Var g_bNoGuestDrv ; Cmd line: Do not install the VBoxGuest driver
240Var g_bNoMouseDrv ; Cmd line: Do not install the VBoxMouse driver
241Var g_bNoStartMenuEntries ; Cmd line: Do not create start menu entries
242Var g_bWithAutoLogon ; Cmd line: Install VBoxGINA / VBoxCredProv for auto logon support
243Var g_bWithWDDM ; Cmd line: Install the WDDM graphics driver instead of the XPDM one
244Var g_bOnlyExtract ; Cmd line: Only extract all files, do *not* install them. Only valid with param "/D" (target directory)
245Var g_bPostInstallStatus ; Cmd line: Post the overall installation status to some external program (VBoxTray)
246
247; Platform parts of this installer
248!include "VBoxGuestAdditionsLog.nsh"
249!include "VBoxGuestAdditionsExternal.nsh"
250!include "VBoxGuestAdditionsCommon.nsh"
251!if $%KBUILD_TARGET_ARCH% == "x86" ; 32-bit only
252 !include "VBoxGuestAdditionsNT4.nsh"
253!endif
254!include "VBoxGuestAdditionsW2KXP.nsh"
255!include "VBoxGuestAdditionsVista.nsh"
256!include "VBoxGuestAdditionsUninstall.nsh" ; Product uninstallation
257!include "VBoxGuestAdditionsUninstallOld.nsh" ; Uninstallation of deprecated versions which must be removed first
258
259Function HandleCommandLine
260
261 Push $0 ; Command line (without process name)
262 Push $1 ; Number of parameters
263 Push $2 ; Current parameter index
264 Push $3 ; Current parameter pair (name=value)
265 Push $4 ; Current parameter name
266 Push $5 ; Current parameter value (if present)
267
268 StrCpy $1 "0" ; Init param counter
269 StrCpy $2 "1" ; Init current param counter
270
271 ${GetParameters} $0 ; Extract command line
272 ${If} $0 == "" ; If no parameters at all exit
273 Goto exit
274 ${EndIf}
275
276 ; Enable for debugging
277 ;MessageBox MB_OK "CmdLine: $0"
278
279 ${WordFind} $0 " " "#" $1 ; Get number of parameters in cmd line
280 ${If} $0 == $1 ; If result matches the input then
281 StrCpy $1 "1" ; no delimiter was found. Correct to 1 word total
282 ${EndIf}
283
284 ${While} $2 <= $1 ; Loop through all params
285
286 ${WordFind} $0 " " "+$2" $3 ; Get current name=value pair
287 ${WordFind} $3 "=" "+1" $4 ; Get current param name
288 ${WordFind} $3 "=" "+2" $5 ; Get current param value
289
290 ${StrFilter} $4 "-" "" "" $4 ; Transfer param name to lowercase
291
292 ; Enable for debugging
293 ;MessageBox MB_OK "#$2 of #$1, param='$3', name=$4, val=$5"
294
295 ${Switch} $4
296
297 ${Case} '/d' ; NSIS: /D=<instdir> switch, skip
298 ${Break}
299
300 ${Case} '/depth'
301 ${Case} 'depth'
302 StrCpy $g_iScreenBpp $5
303 ${Break}
304
305 ${Case} '/extract'
306 StrCpy $g_bOnlyExtract "true"
307 ${Break}
308
309 ${Case} '/force'
310 StrCpy $g_bForceInstall "true"
311 ${Break}
312
313 ${Case} '/help'
314 ${Case} '/H'
315 ${Case} '/h'
316 ${Case} '/?'
317 Goto usage
318 ${Break}
319
320 ${Case} '/ignore_unknownopts' ; Not officially documented
321 StrCpy $g_bIgnoreUnknownOpts "true"
322 ${Break}
323
324 ${Case} '/l'
325 ${Case} '/log'
326 ${Case} '/logging'
327 StrCpy $g_bLogEnable "true"
328 ${Break}
329
330 ${Case} '/ncrc' ; NSIS: /NCRC switch, skip
331 ${Break}
332
333 ${Case} '/no_vboxservice_exit' ; Not officially documented
334 StrCpy $g_bNoVBoxServiceExit "true"
335 ${Break}
336
337 ${Case} '/no_vboxtray_exit' ; Not officially documented
338 StrCpy $g_bNoVBoxTrayExit "true"
339 ${Break}
340
341 ${Case} '/no_videodrv' ; Not officially documented
342 StrCpy $g_bNoVideoDrv "true"
343 ${Break}
344
345 ${Case} '/no_guestdrv' ; Not officially documented
346 StrCpy $g_bNoGuestDrv "true"
347 ${Break}
348
349 ${Case} '/no_mousedrv' ; Not officially documented
350 StrCpy $g_bNoMouseDrv "true"
351 ${Break}
352
353 ${Case} '/no_startmenuentries' ; Not officially documented
354 StrCpy $g_bNoStartMenuEntries "true"
355 ${Break}
356
357!if $%VBOX_WITH_GUEST_INSTALL_HELPER% == "1"
358 ; This switch tells our installer that it
359 ; - should not quit VBoxTray during the update, because ...
360 ; - ... it should show the overall installation status
361 ; using VBoxTray's balloon message feature (since VBox 4.0)
362 ${Case} '/post_installstatus' ; Not officially documented
363 StrCpy $g_bNoVBoxTrayExit "true"
364 StrCpy $g_bPostInstallStatus "true"
365 ${Break}
366!endif
367
368 ${Case} '/reboot'
369 StrCpy $g_bRebootOnExit "true"
370 ${Break}
371
372 ${Case} '/s' ; NSIS: /S switch, skip
373 ${Break}
374
375 ${Case} '/sforder'
376 ${Case} 'sforder'
377 StrCpy $g_iSfOrder $5
378 ${Break}
379
380 ${Case} '/uninstall'
381 StrCpy $g_bUninstall "true"
382 ${Break}
383
384 ${Case} '/with_autologon'
385 StrCpy $g_bWithAutoLogon "true"
386 ${Break}
387
388!if $%VBOX_WITH_WDDM% == "1"
389 ${Case} '/with_wddm'
390 StrCpy $g_bWithWDDM "true"
391 ${Break}
392!endif
393
394 ${Case} '/xres'
395 ${Case} 'xres'
396 StrCpy $g_iScreenX $5
397 ${Break}
398
399 ${Case} '/yres'
400 ${Case} 'yres'
401 StrCpy $g_iScreenY $5
402 ${Break}
403
404 ${Default} ; Unknown parameter, print usage message
405 ; Prevent popping up usage message on (yet) unknown parameters
406 ; in silent mode, just skip
407 IfSilent +1 +2
408 ${Break}
409 goto usage
410 ${Break}
411
412 ${EndSwitch}
413
414next_param:
415
416 IntOp $2 $2 + 1
417
418 ${EndWhile}
419 Goto exit
420
421usage:
422
423 ; If we were told to ignore unknown (invalid) options, just return to
424 ; the parsing loop ...
425 ${If} $g_bIgnoreUnknownOpts == "true"
426 Goto next_param
427 ${EndIf}
428 MessageBox MB_OK "${PRODUCT_NAME} Installer$\r$\n$\r$\n \
429 Usage: VBoxWindowsAdditions-$%KBUILD_TARGET_ARCH% [OPTIONS] [/l] [/S] [/D=<PATH>]$\r$\n$\r$\n \
430 Options:$\r$\n \
431 /depth=BPP$\tSets the guest's display color depth (bits per pixel)$\r$\n \
432 /extract$\t$\tOnly extract installation files$\r$\n \
433 /force$\t$\tForce installation on unknown/undetected Windows versions$\r$\n \
434 /uninstall$\t$\tJust uninstalls the Guest Additions and exits$\r$\n \
435 /with_autologon$\tInstalls auto-logon support$\r$\n \
436 /with_d3d$\tInstalls D3D support$\r$\n \
437 /with_wddm$\tInstalls the WDDM instead of the XPDM graphics driver$\r$\n \
438 /xres=X$\t$\tSets the guest's display resolution (width in pixels)$\r$\n \
439 /yres=Y$\t$\tSets the guest's display resolution (height in pixels)$\r$\n \
440 $\r$\n \
441 Installer parameters:$\r$\n \
442 /l$\t$\tEnables logging$\r$\n \
443 /S$\t$\tSilent install$\r$\n \
444 /D=<PATH>$\tSets the default install path$\r$\n \
445 $\r$\n \
446 Note: Order of options and installer parameters is fixed, options first." /SD IDOK
447
448 ; No stack restore needed, we're about to quit
449 Quit
450
451done:
452
453!ifdef _DEBUG
454 ${LogVerbose} "Property: XRes: $g_iScreenX"
455 ${LogVerbose} "Property: YRes: $g_iScreenY"
456 ${LogVerbose} "Property: BPP: $g_iScreenBpp"
457 ${LogVerbose} "Property: Logging enabled: $g_bLogEnable"
458!endif
459
460exit:
461
462 Pop $5
463 Pop $4
464 Pop $3
465 Pop $2
466 Pop $1
467 Pop $0
468
469FunctionEnd
470
471Function CheckForOldGuestAdditions
472
473 Push $0
474 Push $1
475 Push $2
476
477begin:
478
479 ${LogVerbose} "Checking for old Guest Additions ..."
480
481sun_check:
482
483 ; Check for old "Sun VirtualBox Guest Additions"
484 ; - before rebranding to Oracle
485 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun VirtualBox Guest Additions" "UninstallString"
486 StrCmp $0 "" sun_xvm_check ; If string is empty, Sun additions are probably not installed (anymore)
487
488 MessageBox MB_YESNO $(VBOX_SUN_FOUND) /SD IDYES IDYES sun_uninstall
489 Pop $2
490 Pop $1
491 Pop $0
492 MessageBox MB_ICONSTOP $(VBOX_SUN_ABORTED) /SD IDOK
493 Quit
494
495sun_uninstall:
496
497 Call Uninstall_Sun
498 Goto success
499
500sun_xvm_check:
501
502 ; Check for old "Sun xVM VirtualBox Guest Additions"
503 ; - before getting rid of the "xVM" namespace
504 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sun xVM VirtualBox Guest Additions" "UninstallString"
505 StrCmp $0 "" innotek_check ; If string is empty, Sun xVM additions are probably not installed (anymore)
506
507 MessageBox MB_YESNO $(VBOX_SUN_FOUND) /SD IDYES IDYES sun_xvm_uninstall
508 Pop $2
509 Pop $1
510 Pop $0
511 MessageBox MB_ICONSTOP $(VBOX_SUN_ABORTED) /SD IDOK
512 Quit
513
514sun_xvm_uninstall:
515
516 Call Uninstall_SunXVM
517 Goto success
518
519innotek_check:
520
521 ; Check for old "innotek" Guest Additions" before rebranding to "Sun"
522 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\innotek VirtualBox Guest Additions" "UninstallString"
523 StrCmp $0 "" exit ; If string is empty, innotek Guest Additions are probably not installed (anymore)
524
525 MessageBox MB_YESNO $(VBOX_INNOTEK_FOUND) /SD IDYES IDYES innotek_uninstall
526 Pop $2
527 Pop $1
528 Pop $0
529 MessageBox MB_ICONSTOP $(VBOX_INNOTEK_ABORTED) /SD IDOK
530 Quit
531
532innotek_uninstall:
533
534 Call Uninstall_Innotek
535 Goto success
536
537success:
538
539 ; Nothing to do here yet
540
541exit:
542
543 Pop $2
544 Pop $1
545 Pop $0
546
547FunctionEnd
548
549Function CheckForInstalledComponents
550
551 Push $0
552 Push $1
553
554 ${LogVerbose} "Checking for installed components ..."
555 StrCpy $1 ""
556
557 Call SetAppMode64
558
559 ; VBoxGINA already installed? So we need to update the installed version as well,
560 ; regardless whether the user used "/with_autologon" or not
561 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
562 ${If} $0 == "VBoxGINA.dll"
563 StrCpy $1 "GINA"
564 ${Else}
565 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}" ""
566 ${If} $0 == "VBoxCredProv"
567 StrCpy $1 "Credential Provider"
568 ${EndIf}
569 ${EndIf}
570
571!ifdef _DEBUG
572 ${LogVerbose} "Auto-logon module: $0"
573!endif
574
575 ${IfNot} $1 == ""
576 ${LogVerbose} "Auto-logon support ($1) was installed previously"
577 StrCpy $g_bWithAutoLogon "true" ; Force update
578 ${Else}
579 ${LogVerbose} "Auto-logon support was not installed previously"
580 ${EndIf}
581
582 Pop $1
583 Pop $0
584
585FunctionEnd
586
587; Main Files
588Section $(VBOX_COMPONENT_MAIN) SEC01
589
590 SectionIn RO ; Section cannot be unselected (read-only)
591 ${If} $g_bPostInstallStatus == "true"
592 ${LogToVBoxTray} "0" "${PRODUCT_NAME} update started, please wait ..."
593 ${EndIf}
594
595 IfSilent +1 +2
596 StrCpy $g_bLogEnable "true" ; Force logging in silent mode
597
598 ${LogEnable} "$g_bLogEnable"
599 IfSilent +1 +2 ; NSIS will expand ${LogVerbose} before doing relative jumps!
600 LogText "Installer runs in silent mode"
601
602 SetOutPath "$INSTDIR"
603 SetOverwrite on
604
605 Call SetAppMode64
606
607 StrCpy $g_strSystemDir "$SYSDIR"
608
609 ${LogVerbose} "Version: $%VBOX_VERSION_STRING% (Rev $%VBOX_SVN_REV%)"
610 ${If} $g_strAddVerMaj != ""
611 ${LogVerbose} "Previous version: $g_strAddVerMaj.$g_strAddVerMin.$g_strAddVerBuild (Rev $g_strAddVerRev)"
612 ${Else}
613 ${LogVerbose} "No previous version of ${PRODUCT_NAME} detected"
614 ${EndIf}
615!if $%KBUILD_TARGET_ARCH% == "amd64"
616 ${LogVerbose} "Detected OS: Windows $g_strWinVersion (64-bit)"
617!else
618 ${LogVerbose} "Detected OS: Windows $g_strWinVersion (32-bit)"
619!endif
620 ${LogVerbose} "System Directory: $g_strSystemDir"
621
622!ifdef _DEBUG
623 ${LogVerbose} "Installer runs in debug mode"
624!endif
625
626 ;
627 ; Here starts the main dispatcher (based on guest OS)
628 ;
629
630 ; Which OS are we using?
631 ; @todo Use logic lib here
632!if $%KBUILD_TARGET_ARCH% == "x86" ; 32-bit
633 StrCmp $g_strWinVersion "NT4" nt4 ; Windows NT 4.0
634!endif
635 StrCmp $g_strWinVersion "2000" w2k ; Windows 2000
636 StrCmp $g_strWinVersion "XP" w2k ; Windows XP
637 StrCmp $g_strWinVersion "2003" w2k ; Windows 2003 Server
638 StrCmp $g_strWinVersion "Vista" vista ; Windows Vista
639 StrCmp $g_strWinVersion "7" vista ; Windows 7
640 StrCmp $g_strWinVersion "8" vista ; Windows 8
641 StrCmp $g_strWinVersion "8_1" vista ; Windows 8.1 / Windows 2012 Server R2
642 StrCmp $g_strWinVersion "10" vista ; Windows 10
643
644 ${If} $g_bForceInstall == "true"
645 Goto vista ; Assume newer OS than we know of ...
646 ${EndIf}
647
648 Goto notsupported
649
650!if $%KBUILD_TARGET_ARCH% == "x86" ; 32-bit
651nt4: ; Windows NT4
652
653 Call GetServicePack
654 Pop $R0 ; Major version
655 Pop $R1 ; Minor version
656
657 ; At least Service Pack 6 installed?
658 ${If} $R0 <> "6"
659 MessageBox MB_YESNO $(VBOX_NT4_NO_SP6) /SD IDYES IDYES +2
660 Quit
661 ${EndIf}
662
663 ; Copy some common files ...
664 Call Common_CopyFiles
665
666 Call NT4_Main
667 goto success
668!endif
669
670w2k: ; Windows 2000 and XP ...
671
672 ; Copy some common files ...
673 Call Common_CopyFiles
674
675 Call W2K_Main
676 goto success
677
678vista: ; Windows Vista / Windows 7 / Windows 8(.1)
679
680 ; Check requirments; this function can abort the installation if necessary!
681 Call Vista_CheckForRequirements
682
683 ; Copy some common files ...
684 Call Common_CopyFiles
685
686 Call W2K_Main ; First install stuff from Windows 2000 / XP
687 Call Vista_Main ; ... and some specific stuff for Vista / Windows 7
688 goto success
689
690notsupported:
691
692 MessageBox MB_ICONSTOP $(VBOX_PLATFORM_UNSUPPORTED) /SD IDOK
693 goto exit
694
695success:
696
697 ; Write a registry key with version and installation path for later lookup
698 WriteRegStr HKLM "${PRODUCT_INSTALL_KEY}" "Version" "$%VBOX_VERSION_STRING_RAW%"
699 WriteRegStr HKLM "${PRODUCT_INSTALL_KEY}" "VersionExt" "$%VBOX_VERSION_STRING%"
700 WriteRegStr HKLM "${PRODUCT_INSTALL_KEY}" "Revision" "$%VBOX_SVN_REV%"
701 WriteRegStr HKLM "${PRODUCT_INSTALL_KEY}" "InstallDir" "$INSTDIR"
702
703 ; Set the reboot flag to tell the finish page that is should
704 ; default to the "reboot now" entry
705 SetRebootFlag true
706
707exit:
708
709SectionEnd
710
711; Auto-logon support (section is hidden at the moment -- only can be enabled via command line switch)
712Section /o -$(VBOX_COMPONENT_AUTOLOGON) SEC02
713
714 Call SetAppMode64
715
716 Call GetWindowsVersion
717 Pop $R0 ; Windows Version
718
719 ${LogVerbose} "Installing auto-logon support ..."
720
721 ; Another GINA already is installed? Check if this is ours, otherwise let the user decide (unless it's a silent setup)
722 ; whether to replace it with the VirtualBox one or not
723 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL"
724 ${If} $0 != ""
725 ${If} $0 != "VBoxGINA.dll"
726 ${LogVerbose} "Found another already installed GINA module: $0"
727 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON1 $(VBOX_COMPONENT_AUTOLOGON_WARN_3RDPARTY) /SD IDYES IDYES install
728 ${LogVerbose} "Skipping GINA installation, keeping: $0"
729 goto skip
730 ${EndIf}
731 ${EndIf}
732
733install:
734
735 ; Do we need VBoxCredProv or VBoxGINA?
736 ${If} $R0 == 'Vista' ; Windows Vista.
737 ${OrIf} $R0 == '7' ; Windows 7.
738 ${OrIf} $R0 == '8' ; Windows 8.
739 ${OrIf} $R0 == '8_1' ; Windows 8.1 / Windows Server 2012 R2.
740 ${OrIf} $R0 == '10' ; Windows 10.
741 ; Use VBoxCredProv on Vista and up.
742 ${LogVerbose} "Installing VirtualBox credential provider ..."
743 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxCredProv.dll" "$g_strSystemDir\VBoxCredProv.dll" "$INSTDIR"
744 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}" "" "VBoxCredProv" ; adding to (default) key
745 WriteRegStr HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}" "" "VBoxCredProv" ; adding to (Default) key
746 WriteRegStr HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}\InprocServer32" "" "VBoxCredProv.dll" ; adding to (Default) key
747 WriteRegStr HKCR "CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}\InprocServer32" "ThreadingModel" "Apartment"
748 ${Else} ; Use VBoxGINA on older Windows OSes (< Vista)
749 ${LogVerbose} "Installing VirtualBox GINA ..."
750 !insertmacro ReplaceDLL "$%PATH_OUT%\bin\additions\VBoxGINA.dll" "$g_strSystemDir\VBoxGINA.dll" "$INSTDIR"
751 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" "GinaDLL" "VBoxGINA.dll"
752 ; Add Windows notification package callbacks for VBoxGINA
753 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\VBoxGINA" "DLLName" "VBoxGINA.dll"
754 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\VBoxGINA" "Impersonate" 0
755 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\VBoxGINA" "StopScreenSaver" "WnpScreenSaverStop"
756 ${EndIf}
757
758skip:
759
760 ; Nothing to do here right now
761
762exit:
763
764SectionEnd
765
766; Direct3D support
767Section /o $(VBOX_COMPONENT_D3D) SEC03
768
769 ; Nothing to do in here right now.
770
771SectionEnd
772
773; Start menu entries. Enabled by default and can be disabled by the user.
774Section /o $(VBOX_COMPONENT_STARTMENU) SEC04
775
776 CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
777 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" "" "$INSTDIR\iexplore.ico"
778 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\uninst.exe"
779
780SectionEnd
781
782!ifdef USE_MUI
783 ;Assign language strings to sections
784 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
785 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $(VBOX_COMPONENT_MAIN_DESC)
786 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} $(VBOX_COMPONENT_AUTOLOGON_DESC)
787 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $(VBOX_COMPONENT_D3D_DESC)
788 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $(VBOX_COMPONENT_STARTMENU_DESC)
789 !insertmacro MUI_FUNCTION_DESCRIPTION_END
790!endif ; USE_MUI
791
792Section -Content
793
794 WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
795
796SectionEnd
797
798; This section is called after all the files are in place
799Section -Post
800
801!ifdef _DEBUG
802 ${LogVerbose} "Doing post install ..."
803!endif
804
805!ifdef EXTERNAL_UNINSTALLER
806 SetOutPath "$INSTDIR"
807 FILE "$%PATH_TARGET%\uninst.exe"
808!else
809 WriteUninstaller "$INSTDIR\uninst.exe"
810!endif
811
812 ; Write uninstaller in "Add / Remove programs"
813 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
814 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
815 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
816 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
817 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
818
819 ; Tune TcpWindowSize for a better network throughput
820 WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" "TcpWindowSize" 64240
821
822!ifdef _DEBUG
823 ${LogVerbose} "Enable Backdoor logging for debug build."
824 WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\VBoxGuest" "LoggingEnabled" 255
825!endif
826
827 ; Add Sun Ray client info keys
828 ; Note: We only need 32-bit keys (HKLM\Software / HKLM\Software\Wow6432Node)
829!if $%KBUILD_TARGET_ARCH% == "amd64"
830 WriteRegStr HKLM "SOFTWARE\Wow6432Node\Oracle\Sun Ray\ClientInfoAgent\ReconnectActions" "" ""
831 WriteRegStr HKLM "SOFTWARE\Wow6432Node\Oracle\Sun Ray\ClientInfoAgent\DisconnectActions" "" ""
832!else
833 WriteRegStr HKLM "SOFTWARE\Oracle\Sun Ray\ClientInfoAgent\ReconnectActions" "" ""
834 WriteRegStr HKLM "SOFTWARE\Oracle\Sun Ray\ClientInfoAgent\DisconnectActions" "" ""
835!endif
836
837 ${LogVerbose} "Installation completed."
838
839SectionEnd
840
841; !!! NOTE: This function *has* to be right under the last section; otherwise it does
842; *not* get called! Don't ask me why ... !!!
843Function .onSelChange
844
845 Push $0
846
847 ; Handle selection of WDDM component
848 SectionGetFlags ${SEC03} $0
849 ${If} $0 == ${SF_SELECTED}
850
851!if $%VBOX_WITH_WDDM% == "1"
852 ; If we're able to use the WDDM driver just use it.
853 ${If} $g_bCapWDDM == "true"
854 StrCpy $g_bWithWDDM "true"
855 Goto exit
856 ${EndIf}
857
858!endif ; $%VBOX_WITH_WDDM% == "1"
859
860 ${Else} ; WDDM unselected again
861
862 ${If} $g_strWinVersion != "8" ; On Windows 8 WDDM is mandatory
863 ${AndIf} $g_strWinVersion != "8_1" ; ... also on Windows 8.1 / Windows 2012 Server R2
864 ${AndIf} $g_strWinVersion != "10" ; ... also on Windows 10
865 StrCpy $g_bWithWDDM "false"
866 ${EndIf}
867
868 ${EndIf}
869 Goto exit
870
871exit:
872
873 Pop $0
874
875FunctionEnd
876
877; This function is called when a critical error occurred, caused by
878; the Abort command
879Function .onInstFailed
880
881 ${LogVerbose} "$(VBOX_ERROR_INST_FAILED)"
882 MessageBox MB_ICONSTOP $(VBOX_ERROR_INST_FAILED) /SD IDOK
883
884 ${If} $g_bPostInstallStatus == "true"
885 ${LogToVBoxTray} "2" "Error while installing ${PRODUCT_NAME}!"
886 ${EndIf}
887
888 ; Set overall exit code
889 SetErrorLevel 1
890
891FunctionEnd
892
893; This function is called when installation was successful!
894Function .onInstSuccess
895
896 ${LogVerbose} "${PRODUCT_NAME} successfully installed"
897
898 ${If} $g_bPostInstallStatus == "true"
899 ${LogToVBoxTray} "0" "${PRODUCT_NAME} successfully updated!"
900 ${EndIf}
901
902 SetErrorLevel 0
903
904FunctionEnd
905
906; This function is called at the very beginning of installer execution
907Function .onInit
908
909 Push $0
910
911 ; Init values
912 StrCpy $g_iSystemMode "0"
913 StrCpy $g_strCurUser "<None>"
914 StrCpy $g_strAddVerMaj "0"
915 StrCpy $g_strAddVerMin "0"
916 StrCpy $g_strAddVerBuild "0"
917 StrCpy $g_strAddVerRev "0"
918
919 StrCpy $g_bIgnoreUnknownOpts "false"
920 StrCpy $g_bLogEnable "false"
921 StrCpy $g_bForceInstall "false"
922 StrCpy $g_bUninstall "false"
923 StrCpy $g_bRebootOnExit "false"
924 StrCpy $g_iScreenX "0"
925 StrCpy $g_iScreenY "0"
926 StrCpy $g_iScreenBpp "0"
927 StrCpy $g_iSfOrder "0"
928 StrCpy $g_bNoVBoxServiceExit "false"
929 StrCpy $g_bNoVBoxTrayExit "false"
930 StrCpy $g_bNoVideoDrv "false"
931 StrCpy $g_bNoGuestDrv "false"
932 StrCpy $g_bNoMouseDrv "false"
933 StrCpy $g_bNoStartMenuEntries "false"
934 StrCpy $g_bWithAutoLogon "false"
935 StrCpy $g_bOnlyExtract "false"
936 StrCpy $g_bWithWDDM "false"
937 StrCpy $g_bCapDllCache "false"
938 StrCpy $g_bCapXPDM "false"
939 StrCpy $g_bCapWDDM "false"
940 StrCpy $g_bPostInstallStatus "false"
941
942 ; We need a special directory set to SysWOW64 because some
943 ; shell operations don't support file redirection (yet)
944 StrCpy $g_strSysWow64 "$WINDIR\SysWOW64"
945
946 SetErrorLevel 0
947 ClearErrors
948
949!ifdef UNINSTALLER_ONLY
950
951 ;
952 ; If UNINSTALLER_ONLY is defined, we're only interested in uninst.exe
953 ; so we can sign it
954 ;
955 ; Note that the Quit causes the exit status to be 2 instead of 0
956 ;
957 WriteUninstaller "$%PATH_TARGET%\uninst.exe"
958 Quit
959
960!else
961
962 ; Handle command line
963 Call HandleCommandLine
964
965 ; Check if there's already another instance of the installer is running -
966 ; important for preventing NT4 to spawn the installer twice
967 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "VBoxGuestInstaller") ?e'
968 Pop $0
969 ${If} $0 != 0
970 Quit
971 ${EndIf}
972
973 ; Retrieve Windows version and store result in $g_strWinVersion
974 Call GetWindowsVersionEx
975 Pop $g_strWinVersion
976
977 ; Retrieve capabilities
978 Call CheckForCapabilities
979
980 ; Get user Name
981 AccessControl::GetCurrentUserName
982 Pop $g_strCurUser
983 ${LogVerbose} "Current user: $g_strCurUser"
984
985 ; Only extract files? This action can be called even from non-Admin users
986 ; and non-compatible architectures
987 ${If} $g_bOnlyExtract == "true"
988 Call ExtractFiles
989 MessageBox MB_OK|MB_ICONINFORMATION $(VBOX_EXTRACTION_COMPLETE) /SD IDOK
990 Quit
991 ${EndIf}
992
993 ; Check for correct architecture
994 Call CheckArchitecture
995 Pop $0
996 ${If} $0 <> 0 ; Wrong architecture? Tell the world
997!if $%KBUILD_TARGET_ARCH% == "amd64"
998 MessageBox MB_ICONSTOP $(VBOX_NOTICE_ARCH_AMD64) /SD IDOK
999!else
1000 MessageBox MB_ICONSTOP $(VBOX_NOTICE_ARCH_X86) /SD IDOK
1001!endif
1002 Abort "$(VBOX_NOTICE_ARCH_AMD64)"
1003 ${EndIf}
1004
1005 ; Has the user who calls us admin rights?
1006 UserInfo::GetAccountType
1007 Pop $0
1008 ${If} $0 != "Admin"
1009 MessageBox MB_ICONSTOP $(VBOX_NOADMIN) /SD IDOK
1010 Abort
1011 ${EndIf}
1012
1013 ; Only uninstall?
1014 ${If} $g_bUninstall == "true"
1015 Call Uninstall_Innotek
1016 Call Uninstall
1017 MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_UNINST_SUCCESS) /SD IDOK
1018 Quit
1019 ${EndIf}
1020
1021 Call CheckForInstalledComponents
1022
1023 ;
1024 ; Section 02
1025 ;
1026 ${If} $g_bWithAutoLogon == "true" ; Auto-logon support
1027 !insertmacro SelectSection ${SEC02}
1028 ${EndIf}
1029
1030 ;
1031 ; Section 03
1032 ;
1033 ${If} $g_bWithWDDM == "true" ; D3D / WDDM support
1034 !insertmacro SelectSection ${SEC03}
1035 ${EndIf}
1036 ; On Windows 8 / 8.1 / Windows Server 2012 R2 and newer we always select the 3D
1037 ; section and disable it so that it cannot be deselected again
1038 ${If} $g_strWinVersion == "8"
1039 ${OrIf} $g_strWinVersion == "8_1"
1040 ${OrIf} $g_strWinVersion == "10"
1041 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1042 SectionSetFlags ${SEC03} $0
1043 ${EndIf}
1044 ; If the guest is not able to handle/use our WDDM driver, then 3D is not available
1045 ${If} $g_bCapWDDM != "true"
1046 SectionSetFlags ${SEC03} ${SF_RO}
1047 ${EndIf}
1048
1049 ;
1050 ; Section 04
1051 ;
1052 ${If} $g_bNoStartMenuEntries == "false" ; Start menu entries
1053 !insertmacro SelectSection ${SEC04}
1054 ${EndIf}
1055
1056!ifdef USE_MUI
1057 ; Display language selection dialog (will be hidden in silent mode!)
1058 !ifdef VBOX_INSTALLER_ADD_LANGUAGES
1059 !insertmacro MUI_LANGDLL_DISPLAY
1060 !endif
1061!endif
1062
1063 Call SetAppMode64
1064
1065 ; Check for old additions
1066 Call CheckForOldGuestAdditions
1067 Call GetAdditionsVersion
1068
1069 ; Due to some bug in NSIS the license page won't be displayed if we're in
1070 ; 64-bit registry view, so as a workaround switch back to 32-bit (Wow6432Node)
1071 ; mode for now
1072 Call SetAppMode32
1073
1074!endif ; UNINSTALLER_ONLY
1075
1076 Pop $0
1077
1078FunctionEnd
1079
1080;
1081; The uninstaller is built separately when doing code signing
1082; For some reason NSIS still finds the Uninstall section even
1083; when EXTERNAL_UNINSTALLER is defined. This causes a silly warning
1084;
1085!ifndef EXTERNAL_UNINSTALLER
1086
1087Function un.onUninstSuccess
1088
1089 HideWindow
1090 MessageBox MB_ICONINFORMATION|MB_OK $(VBOX_UNINST_SUCCESS) /SD IDOK
1091
1092FunctionEnd
1093
1094Function un.onInit
1095
1096 ; Has the user who calls us admin rights?
1097 UserInfo::GetAccountType
1098 Pop $0
1099 ${If} $0 != "Admin"
1100 MessageBox MB_ICONSTOP $(VBOX_NOADMIN) /SD IDOK
1101 Abort
1102 ${EndIf}
1103
1104 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 $(VBOX_UNINST_CONFIRM) /SD IDYES IDYES proceed
1105 Quit
1106
1107proceed:
1108
1109 Call un.SetAppMode64
1110
1111 ; Set system directory
1112 StrCpy $g_strSystemDir "$SYSDIR"
1113
1114 ; We need a special directory set to SysWOW64 because some
1115 ; shell operations don't support file redirection (yet)
1116 StrCpy $g_strSysWow64 "$WINDIR\SysWOW64"
1117
1118 ; Retrieve Windows version we're running on and store it in $g_strWinVersion
1119 Call un.GetWindowsVersionEx
1120 Pop $g_strWinVersion
1121
1122 ; Retrieve capabilities
1123 Call un.CheckForCapabilities
1124
1125FunctionEnd
1126
1127Section Uninstall
1128
1129!ifdef _DEBUG
1130 ${LogEnable} "true"
1131!endif
1132
1133 Call un.SetAppMode64
1134
1135 ; Call the uninstall main function
1136 Call un.Uninstall
1137
1138 ; ... and remove the local install directory
1139 Call un.UninstallInstDir
1140
1141!ifndef _DEBUG
1142 SetAutoClose true
1143 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 $(VBOX_REBOOT_REQUIRED) /SD IDNO IDYES restart
1144 StrCmp $g_bRebootOnExit "true" restart
1145!endif
1146
1147 Goto exit
1148
1149restart:
1150
1151 ${LogVerbose} "Rebooting ..."
1152 Reboot
1153
1154exit:
1155
1156SectionEnd
1157
1158; !EXTERNAL_UNINSTALLER
1159!endif
1160
1161;Direct the output to our bin dir
1162!cd "$%PATH_OUT%\bin\additions"
Note: See TracBrowser for help on using the repository browser.

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