Exemple #1
0
        private void ScanFile(string filePath, out bool cancel)
        {
            cancel = false;

            if (!filePath.StartsWith(_parms.DistributionDirectory))
            {
                return;
            }

            ManifestInput.InputFile input = new ManifestInput.InputFile
            {
                Name = filePath.Substring(_parms.DistributionDirectory.Length)
            };

            if (input.Name.StartsWith("logs\\"))
            {
                if (!_addedIgnoreLogs)
                {
                    ManifestInput.InputFile inputLogs = new ManifestInput.InputFile
                    {
                        Ignore = true,
                        Name   = "logs/"
                    };
                    _manifestInput.Files.Add(inputLogs);
                    _addedIgnoreLogs = true;
                }
                return;
            }

            if (input.Name.EndsWith("exe") || input.Name.EndsWith("dll"))
            {
                input.Checksum = true;
            }
            else
            {
                input.Checksum = false;
            }

            if (input.Name.EndsWith("exe.config"))
            {
                input.Config = true;
            }

            if (input.Name.EndsWith("critical.config"))
            {
                input.Config   = false;
                input.Checksum = true;
            }

            _manifestInput.Files.Add(input);
        }
        private void ScanFile(string filePath, out bool cancel)
        {
            cancel = false;

            if (!filePath.StartsWith(_parms.DistributionDirectory)) 
                return;

            ManifestInput.InputFile input = new ManifestInput.InputFile
                                                {
                                                    Name = filePath.Substring(_parms.DistributionDirectory.Length)
                                                };

            if (input.Name.StartsWith("logs\\"))
            {
                if (!_addedIgnoreLogs)
                {
                    ManifestInput.InputFile inputLogs = new ManifestInput.InputFile
                                                            {
                                                                Ignore = true, 
                                                                Name = "logs/"
                                                            };
                    _manifestInput.Files.Add(inputLogs);
                    _addedIgnoreLogs = true;
                }
                return;
            }

            if (input.Name.EndsWith("exe") || input.Name.EndsWith("dll"))
                input.Checksum = true;
            else
                input.Checksum = false;

            if (input.Name.EndsWith("exe.config"))
                input.Config = true;

            if (input.Name.EndsWith("critical.config"))
            {
                input.Config = false;
                input.Checksum = true;
            }

            _manifestInput.Files.Add(input);
        }