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

CA not executing during add/remove programs

I have a custom action that I want to run during the uninstall. It's setup to run in the Install Exec Sequence, After Install Initialize, with the condition of REMOVE="ALL".

What it does is rename a folder on the system.

When I run the setup.exe from the command line using setup.exe /x, the CA executes fine, and everything uninstalls as I want it to.

However, when I uninstall through Add/Remove programs, I get the same error that I get when the CA doesn't run. (After installing the app, I rename a folder that got installed through a CA during the install. When I uninstall the app in this state, I get a network error saying it can't read the .msi file. If I rename the folder back to the original name it was installed as, the error goes away and everything uninstalls fine.)

I've tried putting the CA in the Admin Exec sequence as well with the same sequence and condition, but still no go.

Is there a difference between CA's running from the setup.exe vs. running the uninstall through Add/Remove programs?

Thanks for any help,
Mike
Labels (1)
0 Kudos
(5) Replies
TsungH
Level 12

You will need to provide additional info on your custom action, e.g., what it is doing, code snippet, etc.
0 Kudos
mmccue
Level 4

Okay. Here's the custom action.

It's a New EXE -> Path Referencing a Directory

The working directory is INSTALLDIR

The Filename and Command Line is "[INSTALLDIR]\res.bat remove"

(res.bat is a simple batch file that does some file renaming for me. When called with the "remove" parameter, it renames the INSTALLDIR\YourFolder to INSTALLDIR\MyFolder, that's it)

It's set to Synchronous (Ignore Exit Code), Immediate Execution, Always Execute.

Scheduled in the Install Exec Sequence, After InstallInitialize with the REMOVE="ALL" condition. (I've also tried it in the Admin Exec sequence at the same position).

Like I said, this all works fine if I run the uninstall off the msi or setup.exe from the command line. But fails to work if I just go into Add/Remove Programs and use the remove option there.

Thanks again for any help.
Mike
0 Kudos
TsungH
Level 12

One thing you can try is to turn on system policy and enable logging for all MSI setups, and run uninstall from Add/Remove Programs. The log may provide additional info on the error.
0 Kudos
mmccue
Level 4

Thanks for the reply, where can I do that? What policy is it?
0 Kudos
mmccue
Level 4

Nevermind, found the policy setting, got a log, and I think I found my problem 😉

Thanks for the help!
0 Kudos