internal static Type[] GetCustomStepTypes(InstallerAssemblyInfo _installerAssembly) { var asm = Assembly.LoadFrom(_installerAssembly.OriginalPath); var types = asm.GetCustomStepTypes(); return(types); }
internal static Type[] GetCustomStepTypes(InstallerAssemblyInfo _installerAssembly) { var asm = Assembly.LoadFrom(_installerAssembly.OriginalPath); var types = asm.GetCustomStepTypes(); return types; }
//============================================================= IUnpacker Members public IManifest[] Unpack(string fsPath) { Logger.LogMessage("Extract: " + fsPath); _installerAssembly = new InstallerAssemblyInfo(this, null) /* ResourceData = stream,*/ OriginalPath {
//============================================================= IUnpacker Members public IManifest[] Unpack(string fsPath) { Logger.LogMessage("Extract: " + fsPath); _installerAssembly = new InstallerAssemblyInfo(this, null) {/* ResourceData = stream,*/ OriginalPath = fsPath }; _reflectedAssembly = AssemblyHandler.ReflectionOnlyLoadInstallerAssembly(fsPath); bool installerOnlyAssembly = false; bool hasCustomSteps; foreach (var attr in _reflectedAssembly.GetAllAttributes(out hasCustomSteps)) { var meta = new Dictionary<string, CustomAttributeNamedArgument>(); foreach (var item in attr.NamedArguments) meta.Add(item.MemberInfo.Name, item); var attrName = attr.Constructor.DeclaringType.Name; switch (attrName) { case "InstallerOnlyAssemblyAttribute": installerOnlyAssembly = true; break; case "PackageDescriptionAttribute": _packageInfo = new PackageInfo(this, attr); break; //--------------------------------------------- case "RequiredPackageAttribute": _prerequisits.Add(new RequiredPackageStep(this, attr)); break; case "RequiredSenseNetVersionAttribute": _prerequisits.Add(new RequiredSenseNetVersionStep(this, attr)); break; //--------------------------------------------- case "InstallContentTypeAttribute": _contentTypes.Add(new ContentTypeInstallStep(this, attr)); break; case "InstallContentViewAttribute": _contentViews.Add(new ContentViewInstallStep(this, attr)); break; case "InstallPageTemplateAttribute": _pageTemplates.Add(new PageTemplateInstallStep(this, attr)); break; case "InstallResourceAttribute": _resources.Add(new ResourceInstallStep(this, attr)); break; case "InstallFileAttribute": _files.Add(new FileInstallStep(this, attr)); break; case "InstallContentAttribute": _contents.Add(new ContentInstallStep(this, attr)); break; case "InstallDatabaseScriptAttribute": _dbScripts.Add(new DbScriptInstallStep(this, attr)); break; default: continue; } } if (!installerOnlyAssembly) _executables.Add(new AssemblyInstallStep(this, null) { AssemblyPath = _installerAssembly.OriginalPath }); if (hasCustomSteps) CustomInstallStep.AddCustomStepTypes(AssemblyHandler.GetCustomStepTypes(_installerAssembly)); return new IManifest[] { this }; }