diff options
Diffstat (limited to 'Program.cs')
-rw-r--r-- | Program.cs | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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);
}
|