Commit 8690cc2e authored by Ghislain MARY's avatar Ghislain MARY

Changed the way the config file is installed because it was not reliable.

parent 339b0870
......@@ -231,7 +231,7 @@ namespace Linphone.Model
/// <summary>
/// Creates a new LinphoneCore (if not created yet) using a LinphoneCoreFactory.
/// </summary>
public void InitLinphoneCore()
public async void InitLinphoneCore()
{
if ((server.LinphoneCoreFactory != null) && (server.LinphoneCore != null))
{
......@@ -244,7 +244,7 @@ namespace Linphone.Model
}
Logger.Msg("[LinphoneManager] Creating LinphoneCore");
SettingsManager.InstallConfigFile();
await SettingsManager.InstallConfigFile();
LpConfig config = server.LinphoneCoreFactory.CreateLpConfig(SettingsManager.GetConfigPath(), SettingsManager.GetFactoryConfigPath());
ConfigureLogger();
server.LinphoneCoreFactory.CreateLinphoneCore(this, config);
......
......@@ -48,11 +48,24 @@ namespace Linphone.Model
/// <summary>
/// Install the default config file from the package to the Isolated Storage
/// </summary>
public static void InstallConfigFile()
public static async Task InstallConfigFile()
{
if (!File.Exists(GetConfigPath()))
StorageFile destFile = null;
try
{
File.Copy("Assets/linphonerc", GetConfigPath());
destFile = await StorageFile.GetFileFromPathAsync(GetConfigPath());
}
catch (System.IO.FileNotFoundException)
{
}
if (destFile == null)
{
StorageFile sourceFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/linphonerc"));
destFile = await sourceFile.CopyAsync(ApplicationData.Current.LocalFolder);
}
if (destFile != null)
{
System.Diagnostics.Debug.WriteLine("Config file successfully installed");
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment