Changing the install dir of a feature
I have 2 features in my software. I would like to be able to change the install dir of one of the feature before installing the component without letting the user know.
Is it possible to do this on the fly? As i will take the install path for this feature out of the registry
Hi Sarah !
In the case of a Basic MSI project, I think you can use a System Search to get your path in the registry and put it into a property, then use this property as destination for your feature (instead of default value [INSTALLDIR]).
In case of a Standard project, you can use the FeatureSetTarget function in your script to set the Feature's destination.
Hope this will help,
The problem is that both features at the start point to the install directory as default. However if one of these features is installed to a different location from a different product installation, i would like to change this before the user sees.
Only for one of the features not both so it may go from the installdir to e:\test\test harness for example.
is this possible??
i would get e:\test\testharness from the registry
Never tested it but I think it is possible :
Create a property (lets say MYFEATUREPATH) which default value should be the same as [INSTALLDIR]. You can handle this with the Direct Editor. Use this property as your Feature Destination.
You can get the path from registry using a System Search on a registry key that should contain a potential alternate path (ie e:\test\testharness) and put it in MYFEATUREPATH.
As the AppSearch is one of the first action in the Installation Execute Sequence, your feature will be installed in INSTALLDIR if nothing was found in the registry, or in the path found in the registry if it existed.
I think this should work for a basic MSI project.
Ok i created a property and then set a system search to find the value. Then if not default back to [InstallDir]
I then try to go to the deature properties and change the destination property to the new property i created in the system search.
However when i try and type this value in i get the error:
"The data entered is invalid"
Anyone have any ideas how i can assign a property from the property manager to a feature?
Thanks for being patient so far