Azzera filtri
Azzera filtri

How to modify a shared resource in a deployed file?

1 visualizzazione (ultimi 30 giorni)
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 Commento
Matthew Murphy
Matthew Murphy il 31 Ott 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.

Accedi per commentare.

Risposta accettata

Walter Roberson
Walter Roberson il 31 Ott 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 Commenti
Walter Roberson
Walter Roberson il 31 Ott 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.
Matthew Murphy
Matthew Murphy il 1 Nov 2016
Ah, I get it now. Thanks for the help.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Programming Utilities in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by