Closed cleary closed 1 year ago
This looks dangerous – someone may have a lot of information in their startup.scd file that would get overwritten. But it is a good idea to streamline this process. Maybe there is a less intrusive variant?
This looks dangerous – someone may have a lot of information in their startup.scd file that would get overwritten. But it is a good idea to streamline this process. Maybe there is a less intrusive variant?
Well, the intent is to inject it into a brand new supercollider installation as the startup.scd
(as part of the tidal setup).
If the file already exists you'd just fall back to a manual installation message.
Yes, sure. But when someone downloads this and installs it, it won't check if there is a startup already and just do File.delete(startup);
. No?
If the file already exists you'd just fall back to a manual installation message.
This fall back isn't in the above code, so I wonder where this happens
Yes, sure. But when someone downloads this and installs it, it won't check if there is a startup already and just do
File.delete(startup);
. No?
Yes, if someone just downloads and runs it -
If the file already exists you'd just fall back to a manual installation message.
This fall back isn't in the above code, so I wonder where this happens
This would happen in the choco install script.
There are a couple of options, I can think of to make it safer for general use:
Remove the file deletion, and instead keep sd_startup.scd separate, and load it separately. The downside to this is all the tidal startup.scd doco will break a bit
Put in a safe version (uncommented) and an unsafe version (commented) for a user to choose
Just put in lots of visible warning comments
A number of things (sorry, I don't know how choco works, so it may be solved in some other way):
startup.load;
– the class library needs to be recomplied anyway before it will work.A check for an existing file could look like this:
canWriteAtPath = { |pathForFile, overwriteIfEmpty = false|
var paths = thisProcess.platform.startupFiles;
pathForFile = pathForFile.standardizePath;
paths.every { |p|
if(pathForFile == p) {
if(File.exists(pathForFile)) {
if(File.readAllString(pathForFile).size > 0) {
"non-empty startup file already exists at this path: %".format(pathForFile).postln;
false
} {
if(overwriteIfEmpty) {
"empty startup file already exists at this path, overwriting: %".format(pathForFile).postln;
true
} {
false
}
} {
true
}
} {
true
}
}
}
Remove the file deletion, and instead keep sd_startup.scd separate, and load it separately. The downside to this is all the tidal startup.scd doco will break a bit
If you have another startup already, this will potentially have conflicts.
Put in a safe version (uncommented) and an unsafe version (commented) for a user to choose Just put in lots of visible warning comments
The user may not know what they are doing, so better not. It should at least ask whether this can be moved to another location, or renamed. Deleting is not an option in any of the cases, I think.
Thanks @telephon - appreciate your input:
A number of things (sorry, I don't know how choco works, so it may be solved in some other way):
* To directly download the develop branch version of the startup file is a bit risky – e.g. it may deviate from the state of the release that is being installed.
Agree, this needs to be sorted before it goes in (this can be part of the choco script)
* It is definitely better to check if a startup file already exists – you may not know this: people invest a lot of work in their startup file
I'd also just do this in the choco script
* I'm not sure why this directly calls `startup.load;` – the class library needs to be recomplied anyway before it will work.
This file is intended to be initially run as the startup.scd file, so it only overwrites itself.
Remove the file deletion, and instead keep sd_startup.scd separate, and load it separately. The downside to this is all the tidal startup.scd doco will break a bit
If you have another startup already, this will potentially have conflicts.
Put in a safe version (uncommented) and an unsafe version (commented) for a user to choose Just put in lots of visible warning comments
The user may not know what they are doing, so better not. It should at least ask whether this can be moved to another location, or renamed. Deleting is not an option in any of the cases, I think.
Remembering this is a proposal to go into a specific install method (choco) on Windows only. Once the choco script has checked to make sure there is no existing startup.scd file in this case the risk drops to 0.
Once again, appreciate the input - I think the answer to my original question, ie - "Do you think it should be hosted in the superdirt repo?", is a no
Once again, appreciate the input - I think the answer to my original question, ie - "Do you think it should be hosted in the superdirt repo?", is a no
Not sure, we will have to think about how it is done best, that is the main thing.
Superdirt has it's own package - closing https://github.com/il-mix/superdirt-chocolatey
This is a cross-platform method to install the SuperDirt quark (and Vowel/Samples etc) from a SuperDirt startup.scd file. The idea being to reduce the number of steps required in the Choco install process which is fragile and completely dependent on upstream moderators and their schedules for approving fixes.
It can be dropped in a User's
%LOCALAPPDATA%/SuperCollider/startup.scd
location, then on SuperCollider first start will install SuperDirt AND write a new startup.scd template with useful superdirt starting content (@telephon is it safe for us to depend on that template?).This method is also cross-platform, and could be referenced as part of the manual install doco if we wanted - I don't know which repo could be a good home for it, but potentially the https://github.com/musikinformatik/SuperDirt one (@telephon thoughts?)