So I have a sizeable paclet built. In my PacletInfo.m, I have created a Resource that points to a file in the Resources directory of my paclet. The resource extension looks like this:
I’ve seen various places on-line that I should be able to use a function called PacletResource[“PacletName”,“FilePaths”] to access and open that file. However, that function seems to be missing. Mathematica doesn’t recognize it and I can’t find anything like it in the help system.
I have Mathematica 12.1 and the Paclet is installed in my user specific Paclets\Repository. I can use the Paclet and it works fine. I’ve tried loading “PacletManager’” and that function doesn’t seem to be in there.
The second option doesn’t do any better. I can correctly create the PacletObject, and get its information, but getting “AssetLocation” just repeats the command, like it is an unknown command.
Got it. I was trying everything you said and it still wasn’t working. Mathematica simply couldn’t find my resource.
Turns out that Workbench (the latest version available to us mere mortals) is not keeping up with the current Mathematica paclet technology and wasn’t properly installing the paclet (or registering the resources?).
I created a paclet archive and then did an “official” PacletInstall. Now both methods you gave me work perfectly.
I just wrote a function that will look for changes in paclets. It is very basic. The first time through, it makes a’reference’ file of paclets on the system. Each subsequent time, it will look to see if there are any changes.
Eventually, I will have the function make a log, but for right now, I use BBEdit (on a mac – similar apps on Windows or Linux) to do a diff.
Interestingly, the paclets on my MacBook Pro 16 are different from those on my new M1 MacBook Air. The installers for Mathematica were downloaded at different times, though. Since Mathematica on the MacBook Air is running using Rosetta, I thought that the paclets should be the same.
I found that if not deployed, I have to manually search the eclipse-workspace directory for this resource file when using Workbench in the Eclipse environment.
If I deploy to the App Data\RoamingMathematica\paclets\repository directory (Workbench wants to use the packages directory) then I can pick up the resources as well.