Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Atom Windows Installer: The Plan™ #3428

Closed

Description

@anaisbetts

Squirrel for Windows is getting to a point where we can start to think about getting started integrating into Atom.

How does it work?

From Atom's perspective, there are two aspects of Squirrel to handle:

  1. Squirrel will start Atom.exe with switches to indicate when installation-events occur (installation, upgrade, and uninstall). Atom needs to handle these events (or just exit if there's nothing to do). Squirrel also starts the app on install with a --squirrel-firstrun. Things like setting up app shortcuts and file associations will be done here.
  2. Squirrel gives you an EXE called update.exe, which will allow you to update the application, or retrieve information about updates to apply via a JSON object.

In the build process, there will also be some related tooling work - once the build finishes, we need to do a few things:

  1. Generate a NuSpec file representing the current Atom version (super easy, just a Mustache template)
  2. Run NuGet.exe pack to generate the latest app package
  3. Run Update.exe to generate an installer as well as delta packages. Update.exe will need to have access to the previous versions of Atom to be able to do this (i.e. we'll have an ongoing "Releases" directory that we'll keep updating with new stuff)

These tasks have to be run on a Windows machine, we can't use Mono because we have to call Windows APIs at the very end.

TODO:

  • Integrate Squirrel event handling into Atom startup code
  • Implement update backend by shelling to Update.exe
  • Write the automation for generating packages and release directories (Build a Squirrel installer as part of CI build #3447)
  • Pull down the old releases before we run CI so we can get delta updates
  • Automate posting the releases directory to S3 / CloudFront

/cc @kevinsawicki who would like to subscribe to this newsletter

Activity

  1. kevinsawicki commented on Aug 29, 2014

    @kevinsawicki
    Contributor

    Automate posting the releases directory to S3 / CloudFront

    Will atom/atom releases work for this?

  2. benogle commented on Aug 29, 2014

    @benogle
    Contributor

    Excited for this!

  3. kevinsawicki commented on Aug 29, 2014

    @kevinsawicki
    Contributor

    Excited for this!

    I'm very excited for this.

  4. anaisbetts commented on Aug 29, 2014

    @anaisbetts
    ContributorAuthor

    Will atom/atom releases work for this?

    The updater assumes that all release files are at the same URL (i.e. if we have a RELEASES file at /foo/bar/RELEASES, we have to find FooBar-1.0.nupkg at /foo/bar/FooBar-1.0.nupkg. I believe we put a special hack into releases for exactly this scenario though - I'll look into it.

  5. batjko commented on Aug 29, 2014

    @batjko
    Contributor

    Will this put any additional dependencies or requirements on the client machine?

  6. anaisbetts commented on Aug 29, 2014

    @anaisbetts
    ContributorAuthor

    @batjko Yeah, you'll have to install .NET 4.5. If you have Visual Studio, you probably have it already. This unfortunately means that if you're using Windows XP, you'll have to install releases manually but there's not much we can do about that

  7. batjko commented on Aug 29, 2014

    @batjko
    Contributor

    Ah, fair enough.

    However, in that case, this requirement should probably be handled gracefully if people don't have it yet, i.e. via an automatic installer, ideally.

    I'm thinking of those who usually just download the zip release file for Atom, not all users use it on development machines, or with VS specifically pre-installed (if I didn't build atom regularly, I wouldn't have Visual Studio on mine).

    Just a thought.
    But I am looking forward to this as well. This is going to be another heads-exploding update.

  8. anaisbetts commented on Aug 29, 2014

    @anaisbetts
    ContributorAuthor

    However, in that case, this requirement should probably be handled gracefully if people don't have it yet, i.e. via an automatic installer, ideally.

    Yep, that's the plan - the C++ bootstrapper will handle this automatically

  9. batjko commented on Aug 29, 2014

    @batjko
    Contributor

    💥

  10. winstliu commented on Aug 29, 2014

    @winstliu
    Contributor

    Very excited! 😃
    I'm assuming we'll be able to opt-out of desktop, etc. shortcuts though?

  11. anaisbetts commented on Aug 29, 2014

    @anaisbetts
    ContributorAuthor

    @50Wliu What we've typically done in GitHub for Windows was, we'd create them then watch to see if the user deletes them, then we make sure to not bring them back on updates

  12. winstliu commented on Aug 30, 2014

    @winstliu
    Contributor

    Sounds great.

  13. anaisbetts commented on Sep 6, 2014

    @anaisbetts
    ContributorAuthor

    /cc #3447

  14. Merg1255 commented on Sep 25, 2014

    @Merg1255

    just a note guys: also provide a portable version like you do now. It's always helpful for different environments. Thanks :)

  15. thedaniel commented on Sep 25, 2014

    @thedaniel
    Contributor

    I believe we put a special hack into releases for [assumptions like the updater makes]

    We can make this work, special hack or no, by having the updater hit a path on atom.io and let that webapp redirect to the right asset. It would be nice for other clients of Squirrel if it would work with Releases without an intermediary though.

  16. anaisbetts commented on Sep 25, 2014

    @anaisbetts
    ContributorAuthor

    @Merg1255 while we can do that, the Atom installer doesn't require admin permissions, so you should be able to carry the setup.exe around on a USB stick too

  17. Merg1255 commented on Sep 25, 2014

    @Merg1255

    @paulcbetts sure, though I think it's easier to have a folder with everything in there.

  18. kevinsawicki commented on Nov 14, 2014

    @kevinsawicki
    Contributor

    This is pretty much done now, the plan is being executed. I'm going to close this out and open specific issues for remaining tasks and issues.

  19. kohenkatz commented on Dec 21, 2014

    @kohenkatz

    @kevinsawicki In the original post for this issue, you mention generating a NuSpec file. Is the code for doing that in this repo? I didn't see it anywhere. If not, is it somewhere else publicly accessible? I'd like to see it.

  20. kevinsawicki commented on Dec 21, 2014

    @kevinsawicki
    Contributor

    @kohenkatz it is generated during the build by this grunt plugin: https://github.com/atom/grunt-atom-shell-installer

    You can see the raw template here: https://github.com/atom/grunt-atom-shell-installer/blob/master/template.nuspec

    It is configured via settings in Atom's build file:

    atom/build/Gruntfile.coffee

    Lines 202 to 207 in 9422a80

    'create-windows-installer':
    appDirectory: shellAppDir
    outputDirectory: path.join(buildDir, 'installer')
    authors: 'GitHub Inc.'
    loadingGif: path.resolve(__dirname, '..', 'resources', 'win', 'loading.gif')
    iconUrl: 'https://raw.githubusercontent.com/atom/atom/master/resources/win/atom.ico'

  21. thedaniel commented on Dec 21, 2014

    @thedaniel
    Contributor

    @kohenkatz I believe the code is part of the setup process for the Squirrel installer library: https://github.com/Squirrel/Squirrel.Windows (per this doc)

  22. thedaniel commented on Dec 21, 2014

    @thedaniel
    Contributor

    whoops, disregard me!

  23. kohenkatz commented on Dec 21, 2014

    @kohenkatz
  24. lock commented on Jan 24, 2019

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  25. locked as resolved and limited conversation to collaborators on Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions