void SaveVersionFile(string path) { List <string> entries = new List <string>(); entries.Add(VERSION_KEY + ": " + DllUtils.Version()); File.WriteAllLines(path, entries.ToArray()); AssetDatabase.ImportAsset(ProjectUtil.MakePathRelativeToProject(path)); }
XcodeController() { var upgrader = new Upgrader(); upgrader.Upgrade(); _lastSaveDirectory = DllUtils.DllLocation(); _settings = new XcodeSettings(_lastSaveDirectory); _configurations = new XcodeConfigurations(_lastSaveDirectory); FindChangeFiles(); RefreshConfigurations(); }
bool UpgradeCheckRequired(Dictionary <string, string> dic) { //check to see if we have the version file if (dic == null) { return(true); } string version; if (dic.TryGetValue(VERSION_KEY, out version)) { return(DllUtils.IsNewer(version)); } //failed to verify it is the same version, so force a check return(true); }
public void Upgrade() { var path = Path.Combine(DllUtils.DllLocation(), VERSION_FILENAME); var versionDic = LoadVersionFile(path); if (!UpgradeCheckRequired(versionDic)) { return; } bool upgraded = false; //Do Upgrading here upgraded |= CheckSettingsForUpgrade(); upgraded |= CheckChangeFilesForUpgrade(); //End of upgrading SaveVersionFile(path); if (upgraded) { Debug.LogWarning("EgoXproject upgraded: Please check that everything is correct. The extension \".bak\" has been added to the old version of the upgraded files. They can be safely deleted."); } }