I am having a winform application and a visual studio installer set up project with the project output set to this winform application.
This winform gets invoked from a website as an msi installer which saves the values in the registry for invocation of the winform app the next time as a uri protocol scheme.
Now from the web I want to check 2 things:
1.) Is this application already installed on the client machine?
For this I can put a registry checking code to check for application installed or not
string regKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using (Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(regKey))
{
if (key.GetSubKeyNames().Any(keyName => key.OpenSubKey(keyName).GetValue("DisplayName") == "My App's Display Name"))
Console.WriteLine("Already installed...");
else
Console.WriteLine("Start installing...");
}
2.) What is the version of the application installed.
For the version, the registry values as described in point 1 also gives other parameters like "DisplayVersion" and "version, VersionMajor and VersionMinor".
So for the version what is the best way to update the assembly version of the winform application. Should I change the AssemblyInfo class of the winform app or should I change the version in the set up project properties?.
Also in the registry I get following dword values of versions, how to decode these hexadecimal values to get the version number?.

