自制的安装包,卸载时需要验证安装时的密码
继承了Installer类,重写了Uninstall函数。添加为主输出的活动,卸载时弹出了对话框。问题就在这儿,"不能卸载"的对话框弹出后,程序还是被卸载了。
缺少一句能退出卸载程序的语句,缺少的那句实在是搜不到,请朋友们帮忙看看。
public override void Uninstall(System.Collections.IDictionary mySavedState)
{
UninstallForm um = new UninstallForm();
um.ShowDialog();
isok = um.UserOK;
if (isok)
{
base.Uninstall(mySavedState);
}
else
{
MessageBox.Show("不能卸载");
//程序能执行到这里,本意是不允许卸载,但是程序还是被卸载了,缺少退出卸载程序的语句。
}
}
继承了Installer类,重写了Uninstall函数。添加为主输出的活动,卸载时弹出了对话框。问题就在这儿,"不能卸载"的对话框弹出后,程序还是被卸载了。
缺少一句能退出卸载程序的语句,缺少的那句实在是搜不到,请朋友们帮忙看看。
public override void Uninstall(System.Collections.IDictionary mySavedState)
{
UninstallForm um = new UninstallForm();
um.ShowDialog();
isok = um.UserOK;
if (isok)
{
base.Uninstall(mySavedState);
}
else
{
MessageBox.Show("不能卸载");
//程序能执行到这里,本意是不允许卸载,但是程序还是被卸载了,缺少退出卸载程序的语句。
}
}
用VS调试一下
isok = um.UserOK;值是多少
{}
调试
protected override void OnAfterInstall(IDictionary savedState)
{
System.Diagnostics.Debugger.Launch(); //do something
}