install(completionHandler:)
Start installing macOS.
Declaration
@preconcurrency func install(completionHandler: @escaping @Sendable (Result<Void, any Error>) -> Void)Parameters
- completionHandler:
A block the framework calls after installation has completed successfully or has failed.
The
errorparameter passed to the block isnilif installation was successful. The framework invokes the block on the VM’s queue. The completion handler returns anerrorparameter that describes the reason for the failure; theerrorisnilif installation was successful.
Discussion
This method starts the installation process. The VM must be in a stopped state. During the installation operation, pausing or stopping the VM results in an undefined behavior.
If you start the installation on the same VZMacOSInstaller object more than once, the framework raises an exception.
Call this method only on the VM’s queue.