Monday, April 12, 2010

Delete Registry key using Install Script

Delete Registry key using Install Script.

Here is the function you can use to delete a registry key in InstallShield project.


function DeleteRegisrtyKey(szKey)

STRING szClass;

begin

try

RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );

szKey="SOFTWARE\\"+szKey;

WriteLog("Trying to delete registry value for "+szKey);

szClass = "FPClass";

if (RegDBKeyExist(szKey) < 0) then

WriteLog(szKey +" can not be located in the registry. Deletion failed.");

MessageBox("Unable to delete the registry "+szKey,INFORMATION);

else

if (RegDBDeleteKey (szKey) < 0) then

WriteLog("Failed to delete the Registry.");

else

WriteLog("Registry successfully deleted.");

endif;

endif;

catch

WriteErrorLog("Exception during deleting the registry key. The key is: "+szKey);

endcatch;

end;

1 comment:

tenax_technologies said...

Java Platform, Enterprise Edition (Java EE) is the industry-standard platform for building enterprise-class applications coded in the Java programming language. Based on the solid foundation of Java Platform, Standard Edition (Java SE), Java EE adds libraries and system services that support the scalability, accessibility, security, integrity, and other requirements of enterprise-class applications. java software company