private static void Show(string topicPath, string vnp, string appName, string webRootPath, Action onAppStart, Action <object, EventArgs> onAppExit) { string cortonaCachePath = "C:/ProgramData/ParallelGraphics/VM/TC_Cache"; if (Directory.Exists(cortonaCachePath)) { try { PathHelper.ForceDeleteFolderContentRecursively(cortonaCachePath); } catch (Exception ex) { _logger.LogError(ex, $"Error cleaning folder {cortonaCachePath}"); } } ExternalProgram external = new ExternalProgram(); TopicModel model = JsonConvert.DeserializeObject <TopicModel>(File.ReadAllText(topicPath)); OldTopicModel oldModel = JsonConvert.DeserializeObject <OldTopicModel>(File.ReadAllText(topicPath)); if (!string.IsNullOrEmpty(oldModel.pathToZip)) { model.localization = "default"; model.pathToZip = oldModel.pathToZip; } if (!string.IsNullOrEmpty(oldModel.vmpPath)) { model.localization = "default"; model.vmpPath = oldModel.vmpPath; } if (!File.Exists(appName)) { _logger.LogError($"Error opening Cortona, file doesn't exist: {appName}"); return; } external.ShowApp(appName, vnp, webRootPath, onAppExit); model.isOpened = 1; onAppStart(); File.WriteAllText(topicPath, JsonConvert.SerializeObject(model)); }