Skip to content

Instantly share code, notes, and snippets.

@Gravifer
Last active February 16, 2021 09:58
Show Gist options
  • Save Gravifer/11077f21c2bd877e1b202ccb69803c90 to your computer and use it in GitHub Desktop.
Save Gravifer/11077f21c2bd877e1b202ccb69803c90 to your computer and use it in GitHub Desktop.
Install Wolfram paclets from the Windows context menu

A little tweaking to install wolfram paclets in the Windows explorer. It is always possible to modify the registry manually; but for a less painstaking way, you can use FileTypesMan by Nir Sofer and Resource Hacker by Angus Johnson.

Paclets are merely .zip archives with concerned .m package files and some versioning code. It's convenient to add unzipping and installing actions to the right-click context menu. For installation:

wolframscript.exe -code "pac=Last[$ScriptCommandLine]; Print[StringJoin[\"Trying to install \", pac, \" ...\"]]; PacletInstall[pac]" "%1"

%1 is the first argument passed to the action, i.e., full path (Windows style, no escaping) to the file upon which the context menu is called. By using $ScriptCommandLine, the Wolfram system internally handles character enscaping.

Use your favorite compressing tool for extraction, e.g.

winrar.exe "%1"

You can set either to be the default action of double-clicking.


To make the paclets more noticable in the file explorer, you can use this icon I made. It is just a crude modification of the official notebook icon, and you can always make a better design yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment