public IEnumerable<string> RunAppSetupInstallers(PostInstallInfo info) { var appSetups = default(IEnumerable<IAppSetup>); try { appSetups = findAppSetupsToRun(info.NewAppDirectoryRoot); } catch (UnauthorizedAccessException ex) { log.ErrorException("Failed to load IAppSetups in post-install due to access denied", ex); return new string[0]; } ResolveEventHandler resolveAssembly = (obj, args) => { var directory = fileSystem.GetDirectoryInfo(info.NewAppDirectoryRoot); return tryResolveAssembly(directory, args); }; AppDomain.CurrentDomain.AssemblyResolve += resolveAssembly; var results = appSetups .Select(app => installAppVersion(app, info.NewCurrentVersion, info.ShortcutRequestsToIgnore, info.IsFirstInstall)) .Where(x => x != null) .ToArray(); AppDomain.CurrentDomain.AssemblyResolve -= resolveAssembly; return results; }
public IEnumerable <string> RunAppSetupInstallers(PostInstallInfo info) { var appSetups = default(IEnumerable <IAppSetup>); try { appSetups = findAppSetupsToRun(info.NewAppDirectoryRoot); } catch (UnauthorizedAccessException ex) { log.ErrorException("Failed to load IAppSetups in post-install due to access denied", ex); return(new string[0]); } ResolveEventHandler resolveAssembly = (obj, args) => { var directory = fileSystem.GetDirectoryInfo(info.NewAppDirectoryRoot); return(tryResolveAssembly(directory, args)); }; AppDomain.CurrentDomain.AssemblyResolve += resolveAssembly; var results = appSetups .Select(app => installAppVersion(app, info.NewCurrentVersion, info.ShortcutRequestsToIgnore, info.IsFirstInstall)) .Where(x => x != null) .ToArray(); AppDomain.CurrentDomain.AssemblyResolve -= resolveAssembly; return(results); }
List <string> runPostInstallOnDirectory(string newAppDirectoryRoot, bool isFirstInstall, Version newCurrentVersion, IEnumerable <ShortcutCreationRequest> shortcutRequestsToIgnore) { var postInstallInfo = new PostInstallInfo { NewAppDirectoryRoot = newAppDirectoryRoot, IsFirstInstall = isFirstInstall, NewCurrentVersion = newCurrentVersion, ShortcutRequestsToIgnore = shortcutRequestsToIgnore.ToArray() }; var installerHooks = new InstallerHookOperations(fileSystem, applicationName); return(AppDomainHelper.ExecuteInNewAppDomain(postInstallInfo, installerHooks.RunAppSetupInstallers).ToList()); }
List<string> runPostInstallOnDirectory(string newAppDirectoryRoot, bool isFirstInstall, Version newCurrentVersion, IEnumerable<ShortcutCreationRequest> shortcutRequestsToIgnore) { var postInstallInfo = new PostInstallInfo { NewAppDirectoryRoot = newAppDirectoryRoot, IsFirstInstall = isFirstInstall, NewCurrentVersion = newCurrentVersion, ShortcutRequestsToIgnore = shortcutRequestsToIgnore.ToArray() }; var installerHooks = new InstallerHookOperations(fileSystem, applicationName); return AppDomainHelper.ExecuteInNewAppDomain(postInstallInfo, installerHooks.RunAppSetupInstallers).ToList(); }