- Timestamp:
- Sep 30, 2021 8:32:24 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 147191
- Location:
- trunk/src/VBox/Main
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/Main/UnattendedTemplates/win_nt6_unattended.xml ¶
r68257 r91502 27 27 <DiskID>0</DiskID> 28 28 <WillWipeDisk>true</WillWipeDisk> 29 @@VBOX_COND_IS_NOT_FIRMWARE_UEFI@@ 29 30 <CreatePartitions> 31 <!-- TODO: Use the standard partitioning scheme at starting with Windows 8 maybe, using 2 partitions as described by Microsoft? --> 30 32 <CreatePartition> 31 33 <Order>1</Order> … … 34 36 </CreatePartition> 35 37 </CreatePartitions> 38 @@VBOX_COND_END@@ 39 @@VBOX_COND_IS_FIRMWARE_UEFI@@ 40 <CreatePartitions> 41 <CreatePartition wcm:action="add"> 42 <Order>1</Order> 43 <Type>Primary</Type> 44 <Size>300</Size> 45 </CreatePartition> 46 <CreatePartition wcm:action="add"> 47 <Order>2</Order> 48 <Type>EFI</Type> 49 <Size>100</Size> 50 </CreatePartition> 51 <CreatePartition wcm:action="add"> 52 <Order>3</Order> 53 <Type>MSR</Type> 54 <Size>128</Size> 55 </CreatePartition> 56 <CreatePartition wcm:action="add"> 57 <Order>4</Order> 58 <Type>Primary</Type> 59 <Extend>true</Extend> 60 </CreatePartition> 61 </CreatePartitions> 62 <ModifyPartitions> 63 <ModifyPartition wcm:action="add"> 64 <Order>1</Order> 65 <PartitionID>1</PartitionID> 66 <Label>WINRE</Label> 67 <Format>NTFS</Format> 68 <TypeID>de94bba4-06d1-4d40-a16a-bfd50179d6ac</TypeID> 69 </ModifyPartition> 70 <ModifyPartition wcm:action="add"> 71 <Order>2</Order> 72 <PartitionID>2</PartitionID> 73 <Label>EFI</Label> 74 <Format>FAT32</Format> 75 </ModifyPartition> 76 <ModifyPartition wcm:action="add"> 77 <Order>3</Order> 78 <PartitionID>3</PartitionID> 79 </ModifyPartition> 80 <ModifyPartition wcm:action="add"> 81 <Order>4</Order> 82 <PartitionID>4</PartitionID> 83 <Label>Windows</Label> 84 <Letter>C</Letter> 85 <Format>NTFS</Format> 86 </ModifyPartition> 87 </ModifyPartitions> 88 @@VBOX_COND_END@@ 36 89 </Disk> 37 90 </DiskConfiguration> … … 57 110 <InstallTo> 58 111 <DiskID>0</DiskID> 112 @@VBOX_COND_IS_NOT_FIRMWARE_UEFI@@ 59 113 <PartitionID>1</PartitionID> 114 @@VBOX_COND_END@@ 115 @@VBOX_COND_IS_FIRMWARE_UEFI@@ 116 <PartitionID>4</PartitionID> 117 @@VBOX_COND_END@@ 60 118 </InstallTo> 61 119 <WillShowUI>OnError</WillShowUI> … … 67 125 <DisplayReport>OnError</DisplayReport> 68 126 </ComplianceCheck> 127 128 <!-- Apply registry tweaks to Windows PE, skipping the checks in the Windows 11 setup program. This will not make it to the final install, and should do no harm with older Windows versions. --> 129 <RunAsynchronous> 130 <RunAsynchronousCommand> 131 <Order>1</Order> 132 <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassCPUCheck /t REG_DWORD /d 1</Path> 133 <Description>Windows 11 disable CPU check</Description> 134 </RunAsynchronousCommand> 135 <RunAsynchronousCommand> 136 <Order>2</Order> 137 <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassRAMCheck /t REG_DWORD /d 1</Path> 138 <Description>Windows 11 disable RAM check</Description> 139 </RunAsynchronousCommand> 140 <RunAsynchronousCommand> 141 <Order>3</Order> 142 <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassSecureBootCheck /t REG_DWORD /d 1</Path> 143 <Description>Windows 11 disable Secure Boot check</Description> 144 </RunAsynchronousCommand> 145 <RunAsynchronousCommand> 146 <Order>4</Order> 147 <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassStorageCheck /t REG_DWORD /d 1</Path> 148 <Description>Windows 11 disable Storage check</Description> 149 </RunAsynchronousCommand> 150 <RunAsynchronousCommand> 151 <Order>5</Order> 152 <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassTPMCheck /t REG_DWORD /d 1</Path> 153 <Description>Windows 11 disable TPM check</Description> 154 </RunAsynchronousCommand> 155 </RunAsynchronous> 69 156 70 157 </component> … … 144 231 <Order>2</Order> 145 232 <Description>VirtualBox post guest install steps </Description> 146 <CommandLine>cmd.exe /c A:\VBOXPOST.CMD --vista-or-newer</CommandLine>233 <CommandLine>cmd.exe /c @@VBOX_INSERT_AUXILIARY_INSTALL_DIR@@VBOXPOST.CMD --vista-or-newer</CommandLine> 147 234 </SynchronousCommand> 148 235 </FirstLogonCommands> -
TabularUnified trunk/src/VBox/Main/include/UnattendedImpl.h ¶
r90828 r91502 73 73 Utf8Str const &i_getPostInstallScriptTemplatePath() const; 74 74 Utf8Str const &i_getPostInstallCommand() const; 75 /** The directory where the unattended install config and script is 76 * located, from the perspective of the running unattended install. */ 77 Utf8Str const &i_getAuxiliaryInstallDir() const; 75 78 Utf8Str const &i_getExtraInstallKernelParameters() const; 76 79 77 80 bool i_isRtcUsingUtc() const; 78 81 bool i_isGuestOs64Bit() const; 82 bool i_isFirmwareEFI() const; 79 83 VBOXOSTYPE i_getGuestOsType() const; 80 84 Utf8Str const &i_getDetectedOSVersion(); … … 89 93 bool mfRtcUseUtc; /**< Copy of IMachine::RTCUseUTC (locking reasons). */ 90 94 bool mfGuestOs64Bit; /**< 64-bit (true) or 32-bit guest OS (set by prepare). */ 95 FirmwareType_T menmFirmwareType; /**< Firmware type BIOS/EFI (set by prepare). */ 91 96 VBOXOSTYPE meGuestOsType; /**< The guest OS type (set by prepare). */ 92 97 UnattendedInstaller *mpInstaller; /**< The installer instance (set by prepare, deleted by done). */ -
TabularUnified trunk/src/VBox/Main/include/UnattendedInstaller.h ¶
r91312 r91502 65 65 * IUnattended. */ 66 66 Utf8Str mStrDefaultExtraInstallKernelParameters; 67 /** The directory of the post install script in the unattended install 68 * environment, i.e. when it gets started by the unattended installer 69 * of the respective guest OS. */ 70 Utf8Str mStrAuxiliaryInstallDir; 67 71 68 72 private: … … 179 183 const Utf8Str &getAuxiliaryFloppyFilePath() const { return mStrAuxiliaryFloppyFilePath; } 180 184 const Utf8Str &getDefaultExtraInstallKernelParameters() const { return mStrDefaultExtraInstallKernelParameters; } 185 const Utf8Str &getAuxiliaryInstallDir() const { return mStrAuxiliaryInstallDir; } 181 186 182 187 /* … … 377 382 "win_nt5_unattended.sif", "win_postinstall.cmd", 378 383 "WINNT.SIF", "VBOXPOST.CMD") 379 { Assert(isOriginalIsoNeeded()); Assert(isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); Assert(!bootFromAuxiliaryIso()); } 384 { 385 Assert(isOriginalIsoNeeded()); Assert(isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); Assert(!bootFromAuxiliaryIso()); 386 mStrAuxiliaryInstallDir = "A:\\"; 387 } 380 388 ~UnattendedWindowsSifInstaller() {} 381 389 … … 397 405 "win_nt6_unattended.xml", "win_postinstall.cmd", 398 406 "autounattend.xml", "VBOXPOST.CMD") 399 { Assert(isOriginalIsoNeeded()); Assert(isAuxiliaryFloppyNeeded()); Assert(isAuxiliaryIsoIsVISO()); Assert(!bootFromAuxiliaryIso()); } 407 { 408 Assert(isOriginalIsoNeeded()); Assert(isAuxiliaryFloppyNeeded() != isAuxiliaryIsoNeeded()); Assert(isAuxiliaryIsoIsVISO()); Assert(!bootFromAuxiliaryIso()); 409 if (isAuxiliaryFloppyNeeded()) 410 mStrAuxiliaryInstallDir = "A:\\"; 411 else if (bootFromAuxiliaryIso()) 412 mStrAuxiliaryInstallDir = "D:\\"; 413 else 414 mStrAuxiliaryInstallDir = "E:\\"; 415 } 400 416 ~UnattendedWindowsXmlInstaller() {} 401 417 402 bool isAuxiliaryFloppyNeeded() const { return true; } 418 bool isAuxiliaryFloppyNeeded() const { return !mpParent->i_isFirmwareEFI(); } 419 bool isAuxiliaryIsoNeeded() const { return mpParent->i_isFirmwareEFI(); } 420 bool isAuxiliaryIsoIsVISO() const { return true; } 403 421 bool bootFromAuxiliaryIso() const { return false; } 404 422 }; -
TabularUnified trunk/src/VBox/Main/src-server/UnattendedImpl.cpp ¶
r90692 r91502 507 507 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10); 508 508 } 509 else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("co_release")) == 0) 510 { 511 pszVersion = "21H2"; // ?? 512 *penmOsType = VBOXOSTYPE_Win11_x64; 513 } 509 514 else 510 515 LogRel(("Unattended: sources/idwbinfo.txt: Unknown: BuildBranch=%s\n", pBuf->sz)); … … 740 745 741 746 /** @todo look at the install.wim file too, extracting the XML (easy) and 742 * figure out the available image numbers and such. The format is 743 * documented. */ 747 * figure out the available image numbers and such. The format is 748 * documented. It would also provide really accurate Windows 749 * version information without the need to guess. The current 750 * content of mStrDetectedOSVersion is mostly useful for human 751 * consumption. Long term it should be possible to have version 752 * conditionals (expr style, please) in the templates, which 753 * would make them a lot easier to write and more flexible at the 754 * same time. */ 744 755 745 756 return S_FALSE; … … 1221 1232 return hrc; 1222 1233 1234 FirmwareType_T enmFirmware = FirmwareType_BIOS; 1235 hrc = ptrMachine->COMGETTER(FirmwareType)(&enmFirmware); 1236 if (FAILED(hrc)) 1237 return hrc; 1238 1223 1239 /* 1224 1240 * Write lock this object and set attributes we got from IMachine. … … 2658 2674 } 2659 2675 2676 Utf8Str const &Unattended::i_getAuxiliaryInstallDir() const 2677 { 2678 Assert(isReadLockedOnCurrentThread()); 2679 /* Only the installer knows, forward the call. */ 2680 AssertReturn(mpInstaller != NULL, Utf8Str::Empty); 2681 return mpInstaller->getAuxiliaryInstallDir(); 2682 } 2683 2660 2684 Utf8Str const &Unattended::i_getExtraInstallKernelParameters() const 2661 2685 { … … 2674 2698 Assert(isReadLockedOnCurrentThread()); 2675 2699 return mfGuestOs64Bit; 2700 } 2701 2702 bool Unattended::i_isFirmwareEFI() const 2703 { 2704 Assert(isReadLockedOnCurrentThread()); 2705 return menmFirmwareType != FirmwareType_BIOS; 2676 2706 } 2677 2707 -
TabularUnified trunk/src/VBox/Main/src-server/UnattendedScript.cpp ¶
r90828 r91502 371 371 else if (IS_PLACEHOLDER_MATCH("POST_INSTALL_COMMAND")) 372 372 rValue = mpUnattended->i_getPostInstallCommand(); 373 else if (IS_PLACEHOLDER_MATCH("AUXILIARY_INSTALL_DIR")) 374 rValue = mpUnattended->i_getAuxiliaryInstallDir(); 373 375 else if (IS_PLACEHOLDER_MATCH("IMAGE_INDEX")) 374 376 rValue.printf("%u", mpUnattended->i_getImageIndex()); … … 475 477 *pfOutputting = mpUnattended->i_getPostInstallCommand().isNotEmpty(); 476 478 else if (IS_PLACEHOLDER_MATCH("HAS_NO_POST_INSTALL_COMMAND")) 477 *pfOutputting = !mpUnattended->i_getPostInstallCommand().isNotEmpty();479 *pfOutputting = mpUnattended->i_getPostInstallCommand().isEmpty(); 478 480 /* Product key: */ 479 481 else if (IS_PLACEHOLDER_MATCH("HAS_PRODUCT_KEY")) 480 482 *pfOutputting = mpUnattended->i_getProductKey().isNotEmpty(); 481 483 else if (IS_PLACEHOLDER_MATCH("HAS_NO_PRODUCT_KEY")) 482 *pfOutputting = !mpUnattended->i_getProductKey().isNotEmpty();484 *pfOutputting = mpUnattended->i_getProductKey().isEmpty(); 483 485 /* Minimal installation: */ 484 486 else if (IS_PLACEHOLDER_MATCH("IS_MINIMAL_INSTALLATION")) … … 486 488 else if (IS_PLACEHOLDER_MATCH("IS_NOT_MINIMAL_INSTALLATION")) 487 489 *pfOutputting = !mpUnattended->i_isMinimalInstallation(); 490 /* Is firmware UEFI: */ 491 else if (IS_PLACEHOLDER_MATCH("IS_FIRMWARE_UEFI")) 492 *pfOutputting = mpUnattended->i_isFirmwareEFI(); 493 else if (IS_PLACEHOLDER_MATCH("IS_NOT_FIRMWARE_UEFI")) 494 *pfOutputting = !mpUnattended->i_isFirmwareEFI(); 488 495 /* Is RTC using UTC (i.e. set to UTC time on startup): */ 489 496 else if (IS_PLACEHOLDER_MATCH("IS_RTC_USING_UTC"))
Note:
See TracChangeset
for help on using the changeset viewer.