// // CheckForUpdate methods // void initializeClientAppDirectory() { // On bootstrap, we won't have any of our directories, create them var pkgDir = Path.Combine(rootAppDirectory, "packages"); if (fileSystem.GetDirectoryInfo(pkgDir).Exists) { fileSystem.DeleteDirectoryRecursive(pkgDir); } fileSystem.CreateDirectoryRecursive(pkgDir); }
string installAppVersion(IAppSetup app, Version newCurrentVersion, IEnumerable <ShortcutCreationRequest> shortcutRequestsToIgnore, bool isFirstInstall) { try { if (isFirstInstall) { log.Info("installAppVersion: Doing first install for {0}", app.Target); app.OnAppInstall(); } log.Info("installAppVersion: Doing install for version {0} {1}", newCurrentVersion, app.Target); app.OnVersionInstalled(newCurrentVersion); } catch (Exception ex) { log.ErrorException("App threw exception on install: " + app.GetType().FullName, ex); throw; } var shortcutList = Enumerable.Empty <ShortcutCreationRequest>(); try { shortcutList = app.GetAppShortcutList(); shortcutList.ForEach(x => log.Info("installAppVersion: we have a shortcut {0}", x.TargetPath)); } catch (Exception ex) { log.ErrorException("App threw exception on shortcut uninstall: " + app.GetType().FullName, ex); throw; } shortcutList .Where(x => !shortcutRequestsToIgnore.Contains(x)) .ForEach(x => { var shortcut = x.GetLinkTarget(applicationName, true); var fi = fileSystem.GetFileInfo(shortcut); log.Info("installAppVersion: checking shortcut {0}", fi.FullName); if (fi.Exists) { log.Info("installAppVersion: deleting existing file"); fi.Delete(); } fileSystem.CreateDirectoryRecursive(fi.Directory.FullName); var sl = new ShellLink { Target = x.TargetPath, IconPath = x.IconLibrary, IconIndex = x.IconIndex, Arguments = x.Arguments, WorkingDirectory = x.WorkingDirectory, Description = x.Description, }; sl.Save(shortcut); }); return(app.LaunchOnSetup ? app.Target : null); }