mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Merge pull request #1099 from mattias-symphony/SDA-2526
fix: SDA-2526 Display uninstall confirmation dialog
This commit is contained in:
commit
a8023eef6f
@ -215,6 +215,7 @@ class Script
|
||||
.Add<Symphony.ExitDlg>();
|
||||
|
||||
project.Load += project_Load;
|
||||
project.BeforeInstall += project_BeforeInstall;
|
||||
|
||||
project.Platform = Platform.x64;
|
||||
|
||||
@ -253,6 +254,26 @@ class Script
|
||||
}
|
||||
}
|
||||
|
||||
// Display a confirmation dialog when uninstalling Symphony, and cancel uninstall unless user confirms.
|
||||
static void project_BeforeInstall(SetupEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (e.IsUninstalling)
|
||||
{
|
||||
var result = System.Windows.Forms.MessageBox.Show("Are you sure you want to uninstall this product?",
|
||||
"Windows Installer", System.Windows.Forms.MessageBoxButtons.YesNo);
|
||||
if (result != System.Windows.Forms.DialogResult.Yes)
|
||||
{
|
||||
e.Result = ActionResult.UserExit; // Signal to installer to exit
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
e.Session.Log("Error displaying uninstall confirmation dialog: " + ex.ToString() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CustomActions
|
||||
|
Loading…
Reference in New Issue
Block a user