SourceTree 2.1.2.5 will not launch on windows 7
Asked by jonas_nasc:

I have been using SourceTree for a while and suddently it will not launch anymore. I have tried to uninstall and install the newest version SourceTree 2.1.2.5 but I got an error during the install. Looking though the SquirrelSetup log it seems the program got installed and the installer crashed when trying to create shortcuts.

When I try to run SourceTree it seems like nothing happens and in the SourceTree log i get the following error messsage:

```
ERROR [2017-07-10 15:34:32,022] [1] [SourceTree.App] [OnStartup] - Failed to startSystem.TypeInitializationException: The type initializer for 'MS.Win32.Penimc.UnsafeNativeMethods' threw an exception. ---> System.Runtime.InteropServices.COMException: Error in the DLL (Exception from HRESULT: 0x800401F9 (CO_E_ERRORINDLL))at MS.Win32.Penimc.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)at MS.Win32.Penimc.UnsafeNativeMethods.CreatePimcManager()at MS.Win32.Penimc.UnsafeNativeMethods..cctor()--- End of inner exception stack trace ---at MS.Win32.Penimc.UnsafeNativeMethods.CreateResetEvent(IntPtr& handle)at System.Windows.Input.PenThreadWorker..ctor()at System.Windows.Input.PenThreadPool.GetPenThreadForPenContextHelper(PenContext penContext)at System.Windows.Input.StylusWisp.WispTabletDeviceCollection.UpdateTabletsImpl()at System.Windows.Input.StylusWisp.WispTabletDeviceCollection.UpdateTablets()at System.Windows.Input.StylusWisp.WispTabletDeviceCollection..ctor()at System.Windows.Input.StylusWisp.WispLogic.get_WispTabletDevices()at System.Windows.Input.StylusWisp.WispLogic.RegisterHwndForInput(InputManager inputManager, PresentationSource inputSource)at System.Windows.Interop.HwndStylusInputProvider..ctor(HwndSource source)at System.Windows.Interop.HwndSource.Initialize(HwndSourceParameters parameters)at System.Windows.Window.CreateSourceWindow(Boolean duringShow)at System.Windows.Window.ShowHelper(Object booleanBox)at System.Windows.Window.ShowDialog()at SourceTree.Utils.GeneralHelper.DownloadFile(String url, String destLocation, IInteractionsManager interactionsManager, IWebManager webManager, IDispatcher dispatcher, IRepoProcessFactory repoProcessFactory, INotificationsManager notificationsManager, String extractLocation)at SourceTree.Download.DefaultDownloadManager.DownloadFile(String url, String downloadDestination, String extractionDestination)at SourceTree.Dvcss.Extensions.CustomGcmExtension.DownloadAndInstall(IDvcs dvcs)at SourceTree.AppRoot.RunPreFlightChecks()at SourceTree.AppRoot.OnStartup(StartupEventArgs e)at SourceTree.App.OnStartup(StartupEventArgs e)
```

I have tried repairing .Net framework adn uninstalling SourceTree and removing C:\\Users\\%USERNAME%\\AppData\\Local\\SourceTree, C:\\Users\\%USER%\\AppData\\Local\\SourceTree and C:\\Users\\%USERNAME%\\AppData\\Local\\Atlassian


Answers:
author: strange17
body: Is this related to the following (.NET 4.7)?

<https://stackoverflow.com/questions/44580055/wpf-comexception-crashes-application-at-startup-started-today>

comments: author: Carmine Tambascia
body: I checked and did not have any Net 4.7 installed, though a last installion of a 4.6 istalled right first this problem with ST happened(and I did have another one for a specific language, Italian). I did delete that last update, deinstalled ST, reinstalled it, and though this time I did have the icon in the desktop that was right, it still hanging in lunch.

Really without clue,but quite I think it has to do with Windows Update.

Indeed there is a problem with version numeration and when I download the last version in this list(the one relased in August) it is been download the previous one(that has an higher number):

<https://www.sourcetreeapp.com/download-archives>


author: Carmine Tambascia
body: It seems solved now:

After have read [this](https://community.atlassian.com/t5/SourceTree-questions/Version-2-1-2-5-Crash-on-Windows-1703-Build-15063-413/qaq-p/601720) and followed first set of instructions on the page linked about WMI, and again have installed last Version of ST from the download archives page(but the 2.1.10.0 version) after checked this folder  
C:\\Users\\"YourFolderName\\AppData\\Local\\SourceTree, lunching exe, finally  
opened the GUI and I was promnted to choose between one of my repository.  

So configuration have been keeped(even if I disinstalled several times). It  
looks it's been solved. Not sure what actualy was the problem,but as said i  
believe is some version number mismatch. Indeed now in ST folder I can see  
app-2.1.10 as folder, previousily once the problem happended I could see  
2.1.2.5 that is cronologically an older version but numerically higher.

<https://community.atlassian.com/t5/SourceTree-questions/Version-2-1-2-5->  
Crash-on-Windows-1703-Build-15063-413/qaq-p/601720


Tags: windows