コード例 #1
0
 public void Install(IProgramInstallationContext context)
 {
     if (File.Exists(context.ImagePath))
     {
         var file = File.ReadAllBytes(context.ImagePath);
         PackerHelper.UnpackProgram(file, context.ProgramInstallationDirectoryPath);
     }
 }
コード例 #2
0
        public void Install(IModuleInstallationContext context)
        {
            var pluginsDir = Path.Combine(context.InstalledProgramDirectoryPath, "Program", "Plugins", context.Name);

            if (!Directory.Exists(pluginsDir))
            {
                Directory.CreateDirectory(pluginsDir);
            }

            var file = File.ReadAllBytes(context.ImagePath);

            PackerHelper.UnpackModule(file, pluginsDir);
        }
コード例 #3
0
        public void Update(IProgramUpdateContext context)
        {
            var programPath = Path.Combine(context.InstalledProgramDirectoryPath, "Program");

            if (Directory.Exists(programPath))
            {
                Directory.Delete(programPath, true);
            }

            var starterPath = Path.Combine(context.InstalledProgramDirectoryPath, "Starter");

            if (Directory.Exists(starterPath))
            {
                Directory.Delete(starterPath, true);
            }

            if (File.Exists(context.ImagePath))
            {
                var file = File.ReadAllBytes(context.ImagePath);
                PackerHelper.UnpackProgram(file, context.InstalledProgramDirectoryPath);
            }
        }