AtomicDirectory.Install
Section titled “AtomicDirectory.Install”
- Installs a disjoint candidate tree and restores the previous destination if installation fails.
Required contracts
Section titled “Required contracts”API: engine
Project: Inno.Core.IO
Declaration
Section titled “Declaration”public static void Inno.Core.IO.AtomicDirectory.Install(string source, string destination, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))Parameters
Section titled “Parameters”Parameter source: The complete candidate directory.
Parameter destination: The destination directory.
Parameter cancellationToken: Cancels preparation or bounded rename waits before the candidate commits.
Remarks
Section titled “Remarks”The caller must serialize readers and writers while the two directory moves run. Cancellation before commit restores the previous destination without canceling rollback. Cancellation observed after a blocked rename takes precedence over its timeout error. A committed candidate is not canceled afterward. Backup cleanup runs after commit; its failure preserves the installed candidate and remaining backup.
Exceptions
Section titled “Exceptions”Exception T:System.ArgumentException: Either path is blank, or the candidate and destination trees overlap.
Exception T:System.IO.DirectoryNotFoundException: The candidate directory does not exist.
Exception T:System.IO.IOException: Installation fails before the candidate becomes authoritative.
Exception T:Inno.Core.IO.DirectoryCleanupException: Installation committed, but the old backup could not be removed. The installed tree remains complete.
Exception T:System.UnauthorizedAccessException: The operating system denies access before the candidate can be installed.
Exception T:System.AggregateException: Installation and restoration both fail; neither tree is deleted to force a rollback.
Exception T:System.OperationCanceledException: Cancellation is observed before the candidate commits, including while handling a failed rename. Any moved previous tree is restored.