Esempio n. 1
0
        protected void RunExecutables(string appPath, string[] execs, VersionItemList versionItems)
        {
            foreach (var item in execs)
            {
                Process.Start(item);
            }

            if (versionItems == null)
            {
                return;
            }

            foreach (var item in versionItems)
            {
                if (!item.NeedRunItem())
                {
                    continue;
                }

                var  itemPath = Path.Combine(appPath, item.GetUnzipItemFullPath());
                bool exists   = Array.Exists(execs,
                                             str => String.Equals(str, itemPath, StringComparison.InvariantCultureIgnoreCase));

                if (!exists)
                {
                    Process.Start(itemPath);
                }
            }
        }
Esempio n. 2
0
        protected void InstallUpdate(string tempPath, string appPath, VersionItemList versionItems)
        {
            //first copy new version manifest
            File.Copy(
                Path.Combine(tempPath, VersionManifest.VersionManifestFileName),
                Path.Combine(appPath, VersionManifest.VersionManifestFileName),
                true);

            //copy new files
            foreach (var item in versionItems)
            {
                if (item.NeedCopyItem())
                {
                    File.Copy(
                        Path.Combine(tempPath, item.GetUnzipItemFullPath()),
                        Path.Combine(appPath, item.GetUnzipItemFullPath()),
                        true);
                }

                if (item.InstallAction == InstallAction.Delete)
                {
                    var path = Path.Combine(appPath, item.GetUnzipItemFullPath());
                    if (File.Exists(path))
                    {
                        File.Delete(path);
                    }
                    else if (Directory.Exists(path))
                    {
                        Directory.Delete(path, true);
                    }
                }
            }
        }
Esempio n. 3
0
 public VersionManifest()
 {
     VersionItems  = new VersionItemList();
     VersionNumber = new Version();
     BootStrapper  = new List <LocationHash>();
 }