How do I specify a directory for the MSI install that has a space in it?

Angel Velasquez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 25, 2024

Hello,


I need to set up a silent install config for SourceTree Enterprise and I'm currently attempting to use this as my install command:

msiexec.exe /i SourcetreeEnterpriseSetup_3.4.18.msi ACCEPTEULA=1 INSTALLDIR="C:\Program Files\SourceTree" /quiet

This didn't work but I found out that it will work if I remove the space in "Program Files" I thought having the directory path in a string would make it treat it as a string instead of a literal. My command gets treated as

 

 

 

msiexec.exe /i SourcetreeEnterpriseSetup_3.4.18.msi ACCEPTEULA=1 INSTALLDIR=C:\Program Files\SourceTree /quiet

 

Where Files\SourceTree is treated as a MSI flag and crashes the install. How can I include a space for the silent install within the INSTALLDIR flag? I double checked and it does work when I do not have a space but I have to install it to Program Files given the circumstances.

1 answer

1 accepted

1 vote
Answer accepted
Jim Knepley - ReleaseTEAM
Atlassian Partner
September 25, 2024

The escape character in PowerShell is the grave-accent(`), so try this:

msiexec.exe /i SourcetreeEnterpriseSetup_3.4.18.msi ACCEPTEULA=1 INSTALLDIR=`"C:\Program Files\SourceTree`" /quiet

 

ref: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-7.4

Angel Velasquez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 26, 2024

Thank you!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events