From where the clickonce get the value used in DisplayName
in the register HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\XXXXXXXX
? I tried the change the application title and assembly name on VS(project -> properties -> application -> assembly information) but this neither change there changed the name used in DisplayName
value.
I need this because I want to avoid hard-code my application name on this piece of code that change the unistall icon of my application on add/remove programs
RegistryKey myUninstallKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall");
string[] mySubKeyNames = myUninstallKey.GetSubKeyNames();
for (int i = 0; i < mySubKeyNames.Length; i++)
{
RegistryKey myKey = myUninstallKey.OpenSubKey(mySubKeyNames[i], true);
object myValue = myKey.GetValue("DisplayName");
if (myValue != null && myValue.ToString() == applictionName) /* this must be the same used by clickonce to set DisplayName value */
{
myKey.SetValue("DisplayIcon", iconSourcePath);
break;
}
}