- Мой МеморизИТ
- Windows Setup Automation Overview
- Use Setupconfig.ini to install Windows
- What is a setupconfig file?
- How does Windows Setup use Setupconfig.ini?
- Using media/ISO file
- Using Windows Update
- Use an answer file while installing Windows
- Modify an existing installation
- Implicit Answer File Search Order
- Sensitive Data in Answer Files
- Windows Setup Annotates Configuration Passes in an Answer File
- Implicit Answer File Search Examples
- Answer Files Named Autounattend.xml are Automatically Discovered by Windows Setup
- Answer Files are Discovered in Order of Precedence in Predefined Search Paths
- Answer Files Must Include a Valid Configuration Pass
- Additional Resources
Мой МеморизИТ
происходит только при первом входе, зайдя в систему во второй раз под этим же пользователем их не будет
Получаем новый guid
PowerShell команда [guid]::NewGuid()
HKEY_LOCAL_MACHINESOFTWAREMicrosoftActive SetupInstalled Components
Внутри ключа могут находятся следующие параметры:
- @ (значение по умолчанию). В нёго можно поместить название компонента которое будет отображаться при выполнении на Windows XP/2003.
- Version – текстовое представление версии, где подэлементы разделены запятыми. Например 1,0,24.
- StubPath – выполняемая командная строка. Здесь может быть что угодно: вызов исполняемого файла, скрипта cmd, vbs или powershell (разумеется надо будет указать powershell.exe а уже в качестве его параметра имя скрипта).
Есть еще несколько необязательных параметров, их можно подсмотреть у соседних элементов ActiveSetup.
После того как вы подготовили этот ключ – можете распостранить его по компьютерам любым удобным вам образом, например включить в образ операционной системы или выполнив с помощью ConfigMgr или стартап-скрипта команду reg import.
Теперь давайте рассмотрим как этот механизм работает. На самом деле всё очень просто.
При входе пользователя в систему, Windows сверяет содержимое ключей HKEY_LOCAL_MACHINESOFTWAREMicrosoftActive SetupInstalled Components и HKEY_CURRENT_USERSOFTWAREMicrosoftActive SetupInstalled Components. Для каждого ключа из HKLM ищется копия с таким же GUID в HKCU и если не находится, то выполняется команда из StubPath, и по её завершению, в HKCU создается ключ с таким же GUID, версией, и т.п.
Если же ключ есть и в HKLM и в HKCU, то сравнивается версия, и если версия в HKCU младше чем в HKLM, то компонент запускается снова, а затем обновляется версия в HKCU.
Ну и разумеется если совпадает и GUID и версия, то это значит что компонент уже запускался для этого пользователя, и снова его выполнять не надо.
Windows Setup Automation Overview
Use Setupconfig.ini to install Windows
What is a setupconfig file?
Setupconfig is a configuration file that is used to pass a set of flags or parameters to Windows setup.exe. Use this file as an alternative to passing parameters to Windows setup on a command line. This functionality is available in Windows 10, version 1511 and later.
IT pros can use the setupconfig file to add parameters to Windows Setup from Windows Update and Windows Server Update Services.
The different parameters that can be used with Windows 10 Setup.exe are described in this topic.
Setupconfig.ini files can contain single parameters, or parameters and value pairs. Do not include “/” characters, and with parameter and value pairs, include “=” between the two.
For example, you create a Setupconfig.ini with the following. Note that the header [SetupConfig] is required.
This is equivalent to the following command line:
How does Windows Setup use Setupconfig.ini?
Using media/ISO file
If you are running Windows setup from media or an ISO file, you must include the location to the setupconfig file on the command line (“/ConfigFile
”) when running setup.exe. For example:
If you include a parameter on the command line and the same parameter in the setupconfig file, the setupconfig file parameter and value has precedence.
Using Windows Update
If the update is delivered through Windows Update, Windows Setup searches in a default location for a setupconfig file. You can include the setupconfig file here:
Use an answer file while installing Windows
You can automate Windows installation by using an answer file:
Use a USB flash drive
Use a sample answer file or create your own with Windows System Image Manager (Windows SIM).
Save the file as Autounattend.xml on the root of a USB flash drive.
On a new PC, put in the Windows product DVD and the USB flash drive, and then boot the PC. When no other answer file is selected, Windows Setup searches for this file.
Select an answer file
- You can select a specific answer file during installation by booting to the Windows Preinstallation Environment, and using the setup.exe command with the /unattend:filename option. For more information, see WinPE: Create USB Bootable drive.
For sample answer files and a list of settings used to automate installation, see Automate Windows Setup.
Modify an existing installation
Because reboots are required during Setup, a copy of the answer file is cached to the %WINDIR%\Panther directory of the Windows installation. You can modify this file to do any of the following:
Update system and control panel settings without booting the image.
Update an image by preparing the PC to boot to audit mode (see Microsoft-Windows-Deployment\Reseal\Mode).
Update the order in which drivers or packages are installed. (Packages with dependencies may require installation in a certain order.)
Replace the answer file in an offline image
Create a custom answer file in Windows System Image Manager (Windows SIM).
Open an elevated command prompt.
Mount the Windows image.
Modify or replace the file: \Windows\Panther\unattend.xml in the mounted image.
NoteВ В The answer file in the image may contain settings that have not yet been processed. If you want these settings to get processed, edit the existing file rather than replacing it.
Unmount the image.
Test the image by deploying it to a new PC, without specifying an answer file. When Windows Setup runs, it finds and uses this answer file.
Implicit Answer File Search Order
WindowsВ Setup searches for answer files at the beginning of each configuration pass, including the initial installation and after applying and booting an image. If an answer file is found, and it contains settings for the given configuration pass, it processes those settings.
WindowsВ Setup identifies and logs all available answer files, depending on the search order. The answer file that has the highest precedence is used. The answer file is validated and then cached to the computer. Valid answer files are cached to the $Windows.
BT\Sources\Panther directory during the windowsPE and offlineServicing configuration passes. After the Windows installation is extracted to the hard disk, the answer file is cached to %WINDIR%\panther.
The following table shows the implicit answer file search order.
Search Order | Location | Description |
---|---|---|