Comments (7)
Maybe? Send a PR :)
from squirrel.windows.
I can do that :) The only thing that still bothers me is where to put that code. I'm still uncomfortable with putting everything in UpdateManager
. It's lifetime (and .Dispose()
expected call) differs from a "runtime" API such as this one (and #47). Therefore, I'd create a SquirrelApplicationContext
. What do you think?
from squirrel.windows.
I would put this in a separate class, yeah - it's not a context though, just make a simple static class + method that will parse arguments and return an Enum
from squirrel.windows.
Well, I thought of something like this, since first-run and install both require startup arguments:
var squirrelContext = new SquirrelApplicationContext(args);
if(squirrel.HandleInstall(handler));
if(squirrelContext.IsFirstRun)
ShowSomeMessage();
So if we're to have such a class, why not make it so that it also handles creating the data directories (since that's the typical job of --squirrel-install
), and if it knows the data directories, then it should be the main point of access.
But my main reason is that I'm a TDD-maniac, and if I'm to introduce a dependency in my app, I'd like to be able to mock it. Static methods just make my life harder :)
Anyway, I can just send a PR and let you decide what to do with it :)
from squirrel.windows.
So if we're to have such a class, why not make it so that it also handles creating the data directories
I'm not super excited about that, let's leave that in UpdateManager.
But my main reason is that I'm a TDD-maniac, and if I'm to introduce a dependency in my app, I'd like to be able to mock it
This method has no state though, what is there to mock? You pass in arguments, it does a thing
from squirrel.windows.
It's your project :) As for TDD, I'll end up wrapping it in a class anyway since I don't want to simulate Squirrel's logic in my app, I just want to simulate a state. My test would then look something like:
squirrelContextMock.SetupGet(m => m.IsFirstRun).Returns(true);
rather than passing the actual squirrel arguments. But that's just my own way of working, I won't push it on you!
from squirrel.windows.
#72 should cover this
from squirrel.windows.
Related Issues (20)
- 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
- System.InvalidOperationException
- Don't sign .node files by default HOT 1
- 2.0.1 binaries HOT 1
- GitHub Desktop Installer Conflicting with MS Teams installer HOT 5
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.