Variable to create custom installation directory for an MSI? Help!

net1994 21 Reputation points
2022-04-06T23:42:21.04+00:00

Hi All – I’ve done installations using MSI installers in the past where I specify a custom installation directory. For a new MSI, I wanted to install the software in a custom directory. So instead of something like: “C:\Program Files x86)\DefaultFolder”, I want to have it set to: “C:\Program Files x86)\This-Program-Custom-Folder”. I’ve used soooo many different possible variables to get what I need. All failed. The below are examples of what I’ve tried:

Msiexec.exe /i “RandomProgram.msi” INSTALLFOLDER=” C:\Program Files (x86)\This-Program-Custom-Folder”

Msiexec.exe /i “RandomProgram.msi” TARGETDIR=” C:\Program Files (x86)\This-Program-Custom-Folder”

Msiexec.exe /i “RandomProgram.msi” INSTALLLOCATION=” C:\Program Files (x86)\This-Program-Custom-Folder”

Msiexec.exe /i “RandomProgram.msi” INSTALLDIR=” C:\Program Files (x86)\This-Program-Custom-Folder”

I contacted the vendor, and they state there are no additional install switches unique that would cause this problem. It seems like Windows is being ‘difficult.’ Can anyone see where the above might be causing the issue?

Thanks!

Windows for business Windows Server User experience Other
Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,916 Reputation points
    2022-04-13T14:43:52.03+00:00

    Hi Net1994-3452,

    Use INSTALLLOCATION. When you have problems, use the /lv log.txt to dump verbose logs. The logs would tell you if there is a property change that would override your own options. If you already installed the product, then a second run might just update it without changing the install location. You will have to uninstall first (use the /x option).

    Msiexec.exe /i “RandomProgram.msi” INSTALLLOCATION=” C:\Program Files (x86)\This-Program-Custom-Folder” /lv log.txt

    I hope this answers your question.


    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.