Permalink
Browse files

Additional installer fixes

  • Loading branch information...
lmontoute committed Jan 9, 2019
1 parent db6a218 commit 18c74341b7c44d7cc7efa9e105de129b8425764a
Showing with 17 additions and 4 deletions.
  1. +17 −4 Install/FluvioFXInstall.cs
@@ -126,7 +126,10 @@ private static void Install(bool force = false)
return;
}

if (InternalEditorUtility.inBatchMode ||
var inBatchMode = InternalEditorUtility.inBatchMode;
var hasKey = EditorPrefs.HasKey("FluvioFXInstall");
var showDialog = !hasKey && !inBatchMode;
if (!showDialog ||
EditorUtility.DisplayDialog(
"FluvioFX Install",
"FluvioFX installation requires some minor changes to " +
@@ -151,10 +154,17 @@ private static void Install(bool force = false)
SaveReadOnlyFile(integrationFilePath, integrationFile);
SaveReadOnlyFile($"{integrationFilePath}.meta", integrationFileMeta);

Debug.Log("FluvioFX install successful!");

// Add scripting define
SetDefine(true);

// Set editor prefs
if (!inBatchMode && !hasKey)
{
Debug.Log("FluvioFX install successful!");
EditorPrefs.SetBool("FluvioFXInstall", true);
}

// Refresh
AssetDatabase.Refresh();
}
catch (Exception ex)
@@ -212,7 +222,10 @@ private static void SaveReadOnlyFile(string path, string text)
{
path = path.Replace("\\", "/");

File.SetAttributes(path, FileAttributes.Normal);
if (File.Exists(path))
{
File.SetAttributes(path, FileAttributes.Normal);
}
File.WriteAllText(path, text);
File.SetAttributes(path, FileAttributes.ReadOnly);
}

0 comments on commit 18c7434

Please sign in to comment.