private async void InitSettings()
        {
            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;

            if ((localSettings.Values["allowCompress"] != null) && (localSettings.Values["allowCompress"].GetType() == typeof(bool)))
            {
                App.AllowCompress = (bool)localSettings.Values["allowCompress"];
            }
            else
            {
                localSettings.Values["allowCompress"] = App.AllowCompress;
            }

            if ((localSettings.Values["loadAppsEveryTime"] != null) && (localSettings.Values["loadAppsEveryTime"].GetType() == typeof(bool)))
            {
                loadAppsList = (bool)localSettings.Values["loadAppsEveryTime"];
            }
            else
            {
                localSettings.Values["loadAppsEveryTime"] = true;
            }

            if ((localSettings.Values["hiddenMode"] != null) && (localSettings.Values["hiddenMode"].GetType() == typeof(bool)))
            {
                App.hiddenMode = (bool)localSettings.Values["hiddenMode"];
            }
            else
            {
                localSettings.Values["hiddenMode"] = false;
                App.hiddenMode = false;
            }

            if ((localSettings.Values["backupDest"] != null) && (localSettings.Values["backupDest"].GetType() == typeof(string)))
            {
                App.BackupDestination = (string)localSettings.Values["backupDest"];
            }
            else
            {
                localSettings.Values["backupDest"] = App.BackupDestination;
            }

            await FileOperations.CreateDirectoryIfNotExists(App.BackupDestination);
        }
        public async Task CreateBackup(List <AppData> apps, string name)
        {
            log = new List <ArchiverError>();
            familyToDisplayNames = new Dictionary <string, string>();
            string backupPath         = System.IO.Path.Combine(App.BackupDestination, name);
            string packagesBackupPath = System.IO.Path.Combine(backupPath, "Packages");
            await FileOperations.CreateDirectoryIfNotExists(backupPath);

            List <StorageFolder> sources = new List <StorageFolder>();

            totalFiles = 0;
            for (int i = 0; i < apps.Count; i++)
            {
                var           item = apps[i];
                StorageFolder fol  = await StorageFolder.GetFolderFromPathAsync(item.PackageDataFolder);

                OnBackupProgress(new BackupEventArgs(-1, BackupState.Initializing, item.DisplayName + ": Looking for files...", apps.Count == 1 ? "" : ((i + 1).ToString() + " / " + apps.Count), log));
                totalFiles += await FileOperations.FolderContentsCount(fol);

                sources.Add(fol);

                familyToDisplayNames.Add(item.FamilyName, item.DisplayName);
            }

            OnBackupProgress(new BackupEventArgs(0, BackupState.Compressing, "Copying...", "", log));
            await CreateZip(sources, System.IO.Path.Combine(backupPath, "data.zip"), App.AllowCompress?System.IO.Compression.CompressionLevel.Optimal : System.IO.Compression.CompressionLevel.NoCompression);

            OnBackupProgress(new BackupEventArgs(100.0, BackupState.WritingMetadata, "Creating metadata...", "", log));

            Backup currentBackup = new Backup(name, Backup.GenerateAppSubtitle(apps));

            currentBackup.SetDeviceInfo();
            foreach (var item in apps)
            {
                currentBackup.Apps.Add(new CompactAppData(item));
            }

            await WriteMetaData(currentBackup, System.IO.Path.Combine(backupPath, "metadata.json"));

            OnBackupProgress(new BackupEventArgs(100.0, BackupState.Finished, "Finalizing...", totalFiles.ToString() + " / " + totalFiles.ToString(), log));

            currentBackups.Add(currentBackup);
        }