示例#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 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);
            }
        }