From 509b3f316b29d6b5ee61752b91e9015c5c6e8623 Mon Sep 17 00:00:00 2001 From: Alexey 'Cluster' Avdyukhin Date: Fri, 23 Feb 2018 17:05:59 +0300 Subject: Release, v2.30 --- Program.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Program.cs') diff --git a/Program.cs b/Program.cs index e788fd3d..e804ff73 100644 --- a/Program.cs +++ b/Program.cs @@ -79,6 +79,7 @@ namespace com.clusterrr.hakchi_gui if (createdNew) { BaseDirectoryInternal = Path.GetDirectoryName(Application.ExecutablePath); +#if CLICKONCE if (ApplicationDeployment.IsNetworkDeployed) { // This is not correct way for Windows 7+... @@ -96,6 +97,7 @@ namespace com.clusterrr.hakchi_gui } } else +#endif BaseDirectoryExternal = BaseDirectoryInternal; Debug.WriteLine("Base directory: " + BaseDirectoryExternal); ConfigIni.Load(); @@ -108,15 +110,17 @@ namespace com.clusterrr.hakchi_gui // There are some folders which should be accessed by user // Moving them to "My documents" +#if CLICKONCE if (ApplicationDeployment.IsNetworkDeployed && ApplicationDeployment.CurrentDeployment.IsFirstRun) { var externalDirs = new string[] - { - "art", "folder_images", "patches", "user_mods" - }; + { + "art", "folder_images", "patches", "user_mods" + }; foreach (var dir in externalDirs) DirectoryCopy(Path.Combine(BaseDirectoryInternal, dir), Path.Combine(BaseDirectoryExternal, dir), true); } +#endif string languagesDirectory = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "languages"); const string langFileNames = "hakchi.resources.dll"; @@ -128,6 +132,7 @@ namespace com.clusterrr.hakchi_gui { var dir = Path.GetDirectoryName(d); Debug.WriteLine("Removing old directory: " + dir); +#if CLICKONCE if (ApplicationDeployment.IsNetworkDeployed) { var targetDir = Path.Combine(languagesDirectory, Path.GetFileName(dir)); @@ -138,6 +143,7 @@ namespace com.clusterrr.hakchi_gui File.Move(Path.Combine(dir, langFileNames), targetFile); } else +#endif Directory.Delete(dir, true); } -- cgit v1.2.3