-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way to "carry" content across releases #47
Comments
This isn't a terrible idea, just provide a simple property "DataDirectory" that we guarantee doesn't go away, which just returns a safe path (probably the root app dir + "data") You should submit this as a PR :) |
Actually, after some thought, it is a terrible idea :) Here's my reasoning: There should be as little runtime dependency on Squirrel as possible. Here are more reasons:
So since I need to implement code for these two things, it won't be harder to support the first run setup as well. I'd close this issue, but since you maybe saw something else in it, I'll let you close it if you agree :) |
Totally - so this property would probably have a very simple implementation that had no dependency on whether the app was correctly installed by Squirrel. Something like: public class UpdateManager
{
public string DataDirectory {
get {
var appDataDir = Path.Combine(ApplicationRootDirectory, "data");
if (!Directory.Exists(appDataDir)) Directory.Create(appDataDir);
return appDataDir;
}
}
} Whether or not the app got dropped in via a zip, we don't care - we only effectively use the app name provided to UpdateManager.
Yep, it should be Squirrel's job to create this directory. |
I ended up simply re-creating the data directory at startup, everytime, using this code:
Note that instead of So, maybe there should be two data folders; one under the application directory, as you said (next to the app versions) for cache data, per-install data and another for configuration (under roaming). If such a feature is created, I would personally prefer it to be something like |
Actually, that might be three folders... |
I'm not super excited about this, if only because it's pretty easy to create UpdateManagers (i.e. all you need is your application name and an update URL). I'd rather have everything be in one place.
I like this idea - not so sure about the |
I'm not sure about this one, but here goes.
My application has a configuration file (
App.config
), a log file and aPlugins
directory where users can drop their extensions.Because of the way Squirrel works (creating a different folder per version), those files are lost "in the midst of the past". My best option now is to have my app create another folder (e.g. in
%AppData%
) and put every file that can be modified there.If you think this is the way to go, you can close this issue (and this can serve as a reference for people with similar wants), otherwise what do you think of being able to "carry" files over releases? Or maybe Squirrel could be "responsible" of setting up a data directory shared between version?
My intention is to setup a shared directory in
%AppData%\MyApp
when my app is run with--squirrel-install
.The text was updated successfully, but these errors were encountered: