ClickOnce एक स्थापना रद्द रजिस्ट्री स्थापित करता है HKEY_CURRENT_USER में कुंजी जो आपके क्लिकऑन एप्लिकेशन के लिए सुलभ है।
विशिष्ट स्थान "HKEY_CURRENT_USER \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ स्थापना रद्द करें"
आप अपने आवेदन के साथ DisplayName कुंजी के लिए खोज करने के लिए होगा।
तो आप सामान्य स्थापना रद्द करें कार्रवाई लपेट कर सकते हैं,
string registryKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
Microsoft.Win32.RegistryKey uninstallKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(registryKey);
if (uninstallKey != null)
{
foreach (String a in uninstallKey.GetSubKeyNames())
{
Microsoft.Win32.RegistryKey subkey = uninstallKey.OpenSubKey(a, true);
// Found the Uninstall key for this app.
if (subkey.GetValue("DisplayName").Equals("AppDisplayName"))
{
string uninstallString = subkey.GetValue("UninstallString").ToString();
// Wrap uninstall string with my own command
// In this case a reg delete command to remove a reg key.
string newUninstallString = "cmd /c \"" + uninstallString +
" & reg delete HKEY_CURRENT_USER\\SOFTWARE\\CLASSES\\mykeyv" +
MYAPP_VERSION + " /f\"";
subkey.SetValue("UninstallString", newUninstallString);
subkey.Close();
}
}
}