Sourcetree installation has failed
Asked by Jessica Chen:

sourcetree.log

ERROR \[2023-07-17 09:24:03,493\] \[1\] \[SourceTree.App\] \[Log\] - "System.Windows.Automation.Peers.AutomationPeer"??????????????  
System.TypeInitializationException: "System.Windows.Automation.Peers.AutomationPeer"?????????????? ---\> System.TypeLoadException: ???"PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"????"MS.Internal.Automation.SelectionProviderWrapper"???"GetSelection"?????  
? System.Windows.Automation.Peers.AutomationPeer.Initialize()  
? System.Windows.Automation.Peers.AutomationPeer..cctor()  
--- ??????????? ---  
? System.Windows.Automation.Peers.AutomationPeer.RaiseFocusChangedEventHelper(IInputElement newFocus)  
? System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)  
? System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)  
? System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)  
? System.Windows.Input.KeyboardDevice.Focus(IInputElement element)  
? System.Windows.Interop.HwndKeyboardInputProvider.OnSetFocus(IntPtr hwnd)  
? System.Windows.Interop.HwndKeyboardInputProvider.FilterMessage(IntPtr hwnd, WindowMessage message, IntPtr wParam, IntPtr lParam, Boolean\& handled)  
? System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean\& handled)  
? MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean\& handled)  
? MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)  
? System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)  
? System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

I used Window 11 PC. I try to install both the Enterprise and User versions failed.


Answers:
author: Vipin Yadav
body: Hi [@Jessica Chen](/t5/user/viewprofilepage/user-id/5266998) , Please try to install as per following steps and this time try to install as an Administrator.

**\*\*\*IMPORTANT\*\*\*: Please note that reinstalling Sourcetree will remove all preferences and settings you may have. So, please ensure you** **backup the referenced folders/files below before proceeding** **.**

* Backup ALL**Sourcetree** folders and files (if any) located in **C:\\Users\\\<UserName\>\\AppData\\Local**
* Backup ALL**Sourcetree** folders and files (if any) located in **C:\\Users\\\<UserName\>\\AppData\\Local\\Atlassian**
* Backup ALL**Sourcetree** folders and files (if any) located in **C:\\Users\\\<UserName\>\\AppData\\Roaming\\Atlassian**

After backing up those folders and files, you can then proceed to uninstall and then reinstall Sourectree.

1. Uninstall Sourcetree using the Windows Uninstall program.
2. **Only delete the following folders/files after you have backed them up** . Delete the folders/files below before proceeding to the next step:
   * Navigate to **C:\\Users\\\<UserName\>\\AppData\\Local** and delete all **Sourcetree** folders and files (if any)
   * Navigate to **C:\\Users\\\<UserName\>\\AppData\\Local\\Atlassian** and delete all **Sourcetree** folders and files (if any)
   * Navigate to **C:\\Users\\\<UserName\>\\AppData\\Roaming\\Atlassian** and delete all **Sourcetree** folders and files (if any)

[Download Sourcetree for Windows](https://www.sourcetreeapp.com/) and install it.  

comments: author: Jessica Chen
body: [@Vipin Yadav](/t5/user/viewprofilepage/user-id/4426727) Thanks for the reply. I've followed the instructions above, but it doesn't work.

There is an error message in the SetUp log,  
*CheckForUpdateImpl: Couldn't write out staging user ID, this user probably shouldn't get beta anything: System.IO.DirectoryNotFoundException: ??????"**C:\\Users\\Administrator\\AppData\\Local\\SourceTree\\packages\\.betaId**"?????*  
*![packages.png](https://community.atlassian.com/t5/image/serverpage/image-id/271456i4810F6913E708B8C/image-size/large?v=v2&px=999 "packages.png")*  
Then I did not find the .betald file in the correspingding folder. Looking forward to your reply.


author: Ravi Kiran
body: Hi [@Jessica Chen](/t5/user/viewprofilepage/user-id/5266998) , can you help us which version of Windows OS you are using?


author: Vipin Yadav
body: Hi [@Jessica Chen](/t5/user/viewprofilepage/user-id/5266998) Please share the complete log file with us. Also Share the details of your Windows and which culture is used. Also meanwhile please try to clean the temp folder i.e. %temp%. and prefetch clean and restart machine.