Scenario:
I need to check parts of the registry for a installed file (MyApp.exe), if the registry entry exists, then get the exact Path of installation of MyApp.exe also from the registry.
I have code that works perfectly. Here it is
I released an build to customers that placed the registry entries of installed location in different parts of the registry, so some customers have the location of MyApp.exe installed location in one part of the registry and some customers have MyApp.exe installed location showing in a different registry entry.
That means for my addon packs to work, I have to check registry in multiple locations and based on where the entry is, then set a Path Installed location also from registry.
Here is my non-working code:
So if someone could help, that would be great!
thanks
DC
I need to check parts of the registry for a installed file (MyApp.exe), if the registry entry exists, then get the exact Path of installation of MyApp.exe also from the registry.
I have code that works perfectly. Here it is
Code:
--Check registry for an MyApp key is there or not (Does key Exist) X = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\MyApp"); if X then Install_Path = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\MyApp", "Path", true); SessionVar.Set("%AppFolder%",Install_Path); else end
I released an build to customers that placed the registry entries of installed location in different parts of the registry, so some customers have the location of MyApp.exe installed location in one part of the registry and some customers have MyApp.exe installed location showing in a different registry entry.
That means for my addon packs to work, I have to check registry in multiple locations and based on where the entry is, then set a Path Installed location also from registry.
Here is my non-working code:
Code:
--Check registry for an MyApp key is there or not (Does key Exist) X = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\MyApp"); Y = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\MyCompany\\MyApp"); if X then Install_Path = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\MyApp", "Path", true); SessionVar.Set("%AppFolder%",Install_Path); else if Y then Install_Path = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\MyCompany\\MyApp", "Path", true); SessionVar.Set("%AppFolder%",Install_Path); else end
thanks
DC
Comment