Update: I realized that I need to make the code erase old mlib's before creating the new one. Otherwise, the new one can be saved into a different folder from the new one, and the user can end up with two, one possibly out of date. The new version is:
This does however require write access to the directory where the old mlibs are stored...
Code:
mata st_local("mlibversion", boottestCompileVersion())
if `mlibversion' != c(stata_version) {
findfile "lboottest.mlib"
while !_rc {
erase "`r(fn)'"
cap findfile "lboottest.mlib"
}
qui findfile "boottest.mata"
run "`fn'"
}

Comment