A new Flexera Community experience is coming on November 25th. Click here for more information.

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

Advertised Uninstall

CChong
By Level 11 Flexeran
Level 11 Flexeran
I have a deceptively easy sounding question that I have not been able to find an answer to. I am hoping someone here happens to already know the answer.
I deploy an MSI through GPO, when the user the application is assigned to is removed from the GPO AD runs an uninstall. I need to write a value to the registry during that uninstall. I have tried custom actions with REMOVE = ALL conditions but apparantly they don't run during an advertised uninstall and no custom actions run in the Advertised execute sequence, so how can I do this?
Thanks in advance for any help.
Mike
(4) Replies
CChong
By Level 11 Flexeran
Level 11 Flexeran
Mike, Have you tried running the custom action in InstallExecuteSequence table.
CChong
By Level 11 Flexeran
Level 11 Flexeran
It was the first thing I tried actually. The custom action just didn't run. The problem is the way the unistall is initiated. The GPO removes the application from the box by running an advertise uninstall. Presumably this should initiate the Install Execute sequence with a REMOVE = "ALL" condition but it doesn't. At the same time the files and folders are removed so something is happening. The documentation I saw stated that Custom Actions don't execute if place in the Advertise Exec sequence but apparantly they do just not very well.
I had to create a custom action to call a function from a custom DLL to add the reg key with local admin privleges. The msi uninstall was running with elevated privleges but these were not being passed to the write reg function.
CChong
By Level 11 Flexeran
Level 11 Flexeran
Another thing that I would like you to check is where your custom action is being sequenced in InstallExecuteSequence table. Make sure that your action is sequenced after the InstallValidate action in InstallExecuteSequence table. It is not guaranteed that REMOVE property to be set to ALL during uninstall before installer executes the InstallValidate action.
CChong
By Level 11 Flexeran
Level 11 Flexeran
I guess I haven't explained very clearly. I have no trouble getting the custom action to run when I either double click on the msi and runthrough the GUI or when I run it silently from the command line. It is only when AD runs the uninstall that there is a problem. I eventually determined the action was running it just wasn't working (Permissions Problem) and no error was being displayed, or for that matter showing up in the event log. The problem came down to the difference between an advertised uninstall and any other kind. Apparantly the elevated permissions are not passed to secondary processes like scripts. I don't know if this is true for InstallScript but I couldn't get a vbscript or exe to run with elevated permissions on an advertised uninstall. I eventually had to do the CreateProcessWithLogonW thing in a custom DLL to get it to work.
Thanks
Mike