private void RegisterUninstall() { var guid = UninstallGUID.ToString("B"); using (var key = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + guid)) { key.SetValue("DisplayName", "SharpKit"); //key.SetValue("ApplicationVersion", ProductVersion); key.SetValue("Publisher", "SharpKit"); key.SetValue("DisplayIcon", ApplicationFolder + @"\SharpKitSetup.exe"); key.SetValue("DisplayVersion", ProductVersion); key.SetValue("URLInfoAbout", "http://www.sharpkit.net"); key.SetValue("Contact", "*****@*****.**"); key.SetValue("InstallDate", DateTime.Now.ToString("yyyyMMdd")); key.SetValue("UninstallString", ApplicationFolder + @"\SharpKitSetup.exe /uninstall"); } }
private void UnregisterUninstall() { var guid = UninstallGUID.ToString("B"); Registry.LocalMachine.DeleteSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + guid, false); }