cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted

InstallScript Project Registry

How to delete a registry key during installation and during uninstall ?

HCKU\SOFTWARE\MyProgram
HKLM\SOFTWARE\MyProgram
HKLM\Wow6432Node\MyProgram

P.S

Nothing found how to do it !
Labels (1)
0 Kudos
11 Replies
Highlighted
Pilgrim

Re: InstallScript Project Registry

Installscript:

export prototype RemoveRegistry(HWND);

function RemoveRegistry(hMSI)

begin
RegDBSetDefaultRoot(HKEY_CURRENT_USER); //Set Root key
RegDBDeleteKey("SOFTWARE\\MyProgram"); //Delete Key

RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); // Change Root key
RegDBDeleteKey("SOFTWARE\\MyProgram"); //Delete Key

REGDB_OPTIONS = REGDB_OPTION_WOW64_64KEY; //Set root key to look in the 64bit part of the registry
RegDBDeleteKey("SOFTWARE\\MyProgram"); //Delete Key
end;


Then create a custom action to point to this Installscript function and run it on install and uninstall
0 Kudos
Highlighted

Re: InstallScript Project Registry

PlinyElder wrote:
Installscript:

export prototype RemoveRegistry(HWND);

function RemoveRegistry(hMSI)

begin
RegDBSetDefaultRoot(HKEY_CURRENT_USER); //Set Root key
RegDBDeleteKey("SOFTWARE\\MyProgram"); //Delete Key

RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); // Change Root key
RegDBDeleteKey("SOFTWARE\\MyProgram"); //Delete Key

REGDB_OPTIONS = REGDB_OPTION_WOW64_64KEY; //Set root key to look in the 64bit part of the registry
RegDBDeleteKey("SOFTWARE\\MyProgram"); //Delete Key
end;


Then create a custom action to point to this Installscript function and run it on install and uninstall



How to create a custom action ?
0 Kudos
Highlighted

Re: InstallScript Project Registry

Error C8079
0 Kudos
Highlighted
Pilgrim

Re: InstallScript Project Registry

Bajuyngaonau1 wrote:
How to create a custom action ?


Custom Actions and Sequences under the Behavior and Logic section. Create an Installscript custom action and assign it to your installscript function.

My example script is written in Installshield 2014 but i dont think it should have problems running in IS2015
0 Kudos
Highlighted

Re: InstallScript Project Registry

PlinyElder wrote:
Custom Actions and Sequences under the Behavior and Logic section. Create an Installscript custom action and assign it to your installscript function.

My example script is written in Installshield 2014 but i dont think it should have problems running in IS2015



This is not present there is only Basic MSI Project
0 Kudos
Highlighted

Re: InstallScript Project Registry

What to do ?
0 Kudos
Highlighted

Re: InstallScript Project Registry

Can you give me a script?
0 Kudos
Highlighted
Pilgrim

Re: InstallScript Project Registry

Oh i see that you are using and Installscript project so yes you wont see a spot for Custom Actions.

You will have to manually insert the installscript code into the installer sequence. All that is under the Installscript section. You can select the OnBegin and OnUninstall selections in the drop down menu and set your required actions

Or use the Registry option under the System Configuration section
0 Kudos
Highlighted

Re: InstallScript Project Registry

I give up ! Here is my script !
0 Kudos