VirtualBox

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

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

scm --update-copyright-year

  • 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 93115 2022-01-01 11:31:46Z 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-2022 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 Configure the firewall to allow TXS to listen.
119echo *** Running: netsh firewall add portopening TCP 5048 "TestExecService 5048" >> %MY_LOG_FILE%
120netsh firewall add portopening TCP 5048 "TestExecService 5048" >> %MY_LOG_FILE% 2>&1
121echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
122
123echo *** Running: netsh firewall add portopening TCP 5042 "TestExecService 5042" >> %MY_LOG_FILE%
124netsh firewall add portopening TCP 5042 "TestExecService 5042" >> %MY_LOG_FILE% 2>&1
125echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
126
127rem Update the registry to autorun the service and make sure we've got autologon.
128echo *** Running: reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v NTConfiguration /d %SystemDrive%\Apps\vboxtxs.cmd /f >> %MY_LOG_FILE%
129reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v NTConfiguration /d %SystemDrive%\Apps\vboxtxs.cmd /f >> %MY_LOG_FILE% 2>&1
130echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
131
132echo *** Running: reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v PowerdownAfterShutdown /d 1 /f >> %MY_LOG_FILE%
133reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v PowerdownAfterShutdown /d 1 /f >> %MY_LOG_FILE% 2>&1
134echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
135
136echo *** Running: reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v ForceAutoLogon /d 1 /f >> %MY_LOG_FILE%
137reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v ForceAutoLogon /d 1 /f >> %MY_LOG_FILE% 2>&1
138echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
139rem AutoAdminLogon too if administrator?
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