Hi, reading this post? It means you are really looking for how to check for existence of MS Office or any other program via script, or through registry. There are some standard locations in the registry editor, where you could manually search for existence of some program installed on the local machine. But not everyone is comfortable with it. Also, there are chances of any accidental deletion of any wrong key, if done by some immature user.
But when it comes to script, and especially from checking within the installer, then we had some options:
But when it comes to script, and especially from checking within the installer, then we had some options:
- System Search View: The system search view provides the Windows Installer capability to search for a particular file, folder, registry key, .ini file, or .xml file value on an end user's sytem prior to installation. this view is location in the left pane of the Installshield IDE, as shown in the image below:
When you do right-click in the right pane as shown in the image below, a system Search Wizard opens which guides you to specify your search options for any Files, Folders, Registry Entries, and so on...
You can specify your options according to your requirement.
- Installscirpt Code: Another option we have is through installscipt code. We need to specify a key to search in registry. There are some in-built installscript functions which can help you in accessing registry details. One of such function of our use at the moment is RegDBKeyExist(szKeyRoot) which checks for the key in the registr yspecified by parameter szKeyRoot.
A typical example for your best understanding is given below which could check for existence of MS Office on the target machine.
szKeyRoot="SOFTWARE\Wow6432Node\Microsoft\Office\Word\\"; \\key to search in registry
// get the registry value
nResult = RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );
if (RegDBKeyExist (szKeyRoot) < 0) then
return FALSE;
else
return TRUE;
endif;
Hope the above content will be helpful to you. In case you have some query, then please feel free to put some comments on this post, or reply to me.
No comments:
Post a Comment