Artemis.DAL.ProfileProvider.InstallDefaults C# (CSharp) Method

InstallDefaults() private static method

Unpacks the default profiles into the profile directory
private static InstallDefaults ( ) : void
return void
        private static void InstallDefaults()
        {
            // Only install the defaults once per session
            if (_installedDefaults)
                return;
            _installedDefaults = true;

            // Load the ZIP from resources
            var stream = Assembly.GetExecutingAssembly()
                .GetManifestResourceStream("Artemis.Resources.Keyboards.default-profiles.zip");

            // Extract it over the old defaults in case one was updated
            if (stream == null)
                return;
            var archive = new ZipArchive(stream);
            archive.ExtractToDirectory(ProfileFolder, true);

            var demoProfiles = Profiles.Where(d => d.Name == "Demo (duplicate to keep changes)");
            InsertGif(demoProfiles, "GIF", Resources.demo_gif, "demo-gif");
        }