View Full Version : Runtime change of Feature/Component destination

07-28-2005, 09:30 AM
Here's my challenge: In my MSI project, I had set up a feature with a destination set to be a folder underneath INSTALLDIR (in the Directory table, its called NEOTOOL). I have modified OnBegin to seek out an INI file and reset the default value I had for INSTALLDIR. Everything was fine and wonderful and working until I was told that this folder (let's call it NeoTool) now needs to sit at the same level as INSTALLDIR. In other words, if INSTALLDIR resolves to D:\MyProduct, the destination for my component should be D:\NeoTool, not D:\MyProduct\NeoTool.

I did some digging and tried to use MSISetTargetPath to update the NEOTOOL entry in the Directory table, but I keep getting an ERROR_DIRECTORY code returned back (which according to help means that there is no corresponding entry in the Directory table. I visually verified (and had someone else look as well) that there is a NEOTOOL entry in the Directory table.

I also tried writing a custom action type 35 to update the directory path, but couldn't figure out a syntax to correctly change the directory.

What am I doing wrong?