Removing envrionment variable on uninstall - Advanced Installer Community
Larry Leonard
Posts: 5
Joined: Thu May 29, 2014 4:32 pm

Removing envrionment variable on uninstall

Hi there,
I am testing a custom action to send WM_SETTINGCHANGE message to try and propagate a new/changed environment variable. The CA works fine for setting the variable on initial run and re-runs, but I'm having a problem where the variable os still there after a successful/completed uninstall.

The environment variable is set to 'Remove on uninstall' and I have added the WM_SETTINGCHANGE CA action to all of the Finish button Published Events.

Below are some snippets from a log:

Code: Select all

Action 14:22:39: RemoveEnvironmentStrings. Updating environment strings
MSI (s) (CC:20) [14:22:39:759]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=13200)
MSI (s) (CC:20) [14:22:39:759]: Executing op: UpdateEnvironmentStrings(Name=LOOK_TEST,Value=Your Value,Delimiter=[~],Action=536870916,)
RemoveEnvironmentStrings: Name: LOOK_TEST, Value: Your Value, Action 536870916
MSI (s) (CC:20) [14:22:39:759]: Executing op: ActionStart(Name=RemoveFiles,Description=Removing files,Template=File: [1], Directory: [9])

Code: Select all

MSI (c) (90:5C) [14:22:39:900]: Doing action: ExitDialog
Action 14:22:39: ExitDialog. 
Action start 14:22:39: ExitDialog.
Info 2826. Control BottomLine on dialog ExitDialog extends beyond the boundaries of the dialog to the right by 3 pixels.
Action 14:22:39: ExitDialog. Dialog created
MSI (c) (90:98) [14:22:40:851]: Doing action: SettingChanged
Action 14:22:40: SettingChanged. 
Action start 14:22:40: SettingChanged.
MSI (c) (90:1C) [14:22:40:851]: Invoking remote custom action. DLL: C:\Users\leonardl\AppData\Local\Temp\MSI2C8B.tmp, Entrypoint: _SettingChanged@4
Action ended 14:22:41: SettingChanged. Return value 1.
Action ended 14:22:41: ExitDialog. Return value 1.
Action ended 14:22:41: INSTALL. Return value 1.
MSI (c) (90:5C) [14:22:41:132]: Destroying RemoteAPI object.
MSI (c) (90:C0) [14:22:41:132]: Custom Action Manager thread ending.
I am sure that I am missing something simple, so any tips appreciated.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Removing envrionment variable on uninstall

Hi Larry,

The removal of an environment variable is triggered by the removal of a component from the package. To identify the component select your environment variable
and press F8.

Now, use the component name or GUID to search it in the uninstall verbose log. There you can see if the component is correctly uninstalled or skipped from removal.

There is no need to send the WM_SETTINGCHANGE message on uninstall. This message is sometimes used on install to make the installer aware of the own variables
that it creates, because you need to use it later on during the installation. Since on uninstall you don't want to use it, this message is no longer required.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”