PDA

View Full Version : How To Add Registry Entry While Uninstalling The Product?



soumya6.b
04-09-2009, 09:16 AM
Guys Can Anyone Help Me With Adding A Registry Key While Uninstalling The Product...thanks In Advance.......

soumya6.b
04-13-2009, 05:17 AM
guys please help....waiting for your solutions.....

Nil_Developer
04-14-2009, 04:28 AM
Hi,

Which project you are using ? (Install script/Basic MSI)


Best Regards
Nil.

soumya6.b
04-20-2009, 07:29 AM
it's basic msi type

soumya6.b
04-23-2009, 05:37 AM
help please......need the solution urgently............

sandeep.madhu14
04-23-2009, 08:24 AM
Hi sowmya,

Once chk this following code i think it will help you.. using the following code we can set the registry values..
still if u did not get solution letme know i will provide you the solution..

u can mail to me sandeep.madhu14@hotmail.com..if you have any problem ..



#define COMPANY_NAME "ExampleCompany"

#define PRODUCT_NAME "ExampleProduct"

#define VERSION_NUMBER "5.00.00"

#define PRODUCT_KEY "EXAMPLE.EXE"

#define DEINST_KEY "ExampleDeinstKey"

#define APP_DEF_LOG_PATH "C:\\EXAMPLE\\TEMP"

#define APP_PATH "C:\\EXAMPLE"

#define APP_DEF_PATH "C:\\EXAMPLE\\TARGET"

#define UNINSTALL_NAME "ExampleUninstallName"

#define TITLE "RegDBSetItem Example"


// Include Ifx.h for built-in InstallScript function prototypes.

#include "Ifx.h"


export prototype ExFn_RegDBGetItem(HWND);


function ExFn_RegDBGetItem(hMSI)

STRING svLogFile, svValue, szTitle;

begin


// Set the root key.

RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);


// Set installation and uninstallation information in

// order to call RegDBSetItem and RegDBGetItem.

InstallationInfo (COMPANY_NAME, PRODUCT_NAME, VERSION_NUMBER, PRODUCT_KEY);

DeinstallStart (APP_DEF_LOG_PATH, svLogFile, DEINST_KEY, 0);


// Set the value of the application path key in the

// registry to the value of szAppPath.

if (RegDBSetItem (REGDB_APPPATH, APP_PATH) < 0) then

MessageBox ("Unable to set application path key.", SEVERE);

else

SprintfBox (INFORMATION, TITLE, "RegDBSetItem set the application " +

"path key to %s.", APP_PATH);

endif;


// Set the value of the application default path key in

// the registry to the value of szAppDefPath.

if (RegDBSetItem(REGDB_APPPATH_DEFAULT, APP_DEF_PATH) < 0) then

MessageBox ("Unable to set application default path key.", SEVERE);

else

SprintfBox (INFORMATION, TITLE, "RegDBSetItem set the application " +

"default path key to %s.", APP_DEF_PATH);

endif;


// Set the value of the uninstall name key in the

// registry to the value of szUninstallName.

if (RegDBSetItem (REGDB_UNINSTALL_NAME, UNINSTALL_NAME) < 0) then

MessageBox ("Unable to set uninstall name key.", SEVERE);

else

SprintfBox (INFORMATION, TITLE, "RegDBSetItem set the uninstall " +

"name key to %s.", UNINSTALL_NAME);

endif;


// Set up title parameter for call to SprintfBox.

szTitle = "RegDBGetItem";


// Get the value of the application path key from the registry.

if (RegDBGetItem (REGDB_APPPATH, svValue) < 0) then

MessageBox ("Unable to get value of application path key.", SEVERE);

else

SprintfBox (INFORMATION, TITLE, "RegDBGetItem retrieved the value " +

"of the application path key: %s.", svValue);

endif;


// Get the value of the application default path key in

// the registry.

if (RegDBGetItem (REGDB_APPPATH_DEFAULT, svValue) < 0) then

MessageBox ("Unable to get application default path key", SEVERE);

else

SprintfBox (INFORMATION, TITLE, "RegDBGetItem retrieved the value " +

"of the application default path key: %s.", svValue);

endif;


// Get the value of the uninstall name key from the registry.

if (RegDBGetItem (REGDB_UNINSTALL_NAME, svValue) < 0) then

MessageBox ("Unable to get application uninstall name key.", SEVERE);

else

SprintfBox (INFORMATION, TITLE, "RegDBGetItem retrieved the value " +

"of the uninstallation name key: %s.", svValue);

endif;


end;

thanks
madhu

soumya6.b
04-24-2009, 09:37 AM
it's not installscript type.it's rather basic Installshield MSI type project.