Clear Filters
Clear Filters

How to modify a shared resource in a deployed file?

1 view (last 30 days)
So I have a deployed file that has .mat files included in the shared resources/helper files section, and I want to be able to access them and modify them. I know that I could include them with the package, but I want to keep it tidy and user-tamper-proof. Thanks.
  1 Comment
Matthew Murphy
Matthew Murphy on 31 Oct 2016
For a slight explanation on the file loading described below, I am using
cd([ctfroot filesep])
to navigate to the file included in the shared resources part of the executable to load, and again to save.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 31 Oct 2016
It appears to me from https://www.mathworks.com/matlabcentral/answers/238308-matlab-compiler-shared-resources-and-helper-files that the shared resources/helper files section is the same as using mcc -a which is the same as "including them with the package".
The general strategy is to include the file with the package, but also have a location outside the package that you check first when you load it, using the in-package version if the other one does not exist. You would need to construct the path to the other version in some way, possibly depending on the environment variables such as USERDRIVE and USERPATH.
A shared file that can be written by the package but not by the users is a challenge, and effectively requires that the executable be granted administrative access. But administrative access on MS Windows is set in the Registry, not in any bits on the file itself, so an administrator would need to do the installation.
  5 Comments
Walter Roberson
Walter Roberson on 31 Oct 2016
You cannot keep the file from reverting. That is why I was talking about looking for it somewhere else and using the saved version if it was not in that other location.
The stuff about encryption and so on had to do with protecting that other version of the file against user modification.

Sign in to comment.

More Answers (0)

Categories

Find more on Programming Utilities in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!