private void DoAdditionalInstallTasks() { if (!Directory.Exists(LocationFolder)) { Directory.CreateDirectory(LocationFolder); } UnInstallInfo.Save(); //copy icon file if (!string.IsNullOrEmpty(GeneralInfo.Params[ParamNamesConst.ICON].Value) && File.Exists(GeneralInfo.Params[ParamNamesConst.ICON].Value)) { File.Copy(GeneralInfo.Params[ParamNamesConst.ICON].Value, LocationFolder + "icon" + Path.GetExtension(GeneralInfo.Params[ParamNamesConst.ICON].Value), true); } //copy the package file string newlocation = LocationFolder + GeneralInfo.Id + ".mpe2"; if (newlocation.CompareTo(GeneralInfo.Location) != 0) { File.Copy(GeneralInfo.Location, newlocation, true); GeneralInfo.Location = newlocation; } MpeInstaller.InstalledExtensions.Add(this); MpeInstaller.KnownExtensions.Add(this); MpeInstaller.Save(); }
/// <summary> /// Start copy the package file based on group settings /// /// </summary> public void Install() { if (UnInstallInfo == null) { UnInstallInfo = new UnInstallInfoCollection(this); } else { UnInstallInfo.SetInfo(this); } foreach (GroupItem groupItem in Groups.Items) { if (groupItem.Checked) { foreach (FileItem fileItem in groupItem.Files.Items) { MpeInstaller.InstallerTypeProviders[fileItem.InstallType].Install(this, fileItem); if (FileInstalled != null) { FileInstalled(this, new InstallEventArgs(groupItem, fileItem)); } } } } }
private void DoAdditionalUnInstallTasks() { if (!Directory.Exists(LocationFolder)) Directory.CreateDirectory(LocationFolder); UnInstallInfo.Save(); MpeInstaller.InstalledExtensions.Remove(this); MpeInstaller.Save(); }