Edgar wrote:Gale Andrews wrote:On Mac it finds the Audacity executable in its folder inside the Audacity application folder, so "Audacity.App/Contents/MacOS/Audacity" (which is the path to the embedded app and is not a folder). It wants to replace "/MacOS/Audacity" in that path with "Resources" so that it writes to the folder "Audacity.App/Contents/Resources".
On Linux the path just says "audacity". I installed your patched app, so in that case the path should be "/usr/local/bin".
Is it the case that for Mac OS (when Audacity is installed normally - i.e. not built by a developer) that displayed string will always be:
"Audacity.App/Contents/MacOS/Audacity"
so the resulting target will be:
"Audacity.App/Contents/Resources/resetPrefs.txt"
The displayed string now is always "<path to the folder containing the Audacity build or installation">/Audacity.App/Contents/MacOS/Audacity". That is reliable for build or normal installation.
So the target is the relative one of "Audacity.App/Contents/Resources/resetPrefs.txt". Written absolutely, it is "<path to the folder containing the Audacity build or installation">/Audacity.App/Contents/Resources/resetPrefs.txt.
Edgar wrote:Does manually placing the file there cause Audacity to reset the next time it starts?
Yes, reliably so.
Edgar wrote:On Linux are you saying that the resulting target would be:
"/usr/local/bin/resetPrefs.txt"
and that there is no reference to a Audacity-specific containing folder?
Audacity seems to look in the "share" folder for the installed version of Audacity (which is the same location the Manual is looked for on Linux if a user installs it).
A self-compiled (and installed) build will look in /usr/local/share/audacity for resetPrefs.txt. A build installed by a normal user with a package manager will look in /usr/share/audacity. Audacity will error that it can't write or remove resetPrefs.txt because those locations require root permission, so that is a problem. And it's a problem that a builder who does not install Audacity cannot use resetPrefs.txt.
There are two hidden files in the user's home folder called ".audacity-files" and ".audacity-data" that user has permission to write to. I think if this was to work on Linux we'd have to modify audacity to write to either of those folders.
Gale