Пример #1
0
        public bool InstallChocolateyInstallPackage(string packageName, string fileType, string silentArgs, string file, int[] validExitCodes, string workingDirectory)
        {
            Debug("Calling 'ChocolateyRequest::InstallChocolateyInstallPackage' '{0}','{1}','{2}','{3}','{4}','{5}' ", packageName, fileType, silentArgs, file,
                  validExitCodes.Select(each => each.ToString()).SafeAggregate((current, each) => current + "," + each), workingDirectory);

            switch (fileType.ToLowerInvariant())
            {
            case "msi":
            case "msu":
                return(ProviderServices.Install(file, silentArgs, this));

            case "exe":
                return(StartChocolateyProcessAsAdmin("{0}".format(silentArgs), file, true, true, validExitCodes, workingDirectory));
            }
            return(false);
        }