Squirrel.windows: Cancel uninstall event

Created on 18 May 2015  路  5Comments  路  Source: Squirrel/Squirrel.Windows

Is it possible in whatever code I put in the "onAppUninstall" event, to cancel the uninstall command?

The scenario is that I'd like a message box to appear, "Are you sure you want to uninstall this? It is still running in the background and will kill whatever it's doing" or something like that. If the user clicks 'no', it should stop the uninstall.

Bryan

Most helpful comment

Being able to cancel the uninstall would be quite useful in case the user uninstalls by accident. A simple confirm dialog "Are you Sure?". Also, we would like to ask the user if they want to also delete their settings. Without this feature, we will probably have to build an uninstall menu command into the application which is not ideal.

All 5 comments

Oh nevermind. I realized that if I returned 'false', it cancels it, like this

onAppUninstall:=Function(v)
     If MessageBox.Show("Are you sure you want to uninstall? ", "APP", MessageBoxButtons.YesNo, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button2) = DialogResult.No Then
         Return False
         Exit Function
     End If
     'do stuff
     Return True

Um, this isn't true. It will uninstall regardless of what you return. You cannot cancel uninstall.

Oh, you're right. I just did some further testing when the process wasn't running.

Cancelling uninstalls (to prevent accidents or user stupidity) would be a nice feature to add.

Bryan

I don't think we're going to let programmers override what the user wants, sorry

Being able to cancel the uninstall would be quite useful in case the user uninstalls by accident. A simple confirm dialog "Are you Sure?". Also, we would like to ask the user if they want to also delete their settings. Without this feature, we will probably have to build an uninstall menu command into the application which is not ideal.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

don-smith picture don-smith  路  5Comments

mwave picture mwave  路  6Comments

JonZso picture JonZso  路  6Comments

aneeff picture aneeff  路  5Comments

Andrew-Hanlon picture Andrew-Hanlon  路  4Comments