Skip to content

Notify applications post-install - #17

Merged
anaisbetts merged 20 commits into
masterfrom
run-on-install
Aug 21, 2014
Merged

anaisbetts merged 20 commits into
masterfrom
run-on-install

Conversation

@anaisbetts

Copy link
Copy Markdown
Contributor

This PR replaces the IAppUpdate framework with a much simpler scheme, that is also compatible with native C/C++ applications. Closes #14.

Spec

After applying updates, Squirrel will scan the new installation directory for EXEs which match one of these two characteristics:

  • The EXE is a .NET assembly and it has an AssemblyMetadata key of "SquirrelAwareVersion" with a value of "1"
  • In the English-language block of its PE Version header, it has a key of "SquirrelAwareVersion" with a value of "1"

Every EXE that is found that matches will be invoked with:

  • /squirrel-installed [new-version] - Invoked on initial install
  • /squirrel-updated [new-version] - Invoked whenever the EXE is updated
  • /squirrel-uninstall [version] - Invoked when the application is fully uninstalled

You must exit as soon as possible once you finish the post-installation operations.

Once installation is complete, if this is the initial install, all Squirrel-aware EXEs will be invoked with:

/squirrel-firstrun

If this is your main application, you should probably just ignore this and execute. If this is a utility application solely dedicated to Squirrel or you don't want it to show up once the initial install completes, just exit.

TODO

  • Write code to detect EXEs that match and generate a list from an app install directory
  • Wire this up to the install / apply / uninstall code
  • Invoke first run
  • Write tests to verify

@haacked

haacked commented Aug 18, 2014

Copy link
Copy Markdown

Heh, how does one review this? :)

@anaisbetts

Copy link
Copy Markdown
Contributor Author

Heh, how does one review this? :)

This will have some more interesting code soon :) Right now the PR just exists to document The Plan™

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should add [return: MarshalAs(UnmanagedType.Bool)] to be explicit about the type of bool this unmanaged method returns.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OCD nit, but if you're following GHfW code conventions we do it like:

var result = conditional
    ? trueExpression
    : falseExpression;

It has a nice similarity to F# pattern matching syntax that way where they line up each condition's operators on the left.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code convention right now is a mess, it's like 50% Microsoft Standard and 50% One True C# Style, gonna fix this in a separate PR to be all consistent

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🆒

@haacked

haacked commented Aug 21, 2014

Copy link
Copy Markdown

Mostly cosmetic feedback. The implementation looks good and I like the approach!

@anaisbetts

Copy link
Copy Markdown
Contributor Author

Thanks @haacked!

anaisbetts pushed a commit that referenced this pull request Aug 21, 2014
Notify applications post-install
@anaisbetts
anaisbetts merged commit a02b685 into master Aug 21, 2014
anaisbetts added a commit to electron/electron that referenced this pull request Aug 28, 2014
This sets up Atom to be packaged into a Squirrel installer. See
Squirrel/Squirrel.Windows#17 for the details
anaisbetts added a commit to electron/electron that referenced this pull request Aug 28, 2014
This sets up Atom to be packaged into a Squirrel installer. See
Squirrel/Squirrel.Windows#17 for the details
@shiftkey
shiftkey deleted the run-on-install branch May 6, 2019 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Figure out what to do about installation and multiple EXEs

2 participants