SourceTree Win10 安裝不成功解決過程記錄

簡介

SourceTree 是一款擁有可視化界面的項目版本控制軟件,適用於git項目管理,同時它集成了 git flow 工做流程,對於不熟悉 git 命令的初學者來講,能夠經過 SourceTree 快速學會使用 Git 和 git flow 來參與代碼版本管理和團隊協做開發。git

問題

今日在全新的一臺 win10 電腦上安裝 SourceTree (2.3.1.0) 時沒有安裝成功,也沒有任何錯誤提示,雙擊安裝文件後,出下下圖後,並未成功安裝。github

圖片描述

解決

通過 Google 後在 Stack Overflow 上發現這個問題: Source Tree doesn't launch after installationsegmentfault

Cause

The most likely reason for this error is that the user.config file for SourceTree has been corrupted. You can confirm this by locating the file in this location: C:Users<User>AppDataLocalAtlassianSourceTree.exe_<random_string><version_number>app

If this is the cause, when you open the file, it will be full of <NULL> values.dom

Resolution工具

If the user.config file is indeed corrupted, you may delete it. It will be regenerated the next time you start SourceTree, and the application should start normally.學習

看起來解決辦法就是刪除 C:\Users\<User>\AppData\Local\Atlassian\SourceTree.exe_<random_string>\<version_number> 下的 user.config 後從新安裝ui

按照上述辦法嘗試後發現仍然無效,因此只有另外想辦法。this

本身作過四年的 .NET 開發,跑到了C:\Users\<User>\AppData\Local\Atlassian\SourceTree 目錄下看了 sourcetree.log 日誌信息:spa

ERROR [2018-03-17 20:27:06,785] [3] [SourceTree.App] [.ctor] - finish EnsureSquirrelExecutionStubIsCopied
ERROR [2018-03-17 20:27:07,491] [4] [SourceTree.App] [OnStartup] - Failed to start
System.NullReferenceException: 未將對象引用設置到對象的實例。
   在 SourceTree.Notifications.NotificationsManager.SetOwner(NotificationDialogWindow notificationWindow)
   在 SourceTree.Notifications.NotificationsManager.ShowNotificationDialog[T](NotificationDialogWindow notificationWindow, Tuple`2 customAction, VistaTaskDialogIcon icon)
   在 SourceTree.Notifications.NotificationsManager.ShowNotificationDialog[T](String title, String message, Tuple`2 customAction, String cancelLabel, String suppressionSetting, Action`1 suppressionChangedAction, Object contentControl, String contentCommandLabel, Action contentAction)
   在 SourceTree.Notifications.NotificationsManager.ShowNotificationDialogWithYesConfirmation(String title, String message, String details)
   在 SourceTree.Configuration.WpfSpellCheckerPreFlightCheck.Run()
   在 SourceTree.AppRoot.RunPreFlightChecks()
   在 SourceTree.AppRoot.OnStartup(StartupEventArgs e)
   在 SourceTree.App.OnStartup(StartupEventArgs e)
哈哈,發現了 Wpf 的身影,本身還在 10 年左右用 WPF 開發過應用,很親切的感受。

既然是微軟系技術作的工具,確定是須要 .NET Framework 支持的,所以跑去微軟官網 https://www.microsoft.com/net... 從新安裝最新的 .net framework.

而後從新安裝 SourceTree 就恢復正常了。

資料

  1. 深刻理解學習Git工做流
  2. SourceTree 安裝過程和配置
  3. SourceTree 簡易 git flow 流程演示
相關文章
相關標籤/搜索