This posting is not a complete answer. Rather, it is a spelunking report concerning the kernel initialization sequence in version 11.0.1 as it relates to automatic paclet updating.
In summary, every three days the system initialization sequence will automatically update paclets that are loaded from $PacletSite
. $PacletSite
is normally http://pacletserver.wolfram.com, although malicious software could change that.
The automatic updating will not occur if the kernel is started with either the -nopaclet or -layoutpaclets command line arguments, but these arguments have other consequences as well. We can also $AllowInternet = False
, but this has wider consequences too.
Other paclet sites are not updated by this mechanism. However, there is nothing stopping a loaded paclet from installing its own mechanism. Furthermore, the system sometimes updates other paclets on-demand during normal operation -- usually, but not always, data paclets. This latter behaviour will need to be the subject of a future spelunking report.
System Initialization Details
For those who wish to follow along, define the following function:
opensys[args__] :=
{$InstallationDirectory, "SystemFiles", args} // FileNameJoin // NotebookOpen
System initialization begins in the file:
opensys["Kernel", "SystemResources", $SystemID, "sysinit.m"];
As part of the start-up, PacletManager`Package`preparePacletManager[]
is invoked. The definition for this function is in:
opensys["Autoload", "PacletManager", "Kernel", "Manager.m"];
It calls PacletManager`Package`initializePacletManager
from the same file. If the kernel is started up with an option -nopaclet or -layoutpaclets on the command line, then it sets the variable PacletManager`Package`$pmMode
to be "ReadOnly"
, or "Normal"
otherwise. Later, it calls PacletManager`Package`initializeSites
which can be found in this file:
opensys["Autoload", "PacletManager", "Kernel", "Services.m"];
If the mode is not read-only, then it calls PacletManager`Services`Private`doWeeklyUpdate
from the same file. This will check the paclet information accessible from PacletManager`Services`Private`getPacletSiteData[]
. It extracts the paclet information for the site contained in $PacletSite
, whose value is normally:
$PacletSite
(* "http://pacletserver.wolfram.com" *)
If the last successful update of that site is older than three days, then PacletSiteUpdate
is called upon that site.
Nowhere along this tour do we find evidence of any fine-grained control mechanisms for this update activity. We can use of aforementioned command line arguments, or set $AllowInternet
to be False
, but these have wider consequences.
PacletManager`Package`$managerData
, e.g.,"LastWolframAutoUpdate" /. PacletManager`Package`$managerData
,"LastUpdatedSiteDate" /. PacletManager`Package`$managerData
. I thought I got this and other info from this site, but I can't find it. Maybe it was on Community. Or in Chat. One could use it to poll the paclet manager, I suppose, but there doesn't seem to be much info about what's in the updates. $\endgroup$