winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

LocalInstaller.cs (738B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 
      4 namespace WinGetSourceCreator.Model
      5 {
      6     public class LocalInstaller : Installer
      7     {
      8         // The full path of the installer.
      9         // Gets copied to the output directory and optionally signed.
     10         public string Input { get; set; } = string.Empty;
     11 
     12         internal new void Validate()
     13         {
     14             base.Validate();
     15             if (string.IsNullOrEmpty(this.Input))
     16             {
     17                 throw new ArgumentNullException(nameof(this.Input));
     18             }
     19 
     20             if (!File.Exists(this.Input))
     21             {
     22                 throw new FileNotFoundException(this.Input);
     23             }
     24         }
     25     }
     26 }