I am using installscript project.

We wanted to change the install location of existing installer during update.So, we are trying below approach:
1.Uninstalling
2.then Installing in same flow.

I am able to uninstall the setup using FeatureRemoveAllInMediaAndLog() function in OnUpdateUIBefore() function followed by OnMoveData() function.(In this call registry and entry in control panel is also removed)

After this i need to install the setup hence,i am calling OnFirstUIBefore(),OnMoveData(),OnFirstUIAfter() these functions,but in OnMoveData() function setup is not able to install properly i.e. files not copied into location path,no registry entry and no entry in control panel also.

Note:In OnFirstUIBefore() function, i am changing target directory i.e. installation path.

We tried using FeatureReinstall(),FeatureSelectNew() these functions after OnFirstUIBefore() and before OnMoveData(),but still not installing properly.
When we tried using FeatureSelectNew() this function we got unexpected error while updating xml files -2004 in OnMoveData().

Let us know if we can use any other functions?