Skip to content
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

Stop process if already running #84

Merged
merged 3 commits into from
Dec 11, 2015
Merged

Stop process if already running #84

merged 3 commits into from
Dec 11, 2015

Conversation

demetris-manikas
Copy link
Contributor

If the application is already running the installation fails so just kill it.
Maybe it would be a better solution to show some info and drop the installation but my knowledge about NSIS is still quite limited so as to implement this kind of behavior.

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @stefanjudis to be a potential reviewer

@stefanjudis
Copy link
Contributor

Is it possible to include a button on a dialog in case the user has something going before killing the running app?

That sounds great!!! 👍

@demetris-manikas
Copy link
Contributor Author

Any comments on changed implementation?

@stefanjudis
Copy link
Contributor

Damn it. Sorry - I'll try to have a look at it tonight. :)

@stefanjudis
Copy link
Contributor

@demetris-manikas Just tried it and it looks good to me.

Only thing:

Can we make the dialog a bit more explanatory?

screenshot 2015-12-09 21 00 17

I'm thinking of something like.

"App is already running. This may affect the installation process. Please close the application."

And I think the cta's could be better.

Also it'd be great if "ignore" could be "close & continue" showing, that this will shut down the application.

What do you think?

@mkaz
Copy link
Contributor

mkaz commented Dec 9, 2015

The solution I ended up going with was a two button OK / CANCEL Message box.
Here's that code I used:

MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "${APP_NAME} is running. $\r$\nClick OK to close it and continue with install" /SD IDCANCEL IDOK doStopProcess
        Abort
    doStopProcess:
         DetailPrint "Closing running ${APP_NAME} ..."
         ${nsProcess::KillProcess} "${APP_NAME}.exe" $R0
         DetailPrint "Waiting for ${APP_NAME} to close."
         Sleep 2000

The result looks like:

stop-dialog-2

@stefanjudis
Copy link
Contributor

@mkaz @demetris-manikas

I have to say - I actually like @mkaz 's version more.

What do you two think?

@demetris-manikas
Copy link
Contributor Author

It 's fine by me. I only wanted the installer not to hang when the app is already running.
Your call.

@mkaz mkaz mentioned this pull request Dec 10, 2015
@demetris-manikas
Copy link
Contributor Author

Incorporated changes proposed by mkaz.

@stefanjudis
Copy link
Contributor

👍 Looks good to me thanks!

stefanjudis added a commit that referenced this pull request Dec 11, 2015
@stefanjudis stefanjudis merged commit 43fa31d into electron-userland:master Dec 11, 2015
@stefanjudis stefanjudis added this to the v2.4.0 milestone Dec 11, 2015
@stefanjudis stefanjudis self-assigned this Dec 11, 2015
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.

4 participants