Example #1
0
 public UpdatedExeNotifier(string fileToWatch) : base(fileToWatch)
 {
     if (!CurrentExe.GetFullPath().IsInTempDir())
     {
         RelaunchInTemp();
     }
 }
Example #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);
            }
        }
Example #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;
 }