Esempio n. 1
0
 public UpdatedExeNotifier(string fileToWatch) : base(fileToWatch)
 {
     if (!CurrentExe.GetFullPath().IsInTempDir())
     {
         RelaunchInTemp();
     }
 }
Esempio n. 2
0
        private static void CopyCfgToTemp(string tmpExe)
        {
            var exeNow = CurrentExe.GetFullPath();
            var cfgNow = exeNow + ".config";
            var tmpCfg = tmpExe + ".config";

            if (File.Exists(cfgNow))
            {
                File.Copy(cfgNow, tmpCfg, true);
            }
        }
Esempio n. 3
0
        private void RelaunchInTemp()
        {
            if (WatchedFile.IsBlank())
            {
                return;
            }
            var exeNow = CurrentExe.GetFullPath();
            var cfgNow = exeNow + ".config";
            var tmpExe = WatchedFile.MakeTempCopy(".exe");
            var tmpCfg = tmpExe + ".config";

            if (File.Exists(cfgNow))
            {
                File.Copy(cfgNow, tmpCfg, true);
            }

            Process.Start(tmpExe, GetCommandLineArgs());
            Application.Current.Shutdown();
        }
 public ClonedCopyExeUpdater(IThrottledFileWatcher throttledFileWatcher)
 {
     ClonedCopy           = CurrentExe.GetFullPath();
     _watchr              = throttledFileWatcher;
     _watchr.FileChanged += OnMasterCopyChanged;
 }