예제 #1
0
        internal static Process StartWith(string filePath, int portOffset, out VersionKeeperSettings serverCfg, string fileKey = "binary1")
        {
            var tmpDir = CreateDir.InTemp();
            var tmpExe = Path.Combine(tmpDir, EXE_NAME);

            File.Copy(GetDebugExe(), tmpExe);

            var cfgUri = Path.Combine(tmpDir, VersionKeeperCfgFile.FILE_NAME);

            serverCfg = ComposeCfg(filePath, portOffset, fileKey);
            JsonFile.Write(serverCfg, cfgUri);
            return(Process.Start(tmpExe));
        }
예제 #2
0
        internal static async Task <Process> StartWith(string filePath, VersionKeeperSettings serverCfg, bool updateSelf = false)
        {
            var tmpDir = CreateDir.InTemp();
            var tmpExe = Path.Combine(tmpDir, EXE_NAME);

            File.Copy(GetDebugExe(), tmpExe);

            var cfgUri = Path.Combine(tmpDir, UpdateCheckerCfgFile.FILE_NAME);
            var cfgObj = ComposeCfg(filePath, serverCfg, updateSelf);

            JsonFile.Write(cfgObj, cfgUri);

            await Task.Delay(1000 * 2);

            var proc = Process.Start(tmpExe);

            await Task.Delay(1000 * 4);

            return(proc);
        }