New component and folder on MINOR upgrade
Posted 16 March 2005 - 19:04
I think I might have found a bug - the issue is that if I install the first time to a directory other than the default (C:\Progam files\myapp), on minor upgrade the new component (and the new directory) is installed to the default directory, NOT the same directory where the feature is deployed. If I add new components to the same feature but select an existing directory path, the new file is deployed properly to the non-default location. It's just when selecting a new directory destination that the file (and folder) get deployed to the default INSTALLDIR directory on minor upgrade.
I checked msi logfiles and it shows the new component association with the feature - (business_layer), then does a directory dump and sees that BIN components have a different path than the default but doesn't set XML (the new directory table key) to have the new path - any ideas of what I can do here? Appreciate your input.
MSI (s) (E8:30): SELMGR: New components have been added to feature 'Business_Layer'
MSI (s) (E8:30): SELMGR: Component 'xml' is a new component added to feature 'Business_Layer'
MSI (s) (E8:30): Target path resolution complete. Dumping Directory table...
MSI (s) (E8:30): Dir (target): Key: XML , Object: C:\Program Files\myapp\xml\
MSI (s) (E8:30): Dir (target): Key: BIN , Object: D:\myapp\bin\
Posted 16 March 2005 - 22:36
MSI (s) (DC:E8): Skipping action: SetARPINSTALLLOCATION (condition is false)
which is right because the condition is (not installed) and this is a minor upgrade. Why is the key being overwritten?
Posted 21 March 2005 - 22:24
Posted 22 March 2005 - 18:19
Posted 22 March 2005 - 18:27
If you were going to suggest that I use MsiGetComponentPath in the resumeui before event on minor upgrade to get the path, I thought of that, only that particular function is not declared and available with installscript/msi projects.
Do you have any advice as to how we can get the path, particularly since the InstallLocation path is reset to en empty string on the first minor upgrade?
Posted 22 March 2005 - 18:33
[$ComponentName] should give you the install directory, you could use this in a custom action to set INSTALLDIR (I think, didn't try)
Posted 22 March 2005 - 20:51
In this instance I may attempt to get the path from INSTALL_LOCATION property and if empty prompt the user for the path in the resumeui event, validate by if existsdir or file (something we expect to find at that location) and then set INSTALLDIR. This should be a onetime event as setting installdir will set the registry key value properly from that point forward.
Thanks for your advise Stefan.