VirtualBox

Changeset 92793 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 7, 2021 10:01:45 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148711
Message:

Unattended: The previous fix exposed a dormant bug: reg.exe by default asks for confirmation if a registry key already already exists. Better play safe everywhere and use /f. Also do the firewall config before adding the registry key which starts TxS, as it could start in principle immediately and would hang with "Windows Firewall has blocked some features of this program".

Location:
trunk/src/VBox/Main/UnattendedTemplates
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/UnattendedTemplates/win_nt6_unattended.xml

    r91542 r92793  
    130130                <RunAsynchronousCommand>
    131131                    <Order>1</Order>
    132                     <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassCPUCheck /t REG_DWORD /d 1</Path>
     132                    <Path>reg.exe ADD /f HKLM\SYSTEM\Setup\LabConfig /v BypassCPUCheck /t REG_DWORD /d 1</Path>
    133133                    <Description>Windows 11 disable CPU check</Description>
    134134                </RunAsynchronousCommand>
    135135                <RunAsynchronousCommand>
    136136                    <Order>2</Order>
    137                     <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassRAMCheck /t REG_DWORD /d 1</Path>
     137                    <Path>reg.exe ADD /f HKLM\SYSTEM\Setup\LabConfig /v BypassRAMCheck /t REG_DWORD /d 1</Path>
    138138                    <Description>Windows 11 disable RAM check</Description>
    139139                </RunAsynchronousCommand>
    140140                <RunAsynchronousCommand>
    141141                    <Order>3</Order>
    142                     <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassSecureBootCheck /t REG_DWORD /d 1</Path>
     142                    <Path>reg.exe ADD /f HKLM\SYSTEM\Setup\LabConfig /v BypassSecureBootCheck /t REG_DWORD /d 1</Path>
    143143                    <Description>Windows 11 disable Secure Boot check</Description>
    144144                </RunAsynchronousCommand>
    145145                <RunAsynchronousCommand>
    146146                    <Order>4</Order>
    147                     <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassStorageCheck /t REG_DWORD /d 1</Path>
     147                    <Path>reg.exe ADD /f HKLM\SYSTEM\Setup\LabConfig /v BypassStorageCheck /t REG_DWORD /d 1</Path>
    148148                    <Description>Windows 11 disable Storage check</Description>
    149149                </RunAsynchronousCommand>
    150150                <RunAsynchronousCommand>
    151151                    <Order>5</Order>
    152                     <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassTPMCheck /t REG_DWORD /d 1</Path>
     152                    <Path>reg.exe ADD /f HKLM\SYSTEM\Setup\LabConfig /v BypassTPMCheck /t REG_DWORD /d 1</Path>
    153153                    <Description>Windows 11 disable TPM check</Description>
    154154                </RunAsynchronousCommand>
     
    175175                <RunAsynchronousCommand>
    176176                    <Order>1</Order>
    177                     <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassCPUCheck /t REG_DWORD /d 1</Path>
     177                    <Path>reg.exe ADD /f HKLM\SYSTEM\Setup\LabConfig /v BypassCPUCheck /t REG_DWORD /d 1</Path>
    178178                    <Description>Windows 11 disable CPU check</Description>
    179179                </RunAsynchronousCommand>
    180180                <RunAsynchronousCommand>
    181181                    <Order>2</Order>
    182                     <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassRAMCheck /t REG_DWORD /d 1</Path>
     182                    <Path>reg.exe ADD /f HKLM\SYSTEM\Setup\LabConfig /v BypassRAMCheck /t REG_DWORD /d 1</Path>
    183183                    <Description>Windows 11 disable RAM check</Description>
    184184                </RunAsynchronousCommand>
    185185                <RunAsynchronousCommand>
    186186                    <Order>3</Order>
    187                     <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassSecureBootCheck /t REG_DWORD /d 1</Path>
     187                    <Path>reg.exe ADD /f HKLM\SYSTEM\Setup\LabConfig /v BypassSecureBootCheck /t REG_DWORD /d 1</Path>
    188188                    <Description>Windows 11 disable Secure Boot check</Description>
    189189                </RunAsynchronousCommand>
    190190                <RunAsynchronousCommand>
    191191                    <Order>4</Order>
    192                     <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassStorageCheck /t REG_DWORD /d 1</Path>
     192                    <Path>reg.exe ADD /f HKLM\SYSTEM\Setup\LabConfig /v BypassStorageCheck /t REG_DWORD /d 1</Path>
    193193                    <Description>Windows 11 disable Storage check</Description>
    194194                </RunAsynchronousCommand>
    195195                <RunAsynchronousCommand>
    196196                    <Order>5</Order>
    197                     <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassTPMCheck /t REG_DWORD /d 1</Path>
     197                    <Path>reg.exe ADD /f HKLM\SYSTEM\Setup\LabConfig /v BypassTPMCheck /t REG_DWORD /d 1</Path>
    198198                    <Description>Windows 11 disable TPM check</Description>
    199199                </RunAsynchronousCommand>
  • trunk/src/VBox/Main/UnattendedTemplates/win_postinstall.cmd

    r92769 r92793  
    116116echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
    117117
    118 rem Update the registry to autorun the service and make sure we've got autologon.
    119 echo *** Running: reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v NTConfiguration /d %SystemDrive%\Apps\vboxtxs.cmd >> %MY_LOG_FILE%
    120 reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v NTConfiguration /d %SystemDrive%\Apps\vboxtxs.cmd >> %MY_LOG_FILE% 2>&1
    121 echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
    122 
    123 echo *** Running: reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v PowerdownAfterShutdown /d 1 >> %MY_LOG_FILE%
    124 reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v PowerdownAfterShutdown /d 1 >> %MY_LOG_FILE% 2>&1
    125 echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
    126 
    127 echo *** Running: reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v ForceAutoLogon /d 1 >> %MY_LOG_FILE%
    128 reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v ForceAutoLogon /d 1 >> %MY_LOG_FILE% 2>&1
    129 echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
    130 rem  AutoAdminLogon too if administrator?
    131 
    132118rem Configure the firewall to allow TXS to listen.
    133119echo *** Running: netsh firewall add portopening TCP 5048 "TestExecService 5048" >> %MY_LOG_FILE%
     
    138124netsh firewall add portopening TCP 5042 "TestExecService 5042" >> %MY_LOG_FILE% 2>&1
    139125echo *** 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 /f HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v NTConfiguration /d %SystemDrive%\Apps\vboxtxs.cmd >> %MY_LOG_FILE%
     129reg.exe ADD /f HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v NTConfiguration /d %SystemDrive%\Apps\vboxtxs.cmd >> %MY_LOG_FILE% 2>&1
     130echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
     131
     132echo *** Running: reg.exe ADD /f "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v PowerdownAfterShutdown /d 1 >> %MY_LOG_FILE%
     133reg.exe ADD /f "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v PowerdownAfterShutdown /d 1 >> %MY_LOG_FILE% 2>&1
     134echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
     135
     136echo *** Running: reg.exe ADD /f "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v ForceAutoLogon /d 1 >> %MY_LOG_FILE%
     137reg.exe ADD /f "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v ForceAutoLogon /d 1 >> %MY_LOG_FILE% 2>&1
     138echo *** ERRORLEVEL: %ERRORLEVEL% >> %MY_LOG_FILE%
     139rem  AutoAdminLogon too if administrator?
    140140
    141141@@VBOX_COND_END@@
Note: See TracChangeset for help on using the changeset viewer.

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