Dear Jan,
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.
Cheers,
Sven-Oliver
On Mon, 2009-12-14 at 02:05 +0100, Jan Sauermann wrote:
> Dear Stata list,
>
> 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.
>
> Best regards,
>
> Jan
> *
> * 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/
-----------------------------------------------------
Sven-Oliver Spieß
Department for Business and Organizational Psychology
http://www.psychologie.uni-mannheim.de/wip
University of Mannheim
Schloss, Ehrenhof Ost 245
68131 Mannheim
-Germany-
Phone: +49-621-181-2121
Fax: +49-621-181-2119
-----------------------------------------------------
*
* 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/