[wix-users] How to modify registry in Custom Action(s)

Edwin Castro egcastr at gmail.com
Mon Jun 11 06:36:54 PDT 2018


There is not enough information here to determine why your custom action
doesn't "work" in deferred mode. What does the verbose log say?

I would suggest your extension simply populate the Registry table. You
could do that at compile time or in an immediate custom action.

If you keep your custom actions, then you should schedule your uninstall
custom actions *after* StopServices as that is the opposite of before
StartServices.

You should also implement a rollback action for uninstall.

Really all of these considerations simply go away if you instead populate
the Registry table and let the Windows Installer handle it for you.

--
Edwin G. Castro

On Mon, Jun 11, 2018, 05:46 Ivanov Ivan via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> Hi all,
>
> I want to write a Wix Extension, which provides an ability to add
> something to the registry on install, and remove it on uninstall.
> But 'deferred' Custom Action, which should be the right point to modify
> the registry, does not do the work. Registry does not get updated.
> I am only able to modify the registry during 'immediate' CA.
> What's wrong?
>
> <Fragment>
>
>     <CustomAction Id="RegEditPrepare" BinaryKey="Some.CA"
> DllEntry="RegEditPrepare"
>                   Execute="immediate" Impersonate="no" HideTarget="yes" />
>
>     <CustomAction Id="RegEditPrepareUninstall" BinaryKey="Some.CA"
> DllEntry="RegEditPrepare"
>                   Execute="immediate" Impersonate="no" HideTarget="yes" />
>
>     <CustomAction Id="RegEditExecute" BinaryKey="Some.CA"
> DllEntry="RegEditExecute"
>                   Execute="deferred" Impersonate="no" HideTarget="yes" />
>
>     <CustomAction Id="RegEditRollback" BinaryKey="Some.CA"
> DllEntry="RegEditRollback"
>                   Execute="rollback" Impersonate="no" HideTarget="yes" />
>
>     <CustomAction Id="RegEditUninstall" BinaryKey="Some.CA"
> DllEntry="RegEditUninstall"
>                   Execute="deferred" Impersonate="no" HideTarget="yes" />
>
>     <InstallExecuteSequence>
>       <Custom Action="RegEditPrepare" Before="RegEditExecute">
>         NOT Installed
>       </Custom>
>
>       <Custom Action="RegEditExecute" Before="StartServices">
>         NOT Installed
>       </Custom>
>
>       <Custom Action="RegEditRollback" Before="RegEditExecute">
>         NOT Installed
>       </Custom>
>
>       <Custom Action="RegEditPrepareUninstall" Before="RegEditUninstall">
>         REMOVE~="ALL"
>       </Custom>
>
>       <Custom Action="RegEditUninstall" Before="StartServices">
>         REMOVE~="ALL"
>       </Custom>
>
>     </InstallExecuteSequence>
>
>   </Fragment>
>
> Thank you in advance
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>


More information about the wix-users mailing list