I have two .reg files, the difference between them is only in Key
which depends on the version of Windows.
My registry file for Windows x86:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\NGG]
@="URL:NGG Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\NGG\DefaultIcon]
@="C:\\wpf.exe"
"Test"="ika"
[HKEY_CLASSES_ROOT\NGG\Shell]
[HKEY_CLASSES_ROOT\NGG\Shell\Open]
[HKEY_CLASSES_ROOT\NGG\Shell\Open\command]
@="\"C:\\Program Files\\NGG\\start.exe\" \"%1\""
The difference in Windows x64:
@="\"C:\\Program Files(x86)\\NGG\\start.exe\" \"%1\""
How can I make an install script (InstallShield MSI) which checks the Windows version and then uses this current registry file.
Please help.
I would avoid using .reg files for this. Instead use InstallShield's and/or Windows Installer's support for variable values in the registry, and specify either "[ProgramFilesFolder]NGG\start.exe" "%1"
in an MSI-based installation or "<PROGRAMFILES>\NGG\start.exe" "%1"
in InstallScript based installation as the value in the Registry view.
(Or possibly go even more specific by using Verb support in an MSI-based project. Or reference something like "[#start.exe]" "%1"
for your path, assuming you install that executable with a filekey of start.exe - see Formatted for details.)