VirtualBox

source: vbox/trunk/src/VBox/Main/UnattendedTemplates/win_postinstall.cmd@ 86728

Last change on this file since 86728 was 84875, checked in by vboxsync, 5 years ago

bugref:8527. Added proxy settings into the post-installation scripts.

  • Property svn:eol-style set to CRLF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 6.8 KB
Line 
1@echo off
2rem $Id: win_postinstall.cmd 84875 2020-06-19 05:45:20Z vboxsync $
3rem rem @file
4rem Post installation script template for Windows.
5rem
6rem This runs after the target system has been booted, typically as
7rem part of the first logon.
8rem
9
10rem
11rem Copyright (C) 2017-2020 Oracle Corporation
12rem
13rem This file is part of VirtualBox Open Source Edition (OSE), as
14rem available from http://www.virtualbox.org. This file is free software;
15rem you can redistribute it and/or modify it under the terms of the GNU
16rem General Public License (GPL) as published by the Free Software
17rem Foundation, in version 2 as it comes in the "COPYING" file of the
18rem VirtualBox OSE distribution. VirtualBox OSE is distributed in the
19rem hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
20rem
21
22rem Globals.
23set MY_LOG_FILE=C:\vboxpostinstall.log
24
25rem Log header.
26echo *** started >> %MY_LOG_FILE%
27echo *** CD=%CD% >> %MY_LOG_FILE%
28echo *** Environment BEGIN >> %MY_LOG_FILE%
29set >> %MY_LOG_FILE%
30echo *** Environment END >> %MY_LOG_FILE%
31
32@@VBOX_COND_HAS_PROXY@@
33set PROXY=@@VBOX_INSERT_PROXY@@
34set HTTP_PROXY=%PROXY%
35set HTTPS_PROXY=%PROXY%
36echo HTTP proxy is %HTTP_PROXY% >> %MY_LOG_FILE%
37echo HTTPS proxy is %HTTPS_PROXY% >> %MY_LOG_FILE%
38@@VBOX_COND_END@@
39
40@@VBOX_COND_IS_INSTALLING_ADDITIONS@@
41rem
42rem Install the guest additions.
43rem
44
45rem First find the CDROM with the GAs on them.
46set MY_VBOX_ADDITIONS=E:\vboxadditions
47if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
48set MY_VBOX_ADDITIONS=D:\vboxadditions
49if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
50set MY_VBOX_ADDITIONS=F:\vboxadditions
51if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
52set MY_VBOX_ADDITIONS=G:\vboxadditions
53if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
54set MY_VBOX_ADDITIONS=E:
55if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
56set MY_VBOX_ADDITIONS=F:
57if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
58set MY_VBOX_ADDITIONS=G:
59if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
60set MY_VBOX_ADDITIONS=D:
61if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
62set MY_VBOX_ADDITIONS=E:\vboxadditions
63:found_vbox_additions
64echo *** MY_VBOX_ADDITIONS=%MY_VBOX_ADDITIONS%\ >> %MY_LOG_FILE%
65
66rem Then add signing certificate to trusted publishers
67echo *** Running: %MY_VBOX_ADDITIONS%\cert\VBoxCertUtil.exe ... >> %MY_LOG_FILE%
68%MY_VBOX_ADDITIONS%\cert\VBoxCertUtil.exe add-trusted-publisher %MY_VBOX_ADDITIONS%\cert\vbox*.cer --root %MY_VBOX_ADDITIONS%\cert\vbox*.cer >> %MY_LOG_FILE% 2>&1
69echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
70
71rem Then do the installation.
72echo *** Running: %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe /S >> %MY_LOG_FILE%
73%MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe /S
74echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
75
76@@VBOX_COND_END@@
77
78
79@@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@
80rem
81rem Install the Test Execution service
82rem
83
84rem First find the CDROM with the validation kit on it.
85set MY_VBOX_VALIDATION_KIT=E:\vboxvalidationkit
86if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
87set MY_VBOX_VALIDATION_KIT=D:\vboxvalidationkit
88if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
89set MY_VBOX_VALIDATION_KIT=F:\vboxvalidationkit
90if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
91set MY_VBOX_VALIDATION_KIT=G:\vboxvalidationkit
92if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
93set MY_VBOX_VALIDATION_KIT=E:
94if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
95set MY_VBOX_VALIDATION_KIT=F:
96if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
97set MY_VBOX_VALIDATION_KIT=G:
98if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
99set MY_VBOX_VALIDATION_KIT=D:
100if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
101set MY_VBOX_VALIDATION_KIT=E:\vboxvalidationkit
102:found_vbox_validation_kit
103echo *** MY_VBOX_VALIDATION_KIT=%MY_VBOX_VALIDATION_KIT%\ >> %MY_LOG_FILE%
104
105rem Copy over the files.
106echo *** Running: mkdir %SystemDrive%\Apps >> %MY_LOG_FILE%
107mkdir %SystemDrive%\Apps >> %MY_LOG_FILE% 2>&1
108echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
109
110echo *** Running: copy %MY_VBOX_VALIDATION_KIT%\win\* %SystemDrive%\Apps >> %MY_LOG_FILE%
111copy %MY_VBOX_VALIDATION_KIT%\win\* %SystemDrive%\Apps >> %MY_LOG_FILE% 2>&1
112echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
113
114echo *** Running: copy %MY_VBOX_VALIDATION_KIT%\win\%PROCESSOR_ARCHITECTURE%\* %SystemDrive%\Apps >> %MY_LOG_FILE%
115copy %MY_VBOX_VALIDATION_KIT%\win\%PROCESSOR_ARCHITECTURE%\* %SystemDrive%\Apps >> %MY_LOG_FILE% 2>&1
116echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
117
118rem Update the registry to autorun the service and make sure we've got autologon.
119echo *** Running: reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v NTConfiguration /d %SystemDrive%\Apps\vboxtxs.cmd >> %MY_LOG_FILE%
120reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v NTConfiguration /d %SystemDrive%\Apps\vboxtxs.cmd >> %MY_LOG_FILE% 2>&1
121echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
122
123echo *** Running: reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon /v PowerdownAfterShutdown /d 1 >> %MY_LOG_FILE%
124reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon /v PowerdownAfterShutdown /d 1 >> %MY_LOG_FILE% 2>&1
125echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
126
127echo *** Running: reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon /v ForceAutoLogon /d 1 >> %MY_LOG_FILE%
128reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon /v ForceAutoLogon /d 1 >> %MY_LOG_FILE% 2>&1
129echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
130rem AutoAdminLogon too if administrator?
131
132rem Configure the firewall to allow TXS to listen.
133echo *** Running: netsh firewall add portopening TCP 5048 "TestExecService 5048" >> %MY_LOG_FILE%
134netsh firewall add portopening TCP 5048 "TestExecService 5048" >> %MY_LOG_FILE% 2>&1
135echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
136
137echo *** Running: netsh firewall add portopening TCP 5042 "TestExecService 5042" >> %MY_LOG_FILE%
138netsh firewall add portopening TCP 5042 "TestExecService 5042" >> %MY_LOG_FILE% 2>&1
139echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
140
141@@VBOX_COND_END@@
142
143
144@@VBOX_COND_HAS_POST_INSTALL_COMMAND@@
145rem
146rem Run user command.
147rem
148echo *** Running custom user command ... >> %MY_LOG_FILE%
149echo *** Running: "@@VBOX_INSERT_POST_INSTALL_COMMAND@@" >> %MY_LOG_FILE%
150@@VBOX_INSERT_POST_INSTALL_COMMAND@@
151@@VBOX_COND_END@@
152
153echo *** done >> %MY_LOG_FILE%
154
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