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

Add an installer based on Squirrel.Windows #22

Merged
merged 5 commits into from Feb 9, 2015

Conversation

Projects
None yet
2 participants
@paulcbetts
Contributor

paulcbetts commented Jan 20, 2015

This PR is the initial start of an installer for AudioSwitcher, here's how to use it:

  1. Build the project in Release mode (msbuild's not in PATH in the Package Manager Console??)
  2. In the Package Manager Console, run .\CreateInstaller.ps1
  3. Open up the Releases folder

Take that folder, upload it verbatim to some sort of S3'ish thing that will host files, and you've got an update server.

Some cool things to add in the future (I didn't want to do anything because I assumed you'd want to set up your own update folder):

  • Actually running updates in the app using the Squirrel library
  • Creating a proper nuspec file so that you can make the installer way smaller (it's almost certainly including files that aren't needed)
  • Displaying What's New / Release Notes / etc
@paulcbetts

This comment has been minimized.

Contributor

paulcbetts commented Feb 8, 2015

Anything else I can do for this PR?

mkdir -Path $tempDirectoryName
rm -r -fo "$tempDirectoryName\*.nupkg"
NuGet pack .\src\AudioSwitcher\AudioSwitcher.csproj -OutputDirectory "$tempDirectoryName" -Prop Configuration=Release

This comment has been minimized.

@davkean

davkean Feb 9, 2015

Owner

Is the NuGet.CommandLine supposed to put NuGet.exe on the path in the Package Manager Console? I ran the script from the Package Manager Console and it failed to find it.

This comment has been minimized.

@davkean

davkean Feb 9, 2015

Owner

Ran into the same problem with Squirrel, but look like this is because the package was just restored. If I restarted VS, then the script worked. Looks like a NuGet bug, filed: https://nuget.codeplex.com/workitem/4439#

@davkean

This comment has been minimized.

Owner

davkean commented Feb 9, 2015

Can you point me to an example Nuspec? I notice that there's a bunch of binaries in that package that aren't needed (all the net20, net40, folders, etc).

I notice that the AudioSwitcher package has some files in net45, but others are splattered in the other framework folders (such as NuGet.Core, Splat, Cecil, etc). How does it know from which folders to pull the binaries?

@davkean

This comment has been minimized.

Owner

davkean commented Feb 9, 2015

Ah, it appears walking through the source that it uses NuGet's VersionUtility to figure out compatibility and then copies that. What would a NuSpec look like that excluded all extra framework folders? Would it just point directly to the files inside the package folders (ie packages\Mono.Cecil.0.9.5.4\lib\net40\Mono.Cecil)?

@paulcbetts

This comment has been minimized.

Contributor

paulcbetts commented Feb 9, 2015

Can you point me to an example Nuspec?

Here's the template that Atom Shell-based apps use, it's pretty representative:

https://github.com/atom/grunt-atom-shell-installer/blob/master/template.nuspec

I notice that the AudioSwitcher package has some files in net45, but others are splattered in the other framework folders (such as NuGet.Core, Splat, Cecil, etc). How does it know from which folders to pull the binaries?

So, right now it doesn't, that's the problem. If you have a set of NuGet packages (i.e. a dependency tree), you don't have enough information to determine which files to include when you "flatten" the tree, you have to know stuff about the csprojs involved.

I intend to work some MSBuild Magic™ to make that happen, but for now you just end up creating a nuspec file that explicitly has <file> tags for the files you want to include, which is usually pretty easy enough

@davkean

This comment has been minimized.

Owner

davkean commented Feb 9, 2015

K, this should do. After playing around this for a while, there looks like there's a few things to do after this is merged:

  1. Remove the desktop shortcut - looks like I can hook onto Squirrel events for this. #25
  2. On uninstall, make sure I close existing open instances (undecided if I should forcibly kill, or just do a named pipes or something to communicate to it), otherwise, we leak the AudioSwitcher.exe and break immediate reinstall. #26
  3. Show some sort of install or first run welcome thing, similar to Atom, - not entirely obvious that something happened after running setup. #27
  4. Sign up for a cert to skip the malware blocks. #28

davkean added a commit that referenced this pull request Feb 9, 2015

Merge pull request #22 from paulcbetts/squirrel
Add an installer based on Squirrel.Windows

@davkean davkean merged commit 13a2969 into davkean:master Feb 9, 2015

@davkean davkean added this to the 1.0 milestone Feb 9, 2015

@paulcbetts paulcbetts deleted the paulcbetts:squirrel branch Feb 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment