- Revenera Community
- :
- InstallShield
- :
- InstallShield Knowledge Base
- :
- Deleting a 64 bit Windows Registry Entry via an InstallScript Custom Action
- Mark as New
- Mark as Read
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Deleting a 64 bit Windows Registry Entry via an InstallScript Custom Action
Deleting a 64 bit Windows Registry Entry via an InstallScript Custom Action
Summary
Delete a 64 bit created registry using installscript Customaction
Cause
When user try to delete a registry using installscript Custom action by default it will check under WOW6432 location and it will fail to delete the registry
Resolution
To delete a 64 bit registry using installscript first we should disable wow64 redirection,
#define TITLE_TEXT "RegDBDeleteKey Example"
// Include Ifx.h for built-in InstallScript function prototypes.
#include "Ifx.h"
export prototype ExFn_RegDBDeleteKey(HWND);
function ExFn_RegDBDeleteKey(hMSI)
STRING szKey, szMsg, svLogFile;
begin
REGDB_OPTIONS =REGDB_OPTIONS | REGDB_OPTION_WOW64_64KEY;
Disable(WOW64FSREDIRECTION);
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
szKey = "SOFTWARE\\ISTest";
//RegDBDeleteKey ("SOFTWARE\\ISTest") ;
if (RegDBDeleteKey (szKey) < 0) then
MessageBox ("RegDBDeleteKey failed.", SEVERE);
else
SprintfBox (INFORMATION, TITLE_TEXT, "%s successfully deleted.", szKey);
endif;
Enable(WOW64FSREDIRECTION);
end;
Reference:
Click here for more information about the InstallScript REGDB_OPTIONS function.
Click here for more information about the InstallScript Enable function.
Click here for more information about the InstallScript Disable function.
A ZIP file containing a sample project is attached. The sample project is configured to execute the InstallScript custom action during the Execute Sequence of the install with a condition of REMOVE=ALL . The condition configures the custom action to only run during Uninstallation