[squeak-dev] Sources file locations (was: User config directories)

David T. Lewis lewis at mail.msen.com
Mon Jan 3 16:42:23 UTC 2022

Hi Jakob,

On Sun, Jan 02, 2022 at 08:39:29PM +0100, Jakob Reschke wrote:
> Hi Dave,
> Happy new year!
> Am Sa., 1. Jan. 2022 um 21:46 Uhr schrieb David T. Lewis <lewis at mail.msen.com>:
> >
> > For Unix/Linux, the solution can be very simple, just add /usr/share/squeak/
> > and /usr/local/share/squeak/ to the list of locations to be searched
> > for sources files.
> >
> > I suspect (but I'm not sure) that some similar convention will work
> > for Windows.
> >
> On Windows you would need additional help from the VM because there is
> no fixed path like /usr/share or /usr/local/share. Most Windows
> installations are on drive C:, but it is possible to spread Windows
> across different partitions. Possible candidates for a non-writable
> system-wide location are %ProgramFiles%\Common Files (usually
> C:\Program Files\Common Files) or, if Squeak were installed like other
> applications, its program directory under %ProgramFiles% (for example
> C:\Program Files\Squeak). If it should be writable by users (or at
> least the one who creates it), we could take %ProgramData% (usually
> C:\ProgramData).
> https://docs.microsoft.com/en-us/windows/win32/shell/knownfolderid

Thanks, this link makes it much more clear. Indeed, this would be
better be supported by the VM, which has direct access to the Windows
API calls.

> The most official way to get the folder paths at runtime is to use the
> Windows API, but going via the environment variables should work as
> well. So if the VM does not provide the paths, we would still need at
> least access to environment variables from a VM without separately
> installed plugins.

Given that the KNOWNFOLDERID locations are well defined in the API,
I would think that the Windows API would be the better way to handle
it. Perhaps the VM should provide an optional primitive for this,
with the primitive providing a list of one or more locations in
which the sources files might be found. And if the primitive is
not implemented, then don't look there :-)


More information about the Squeak-dev mailing list