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

Running an EXE during uninstall

Researched it heavily - still having problems.

I want to run an exe which the Installer originally put down, upon uninstallation (silent & UI), and I need the exe to itself be uninstalled.

I have my Custom Action and the Conditions are copied over from our previous Wise Installer, which is working correctly. So the Condition to check for just uninstall is right.

I can't deduce from the Wise install source tables what to set for the following CA properties. (In Wise, it is in the InstallExecuteSequence table after the 'StopServices' Action):

1) In-Script Execution (I tried both Immediate Execution & Deferred Execution)

2) Execute Scheduling (I assume this has to be 'Execute Only Once'

3) Install Exec Sequence. (I've tried many values, particularly 'After InstallFiles' but they don't work. I've also tried 'AfterInitialize' but get a Warning)

The exe never runs, and it is also left behind and not removed.

Thanks for any assistance. I'm finding the Sequencing of CA's in MSI a bit confusing.
Labels (1)
0 Kudos
(8) Replies
mlerch
Level 6

Ok, I copied the values directly over from the previous CustomAction table.

Type = 162
Source = INSTALLDIR
Target = [INSTALLDIR]MyExe.exe

That Type shows:

Asyncronous (waits for exit code)
Immediate Execution
Always Execute
Absent from Install UI Sequence
Install Exec Sequence - After StopServices.

It now runs, but is not removed afterwards.
0 Kudos
Sairen
Level 7

You probably want to consider changing it from Immediate to Deferred execution, since that's where actions that modify the target computer are recommended to go.

Then, since StopServices and your CA are before RemoveFiles, you can add an entry in RemoveFiles to delete the exe. Look in the Direct Editor for this table.

Hope that helps. If not, write back. 🙂
0 Kudos
RobertDickau
Flexera Alumni

An additional option might be to make the action synchronous, to make sure the EXE is done running before trying to remove it...
0 Kudos
SaberRider
Level 5

Hi,

mlerch, what type of project do you use?
I hardly try to run an EXE during unistallationprocess, too. But it doesn't work, even with your settings.
I'm using a Basic MSI Script and I'm close to insanity because I can't get it to work :eek:
0 Kudos
mlerch
Level 6

Hi SaberRider,

I had to manually edit the CustomActions table to get the right result.

Here are the columns and their values:

Action: RunMyExecutablePlease
Type: 162
Source: INSTALLDIR
Target: [INSTALLDIR]ExecutableToRun.exe "my params for the exe"

In the Behavior and Logic > Custom Actions and Sequences view you'll see that Type 162 gives Asynchronous (Wait), Immediate Execution, Always Execute.

Then I have it from the Install UI Sequence, and in the Install Exec Sequence I have it "After ProcessComponents"

This is the only way it works for me. I copied these CustomComponent table values directly from our previous msi table. This stuff will drive you to drink, no doubt about it.

Mark
0 Kudos
mlerch
Level 6

p.s. - sorry, I didn't answer your question.

I use "Basic MSI" as my project type.
0 Kudos
SaberRider
Level 5

Hi,

thank you a lot for your reply... 🙂

Unfortunatelly I'm running in an other error, saying that [INSTALLDIR] (or any other dir I tried) is not part of the "foldertable" ( sorry, got the german version running and I don't know the correct english errormesssage). Any idea about this?

thx again & greetings from germany,
Gøran
0 Kudos
mlerch
Level 6

I don't know. There isn't a Folder table. Maybe the translation meant the "Directory" table? If so have you looked in there?

If you are manually editing the Tables I highly recommend the excellent Microsoft Windows Installer SDK help file. I don't have a link but you can google it. It gives a complete reference of all the tables, their columns, purpose and so on.

You want to be very careful poking around in there, as there are primary keys, foreign key references and so on. You don't want to mess it up.

Having said that, for my purposes, I'm finding it absolutely essential to work directly with the tables.

I'm still very new to this.

Mark
0 Kudos