Set IndexFileName (Provisioning Profiles.index) based on the current OS platform

For Windows, the file was stored on the Documents folder and we don't store anything in there but in %LocalAppData%\Xamarin
This commit is contained in:
Mauro Agnoletti 2020-08-14 13:19:37 -03:00
Родитель 8208733cd6
Коммит 7ea8326509
1 изменённых файлов: 18 добавлений и 2 удалений

Просмотреть файл

@ -33,7 +33,7 @@ namespace Xamarin.MacDev
{
public class MobileProvisionIndex
{
static readonly string IndexFileName = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "Library", "Xamarin", "Provisioning Profiles.index");
static readonly string IndexFileName;
static readonly MobileProvisionCreationDateComparer CreationDateComparer = new MobileProvisionCreationDateComparer ();
const int IndexVersion = 1;
@ -193,6 +193,22 @@ namespace Xamarin.MacDev
public DateTime LastModified { get; private set; }
public int Version { get; private set; }
static MobileProvisionIndex()
{
string xamarinFolder;
if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX)
{
xamarinFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "Library", "Xamarin");
}
else
{
xamarinFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Xamarin", "iOS", "Provisioning");
}
IndexFileName = Path.Combine(xamarinFolder, "Provisioning Profiles.index");
}
MobileProvisionIndex ()
{
ProvisioningProfiles = new List<ProvisioningProfile> ();