version 1.1

Title

installpkg -- install Stata packages by specifying zipfile/pkgfile or local directory

Syntax

installpkg , from(local_directory) [options]

installpkg , from(directory/zipfile) [options]

installpkg , from(directory/pkgfile) [options]

Options

from(string) specifies install package(s) from local_directory
or directory/zipfile or directory/pkgfile.

replace specifies that the downloaded files replace existing
files if any of the files already exists.

force specifies that the downloaded files replace existing
files if any of the files already exists, even if Stata thinks all the files
are the same. force implies replace.

Note: If local_driectory is specified, the command searches and installs all installable
packages in the root of the specified driectory.
If directory/zipfile is specified, the command searches and installs all installable
packages in the unzipped folder.

Example(s)

install gtfpch from arlionn-gtfpch-master.zip

. installpkg, from(C:\arlionn-gtfpch-master.zip)

install gtfpch by specifying gtfpch.pkg in the local directory.

. installpkg, from(C:\gtfpch\gtfpch.pkg)

install gitee by specifying gitee.pkg in website

. installpkg, from(https://gitee.com/kerrydu/gitee/raw/master/gitee.pkg)

Search and install packages included in C:\gtfpch.

. installpkg, from(C:\gtfpch)

Usage in Stata User Menu

Prompt installpkgmenu in Stata command window to add "InstallPackage" submenu into Stata User.

Click InstallPackage -> Installpkg to select the Stata files for installation.

Click InstallPackage -> Createpkg to create package information and install the package.

Acknowledgment

I am grateful to E. F. Haghish for providing many useful Stata commands in Github. "make2.ado" in
this package is a copy of his "make.ado" with some minor modifications. "createpkg.dlg"
and "createpkgdlg.ado" also originates from his "make.dlg" and "makedlg.ado".

dirlist command in "installpkg.ado" is from the post by Robert Picard in Statalist
(https://www.stata.com/statalist/archive/2013-10/msg01058.html).
I appreciate Robert Picard for posting this command

Author

Kerry Du

Xiamen University

Email:kerrydu@xmu.edu.cn