AW: st: Check whether ado file is installed

<>
" So, reliance on -ssc- omits a great deal."
So transfer via -adolist- and -adoupdate- regularly subsequently. This has helped me synchronize across computers...
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Nick Cox
Gesendet: Montag, 14. Dezember 2009 15:19
An: statalist@hsphsun2.harvard.edu
Betreff: RE: st: Check whether ado file is installed
Note also that packages can be found in many places, including the SSC archive accessed by -ssc-, the Stata Journal website and other websites maintained by individuals or institutions. So, reliance on -ssc- omits a great deal.
Nick
n.j.cox@durham.ac.uk
Sven-Oliver Spieß
True. This approach depends on the assumption that every package
includes a command with the same name. This should be the case for many
but not necessarily all packages. In my case it works just fine, but it
might not for everyone.
I didn't know about Ben Jann and Stefan Wehrli's -adolist- so maybe
that's the more convenient and fail-safe alternative anyway.
On Mon, 2009-12-14 at 13:40 +0000, Nick Cox wrote:
> -which- looks for commands rather than packages. On occasion that would fail whenever a package name does not correspond to a command name.
Sven-Oliver Spieß
> I feel like the 'which' command could be your friend.
>
> You could add something like this to your profile.do:
> ---Beginning example---
> foreach package in pkg1 pkg2 pkg3 {
> capture which `package'
> if _rc==111 ssc install `package'
> }
> ---End example---
>
> See 'help which' and 'help profile' for more details.
Jan Sauermann wrote:
> > I work on different computers and would Stata to automatically check
> > whether a number of ado-files is installed on a local machine. My idea
> > was to write something like
> >
> > [a command which checks whether one ado-file is installed / or not]
> > if package!=installed {
> > ssc install package
> > }
> >
> > My problem is basically to find a command which (1) checks whether an
> > ado file is installed and (2) gives me a local as return.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/