SourceTree Win10 安装不成功解决过程记录

简单心理 2018-04-04

简介

SourceTree 是一款拥有可视化界面的项目版本控制软件,适用于git项目管理,同时它集成了 git flow 工作流程,对于不熟悉 git 命令的初学者来说,可以通过 SourceTree 快速学会使用 Git 和 git flow 来参与代码版本管理和团队协作开发。

问题

今日在全新的一台 win10 电脑上安装 SourceTree (2.3.1.0) 时没有安装成功,也没有任何错误提示,双击安装文件后,出下下图后,并未成功安装。

SourceTree Win10 安装不成功解决过程记录

解决

经过 Google 后在 Stack Overflow 上发现这个问题:Source Tree doesn't launch after installation

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>

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

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后重新安装

按照上述办法尝试后发现仍然无效,所以只有另外想办法。

自己做过四年的 .NET 开发,跑到了C:\Users\<User>\AppData\Local\Atlassian\SourceTree目录下看了sourcetree.log日志信息:

<strong>ERROR</strong> [2018-03-17 20:27:06,785] [3] [SourceTree.App] [.ctor] - <strong>finish </strong><strong>EnsureSquirrelExecutionStubIsCopied</strong>
<strong>ERROR</strong> [2018-03-17 20:27:07,491] [4] [SourceTree.App] [OnStartup] - <strong>Failed </strong><strong>to </strong><strong>start</strong>
System.NullReferenceException: 未将对象引用设置到对象的实例。
   在 <strong>SourceTree</strong>.Notifications.NotificationsManager.SetOwner(<strong>NotificationDialogWindow </strong><strong>notificationWindow</strong>)
   在 <strong>SourceTree</strong>.Notifications.NotificationsManager.ShowNotificationDialog[T](<strong>NotificationDialogWindow </strong><strong>notificationWindow, </strong><strong>Tuple`2 </strong><strong>customAction, </strong><strong>VistaTaskDialogIcon </strong><strong>icon</strong>)
   在 <strong>SourceTree</strong>.Notifications.NotificationsManager.ShowNotificationDialog[T](<strong>String </strong><strong>title, </strong><strong>String </strong><strong>message, </strong><strong>Tuple`2 </strong><strong>customAction, </strong><strong>String </strong><strong>cancelLabel, </strong><strong>String </strong><strong>suppressionSetting, </strong><strong>Action`1 </strong><strong>suppressionChangedAction, </strong><strong>Object </strong><strong>contentControl, </strong><strong>String </strong><strong>contentCommandLabel, </strong><strong>Action </strong><strong>contentActi</strong>on)
   在 <strong>SourceTree</strong>.Notifications.NotificationsManager.ShowNotificationDialogWithYesConfirmation(<strong>String </strong><strong>title, </strong><strong>String </strong><strong>message, </strong><strong>String </strong><strong>details</strong>)
   在 <strong>SourceTree</strong>.Configuration.WpfSpellCheckerPreFlightCheck.Run()
   在 <strong>SourceTree</strong>.AppRoot.RunPreFlightChecks()
   在 <strong>SourceTree</strong>.AppRoot.OnStartup(<strong>StartupEventArgs </strong><strong>e</strong>)
   在 <strong>SourceTree</strong>.App.OnStartup(<strong>StartupEventArgs </strong><strong>e</strong>)
哈哈,发现了Wpf的身影,自己还在 10 年左右用 WPF 开发过应用,很亲切的感觉。

既然是微软系技术做的工具,肯定是需要 .NET Framework 支持的,因此跑去微软官网https://www.microsoft.com/net...重新安装最新的 .net framework.

然后重新安装 SourceTree 就恢复正常了。

相关推荐