Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Deploy SourceTree Enterprise

Hey there,


I am trying to integrate SourceTree into our software deployment cycle and encountered a problem with the current way the SourceTree installer is working.

We are deploying software via a window service that is run as the user "system".

It is not possible for us to install via a system user. The deployment works when it is run as a local user of the machine. 

I think it might be connect to the fact that enviroment variables are not resolved and in turn the installer cannot be unpacked. Sadly the flag "INSTALLDIR" does not resolve the problem for us. 

The second thing that I noticed is that the installer does not return an appropriate %errorlevel%. It always returns "0" and signals that the install was successful.


Hope somebody can help us with that.



1 answer

0 votes
minnsey Atlassian Team Oct 22, 2018


I'm assuming you are using the MSI version of the installer? Can you provide some more details on how you are running it.

I'm guessing overall its because it is trying to install to the c:\program files (x86) folder but the system user isn't a local admin? Hence you are trying to over ride that path using INSTALLDIR?

Thanks for replying

Yes I am using the MSI installer. I am running it as part of a script through msiexec. The user "system" is part of the operating system as explained here. I tried overwriting it because it did not automatically switched it to a useful path. It used the appdata path of system which is "C:\Windows\System32\config\systemprofile\AppData\"



minnsey Atlassian Team Oct 25, 2018


What error do you get? If you run as Admin on a workstation directly,. with your preferred params does it all work?

Hey Michael

Yes the installer does work when run with a normal user that has admin privileges (e.g my user and the Administrator user).

But in my circumstance it is not possible to run the script through another user

minnsey Atlassian Team Nov 07, 2018


I can't suggest a quick fix, but if you can provide some additional context, why you have to use the user, the restrictions it has etc, we can investigate. We do not use SCCM-like tools directly so there may well be some limitations we are not aware of.


Here is some context:

We are using a software called WPKG to deploy software. It is basicly an service that calls a .js file which is on a network share. To not go into detail: This in turn runs commands that are specified on that share (such as msiexec [...]). As per default windows services are run with the local system account. So each following command is executed as system aswell.  

If requested I can hand over a verbose log file. I don't want to post ist here as it is quiet large and contains private information.

Okay I found the problem but for me it does not make a lot of sense:

As specified in the INSTALLDIR global flag it does try to install to "C:\Program Files\Sourcetree". The folder does not exist bevor trying to install it. 

The installer throws an Error (This can only be found in the verbose log of the msiexec itself)  "Error 1303: The installer has insufficient privileges to access this directory"

This comes from the SYSTEM user missing in the NTFS permissions. This should not happen because the script is run in an elevated context so the user is able to write there anyway.

My solution for now is manually creating the appropriate folder and adding the user to the NTFS permissions. After doing that the install will run successfully. 

This should be fixed imo. It is the first msi package which does throw this error.



minnsey Atlassian Team Jan 09, 2019


I've just created to track this.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

7,219 views 5 14
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you