示例#1
0
 public InstalledFileInfo(FileInstallInfo fileInfo)
 {
     Path     = fileInfo.DestinationFolder;
     FileName = fileInfo.FileName;
     Flags    = fileInfo.Flags;
     FileDate = fileInfo.FileDate;
 }
示例#2
0
        public override void OnInstallFile(ref FileInstallInfo fileInfo, out bool skipped)
        {
            // check to see if it's a name we should skip
            if (SkipFileNames.Find(fileInfo.FileName) != null)
            {
                Utility.Output(string.Format("Skipping file '{0}'", fileInfo.FileName));
                skipped = true;
                return;
            }

            // do any path replacements
            foreach (KeyValuePair <string, string> val in PathStringReplacements)
            {
                fileInfo.DestinationFolder = fileInfo.DestinationFolder.Replace(val.Key, val.Value);
            }

            Utility.Output(string.Format("Installing '{0}' to '{1}'", fileInfo.FileName, fileInfo.DestinationFolder));

            base.OnInstallFile(ref fileInfo, out skipped);

            if (FileProgress != null)
            {
                FileProgress((++m_fileCount * 100) / FileCount);
            }
        }
示例#3
0
        public override void OnInstallFile(ref FileInstallInfo fileInfo, out bool skipped)
        {
            // check to see that the file is in the expected list
            InstalledFileInfo info = new InstalledFileInfo(fileInfo);

            bool found = false;

            foreach (InstalledFileInfo searchFor in m_testData.InstalledFiles)
            {
                // TODO: for now ignore date and flags, but these need to be validated in a future test
                if (info.CompareTo(searchFor, true, true) == 0)
                {
                    found = true;
                    // mark it as installed - we'll look at these later in the test to make sure everything was installed
                    searchFor.Installed = true;
                    break;
                }
            }

            if (!found)
            {
                Assert.Fail(string.Format("File '{0}' or one of its properties was unexpected", fileInfo.FileName));
            }

            // lie about us skipping the file so the underlying installer doesn't know
            skipped = false;

            // don't call the base - we're just testing
        }
示例#4
0
 public override void OnInstallFile(ref FileInstallInfo fileInfo, out bool skipped)
 {
     skipped = true;
 }