mdimport does not work in installer script

Hi,

my application installer runs a post-process shell script which registers my application mdimporter


sudo /usr/bin/mdimport -r /Library/Spotlight/myimporter.mdimporter


the installation does not fail, it succeeds in all of its packages BUT the mdimporter seems not to be registered.

If I execute the shell script via terminal it works properly.


Why the shell script that works on terminal seems not to work inside the installer?


Thanks,

Fabrizio.