You can find only some sparse information on the web about the error I encountered recently:
This form template was deployed as part of the feature XXX. This form template should be removed only by uninstalling that feature.
I just deployed an updated solution with the same template in it, being installed as a module in the virtual file system. Just when installing the feature, this error popped up. Going to Central Administration and trying to fix it there didn’t work either. I fired up Powershell and tried some more commands to little avail.
The problem is that installing the feature is not possible because the form already exists. Uninstalling the feature doesn’t work either because the feature is not installed. Thanks to Powershell, we can use the -force parameter (stsadm also had this before). The following two statements fixed the problem instantly:
install-spfeature "FeatureFolderPath" -Force
This forcefully installs the feature, ignoring any errors that occur.
uninstall-spfeature "FeatureFolderPath" -Force
This command then removes the template, after which you can deploy your solution again. I’m guessing the -force parameter is not necessary here.