public bool Save(string path, bool isFileName) { CheckPackageVisitor visitor = new CheckPackageVisitor(_body); _body.Command.Visit(visitor); visitor.CollectInfo(); if (!visitor.IsCorrect) { Errors = visitor.Errors; return(false); } ProcessIncludedFiles(_body.Command); string xmlFilePath = Path.GetTempFileName(); GinSerializer.Serialize(_body, xmlFilePath); _content.AddBody(xmlFilePath); string packageFilePath = isFileName ? path : Path.Combine(path, PACKAGE_DEFAULT_FILENAME); _content.Save(packageFilePath, _body.IncludedPath); OnSavedHandler(); return(true); }
private void SaveCurrentPackageData() { string userName = "******"; if (WindowsIdentity.GetCurrent() != null) { userName = WindowsIdentity.GetCurrent().Name; } var instParameters = _context.GetInstallationParameters(); PackageData data = new PackageData() { InstallationDate = DateTime.Now, InstallationUserName = userName, InstallationParameters = instParameters }; GinSerializer.Serialize(data, PackageDataFile); SoftwareData dataSoftware = new SoftwareData() { InstallationParameters = instParameters }; GinSerializer.Serialize(dataSoftware, SoftwareDataFile); }