Comments (6)
Or maybe Squirrel could be "responsible" of setting up a data directory shared between version?
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 :)
from squirrel.windows.
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:
- If the application is installed using other means (e.g. zip), the application should still work (i.e. create it's data folder itself)
- If the user deletes the
AppData\Roaming\MyApp
directory, the runtime should be able to re-create it (equivalent of a "reset to factory settings")
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 :)
from squirrel.windows.
If the application is installed using other means (e.g. zip), the application should still work (i.e. create it's data folder itself)
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.
If the user deletes the AppData\Roaming\MyApp directory, the runtime should be able to re-create it (equivalent of a "reset to factory settings")
Yep, it should be Squirrel's job to create this directory.
from squirrel.windows.
I ended up simply re-creating the data directory at startup, everytime, using this code:
var dataFolder = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"MyAppName"
);
if (!Directory.Exists(dataFolder))
Directory.CreateDirectory(dataFolder);
Note that instead of AppData\Local
, I used AppData\Roaming
. This is because app configuration goes there (e.g. favorites, settings, user data). Squirrel is not aware of what kind of "data" is there...
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 string SquirrelContext.CreateRoamingDirectory()
and string SquirrelContext.CreateDataDirectory()
, where SquirrelContext
is an object that can be created and configured for the lifetime of the application (or a singleton), but separately from the UpdateManager
. Their goal is different, and it might be good to have a way to get the path of the app, get the current version, create data directories and other non-update-related stuff like this.
from squirrel.windows.
Actually, that might be three folders... data
and logs
folders under %LocalAppData%\YourApp
, the roadming data under %AppData%\YourApp
, and even a fourth if you also provide cache/temporary files under %temp%\YourApp
. Those are all typical cases for which there is a standard approach, with the exception of logs
, for which I think both Squirrel install logs AND application logs should be (I use ${LocalAppData}\MyApp\logs\MyApp.log
in log4net). That would make sense and justify such a utility since you'll need these folders anyway for setup logs and install files.
from squirrel.windows.
Their goal is different, and it might be good to have a way to get the path of the app, get the current version, create data directories and other non-update-related stuff like this.
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.
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).
I like this idea - not so sure about the logs
bit, but the Remote vs Local is 👍
from squirrel.windows.
Related Issues (20)
- 35 Gig of files in SquirrelTemp HOT 3
- same build twice but get a big delta nupkg
- Reduce authentication prompts for EV code signing
- Application not auto-launching after installation
- not support chinese HOT 7
- Squirrel installers race for SquirrelTemp resulting in bad installations HOT 6
- releasify crashing
- Running multiple squirrel releases HOT 1
- /LARGEADDRESSAWARE support for Stub executable HOT 2
- Squirrel won't install any program like Discord. HOT 3
- The shortcut exe is missing code signing HOT 1
- Can not launch the app via stub exe
- Package 'DeltaCompressionDotNet.1.1.0' does not exist in project Xxxxx (2.0.1) HOT 9
- afaf
- Squirrel
- How to sign just the _ExecutionStub.exe file when run Squirrel --releasify -n ? HOT 5
- GithubUpdateManager doesn't work with accesstoken declared HOT 2
- exit code: 255(System.IO.IOException: Permission denied) HOT 1
- Marked as malware by MalwareBytes? HOT 2
- .NET 8 is not supported HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from squirrel.windows.