the below is a sample custom installer class.
[RunInstaller(true)]
public partial class Installer1 : System.Configuration.Install.Installer
{
public Installer1()
{
InitializeComponent();
}
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
// Do your magic here, call your form, do your thing...
}
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
public override void Commit(IDictionary savedState)
{
base.Commit(savedState);
}
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
public override void Rollback(IDictionary savedState)
{
// if something goes wrong, it's here you correct it and rollback the system to its previous state and undo what you already changed
base.Rollback(savedState);
}
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
public override void Uninstall(IDictionary savedState)
{
// Here you undo changes when you cancel
base.Uninstall(savedState);
}
}
now i want to design my apps in such a way when user will try to install my apps then a dialog comes and will ask for credential. if user will not be able to give right credentials then my apps will not be installed in user pc.
the same way if user will not be able to provide credentials during uninstallation then user will not be able to uninstall my apps.
please guide me how could prevent install and uninstall action from custom install class. thanks