views:

234

answers:

2

I have an msi file that I am trying to install in a place other than C:\Program Files.

The directory table shows that ProgramFilesFolder is used as the default install directory. From reading this blog post I understand that ProgramFilesFolder is a standard directory so passing TARGETDIR as a property to the installer will not change the install location even through the directory table has it as the parent of ProgramFilesFolder.

How can I override the install location? I am a total novice in this area.

A: 

Have you tried passing TARGETDIR on the command line?

msiexec /i yourpackage.msi TARGETDIR="C:\Foo"

If the above fails, don't know if it could help in this instance, but I've used a tool to edit MSI files before, it was called Orca, maybe you can use it to overwrite some of the MSI settings?

Another possibility maybe would be to figure out what registry entry MSIs use to find out what the ProgramFiles folder resolves to, and change that entry before you run your MSI, then change it back.

JRL
Yes I have tried passing TARGETDIR with no effect. I have used Orca to look at the Directory table in the MSI and editing could be a possibility though it is a 3rd party MSI and I am worried that my edits may break something. I hadn't thought about changing the registry so may have a look at that.
Mark
A: 

First, try setting INSTALLDIR to whatever folder you want.

If that doesn't seem to do anything, then it's time to have a look at the component table and see what the Directory_ values are for those records.

Ed

related questions