VirtualBox

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

Last change on this file since 107044 was 106061, checked in by vboxsync, 2 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to CRLF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 7.3 KB
Line 
1@echo off
2rem $Id: win_postinstall.cmd 106061 2024-09-16 14:03:52Z 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-2024 Oracle and/or its affiliates.
12rem
13rem This file is part of VirtualBox base platform packages, as
14rem available from https://www.virtualbox.org.
15rem
16rem This program is free software; you can redistribute it and/or
17rem modify it under the terms of the GNU General Public License
18rem as published by the Free Software Foundation, in version 3 of the
19rem License.
20rem
21rem This program is distributed in the hope that it will be useful, but
22rem WITHOUT ANY WARRANTY; without even the implied warranty of
23rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24rem General Public License for more details.
25rem
26rem You should have received a copy of the GNU General Public License
27rem along with this program; if not, see <https://www.gnu.org/licenses>.
28rem
29rem SPDX-License-Identifier: GPL-3.0-only
30rem
31
32rem Globals.
33set MY_LOG_FILE=C:\vboxpostinstall.log
34
35rem Log header.
36echo *** started >> %MY_LOG_FILE%
37echo *** CD=%CD% >> %MY_LOG_FILE%
38echo *** Environment BEGIN >> %MY_LOG_FILE%
39set >> %MY_LOG_FILE%
40echo *** Environment END >> %MY_LOG_FILE%
41
42@@VBOX_COND_HAS_PROXY@@
43set PROXY=@@VBOX_INSERT_PROXY@@
44set HTTP_PROXY=%PROXY%
45set HTTPS_PROXY=%PROXY%
46echo HTTP proxy is %HTTP_PROXY% >> %MY_LOG_FILE%
47echo HTTPS proxy is %HTTPS_PROXY% >> %MY_LOG_FILE%
48@@VBOX_COND_END@@
49
50@@VBOX_COND_IS_INSTALLING_ADDITIONS@@
51rem
52rem Install the guest additions.
53rem
54
55rem First find the CDROM with the GAs on them.
56set MY_VBOX_ADDITIONS=E:\vboxadditions
57if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
58set MY_VBOX_ADDITIONS=D:\vboxadditions
59if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
60set MY_VBOX_ADDITIONS=F:\vboxadditions
61if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
62set MY_VBOX_ADDITIONS=G:\vboxadditions
63if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
64set MY_VBOX_ADDITIONS=E:
65if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
66set MY_VBOX_ADDITIONS=F:
67if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
68set MY_VBOX_ADDITIONS=G:
69if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
70set MY_VBOX_ADDITIONS=D:
71if exist %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe goto found_vbox_additions
72set MY_VBOX_ADDITIONS=E:\vboxadditions
73:found_vbox_additions
74echo *** MY_VBOX_ADDITIONS=%MY_VBOX_ADDITIONS%\ >> %MY_LOG_FILE%
75
76rem Then add signing certificate to trusted publishers
77echo *** Running: %MY_VBOX_ADDITIONS%\cert\VBoxCertUtil.exe ... >> %MY_LOG_FILE%
78%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
79echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
80
81rem Then do the installation.
82echo *** Running: %MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe /S >> %MY_LOG_FILE%
83%MY_VBOX_ADDITIONS%\VBoxWindowsAdditions.exe /S
84echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
85
86@@VBOX_COND_END@@
87
88
89@@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@
90rem
91rem Install the Test Execution service
92rem
93
94rem First find the CDROM with the validation kit on it.
95set MY_VBOX_VALIDATION_KIT=E:\vboxvalidationkit
96if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
97set MY_VBOX_VALIDATION_KIT=D:\vboxvalidationkit
98if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
99set MY_VBOX_VALIDATION_KIT=F:\vboxvalidationkit
100if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
101set MY_VBOX_VALIDATION_KIT=G:\vboxvalidationkit
102if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
103set MY_VBOX_VALIDATION_KIT=E:
104if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
105set MY_VBOX_VALIDATION_KIT=F:
106if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
107set MY_VBOX_VALIDATION_KIT=G:
108if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
109set MY_VBOX_VALIDATION_KIT=D:
110if exist %MY_VBOX_VALIDATION_KIT%\vboxtxs-readme.txt goto found_vbox_validation_kit
111set MY_VBOX_VALIDATION_KIT=E:\vboxvalidationkit
112:found_vbox_validation_kit
113echo *** MY_VBOX_VALIDATION_KIT=%MY_VBOX_VALIDATION_KIT%\ >> %MY_LOG_FILE%
114
115rem Copy over the files.
116echo *** Running: mkdir %SystemDrive%\Apps >> %MY_LOG_FILE%
117mkdir %SystemDrive%\Apps >> %MY_LOG_FILE% 2>&1
118echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
119
120echo *** Running: copy %MY_VBOX_VALIDATION_KIT%\win\* %SystemDrive%\Apps >> %MY_LOG_FILE%
121copy %MY_VBOX_VALIDATION_KIT%\win\* %SystemDrive%\Apps >> %MY_LOG_FILE% 2>&1
122echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
123
124echo *** Running: copy %MY_VBOX_VALIDATION_KIT%\win\%PROCESSOR_ARCHITECTURE%\* %SystemDrive%\Apps >> %MY_LOG_FILE%
125copy %MY_VBOX_VALIDATION_KIT%\win\%PROCESSOR_ARCHITECTURE%\* %SystemDrive%\Apps >> %MY_LOG_FILE% 2>&1
126echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
127
128rem Configure the firewall to allow TXS to listen.
129echo *** Running: netsh firewall add portopening TCP 5048 "TestExecService 5048" >> %MY_LOG_FILE%
130netsh firewall add portopening TCP 5048 "TestExecService 5048" >> %MY_LOG_FILE% 2>&1
131echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
132
133echo *** Running: netsh firewall add portopening TCP 5042 "TestExecService 5042" >> %MY_LOG_FILE%
134netsh firewall add portopening TCP 5042 "TestExecService 5042" >> %MY_LOG_FILE% 2>&1
135echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
136
137rem Update the registry to autorun the service and make sure we've got autologon.
138echo *** Running: reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v NTConfiguration /d %SystemDrive%\Apps\vboxtxs.cmd /f >> %MY_LOG_FILE%
139reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v NTConfiguration /d %SystemDrive%\Apps\vboxtxs.cmd /f >> %MY_LOG_FILE% 2>&1
140echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
141
142echo *** Running: reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v PowerdownAfterShutdown /d 1 /f >> %MY_LOG_FILE%
143reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v PowerdownAfterShutdown /d 1 /f >> %MY_LOG_FILE% 2>&1
144echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
145
146echo *** Running: reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v ForceAutoLogon /d 1 /f >> %MY_LOG_FILE%
147reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v ForceAutoLogon /d 1 /f >> %MY_LOG_FILE% 2>&1
148echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
149rem AutoAdminLogon too if administrator?
150
151@@VBOX_COND_END@@
152
153
154@@VBOX_COND_HAS_POST_INSTALL_COMMAND@@
155rem
156rem Run user command.
157rem
158echo *** Running custom user command ... >> %MY_LOG_FILE%
159echo *** Running: "@@VBOX_INSERT_POST_INSTALL_COMMAND@@" >> %MY_LOG_FILE%
160@@VBOX_INSERT_POST_INSTALL_COMMAND@@
161@@VBOX_COND_END@@
162
163rem
164rem Eject/rename no longer needed unattended install configuration and media.
165rem
166if exist a:\autounattend.xml ren a:\autounattend.xml autounattend-disabled.xml
167rem rem @todo eject DVD install media
168
169echo *** done >> %MY_LOG_FILE%
170
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