NISysCfgSetSystemImageFromFolder2
- Updated2023-02-21
- 3 minute(s) read
NISysCfgStatus NISysCfgSetSystemImageFromFolder2( NISysCfgSessionHandle sessionHandle, NISysCfgBool autoRestart, const char [] sourceFolder, const char [] encryptionPassphrase, unsigned int numBlacklistEntries, const char ** blacklistFilesDirectories, NISysCfgBool originalSystemOnly, NISysCfgNetworkInterfaceSettings networkSettings );
Purpose
Applies a system image folder—a copy of the contents and software on the primary hard drive of a specified target system. Applying the image to the system restores it to the state captured in the image you create with NISysCfgCreateSystemImageAsFolder.
Parameters
| Input | ||||||||||||||||
| Name | Type | Description | ||||||||||||||
| sessionHandle | NISysCfgSessionHandle | Specifies the system handle for the system receiving the image. | ||||||||||||||
| autoRestart | NISysCfgBool | Restarts the system into install mode by default before the operation is performed, and restarts back to a running state after the operation is complete. If you choose not to restart automatically, and the system is not in install mode, the resulting image may not be valid. | ||||||||||||||
| sourceFolder | const char [] | Specifies the name and location of the target disk image folder on the local computer. | ||||||||||||||
| encryptionPassphrase | const char [] | A passphrase used to encrypt a portion of the image that contains sensitive information. | ||||||||||||||
| numBlacklistEntries | unsigned int | Specifies the number of files and/or in blacklistFilesDirectories. | ||||||||||||||
| blacklistFilesDirectories | const char ** |
Specifies the list of files and folders to exclude from the target image. Files on the blacklist will not be copied from the image to the target and they will not be removed from the target. Example |
||||||||||||||
| originalSystemOnly | NISysCfgBool | Verifies that the target system has the same MAC address as the system from which the image was originally created. Selecting TRUE will allow you to restore an image from the exact same target from which the image was created only. This option is FALSE by default. When the option is FALSE, this operation can also apply the system image to other targets of the same device class. | ||||||||||||||
| networkSettings | NISysCfgNetworkInterfaceSettings |
Applies all network settings from the image to all network adapters by default.
|
||||||||||||||
Return Value
| Name | Type | Description |
| returnValue | NISysCfgStatus | The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error. Refer to Status Codes or nisyscfg_errors.h for details regarding error codes. |
Example
This example applies to the blacklistFilesDirectories parameter. For this example, consider the following scenario:
- The image contains files A, B,C, D.
- The target contains files A, B, E, F.
- The user blacklist contains files A, C, E, G.
- File A on the target is not modified despite being in the image because it is in the blacklist.
- File B from the image is written over the one on the target.
- File C from the image is not written to the target because it is in the blacklist.
- File D from the image is written to the target.
- File E on the target is not part of the image but is not deleted because it is in the blacklist.
- File F on the target gets deleted because it is not part of the image.
- File G in the blacklist is ignored because it is part of neither the image nor the target.