When writing .do-files which make use of user written commands, first I check whether these programs exist already and then I use commands to install them *only* if they do not exist already.

For example, if my .do-file will use -fre- (available at SSC), at the beginning of the .do-file I write
Code:
cap which fre
if _rc ssc install fre
However, this does not work with -moremata- (available from SSC) because -which- will not find the command -moremata- as either a built-in or an .ado-file. Is there another way to check whether -moremata- is installed so that I can use a command to install it *only* if it does not exist already?