cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
soumya6_b
Level 4

How To Add Registry Entry While Uninstalling The Product?

Guys Can Anyone Help Me With Adding A Registry Key While Uninstalling The Product...thanks In Advance.......
Labels (1)
0 Kudos
(6) Replies
soumya6_b
Level 4

guys please help....waiting for your solutions.....
0 Kudos
Nil_Developer
Level 3

Hi,

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


Best Regards
Nil.
0 Kudos
soumya6_b
Level 4

it's basic msi type
0 Kudos
soumya6_b
Level 4

help please......need the solution urgently............
0 Kudos
sandeep_madhu14
Level 6

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
0 Kudos
soumya6_b
Level 4

it's not installscript type.it's rather basic Installshield MSI type project.
0 Kudos