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

Deleting Files Used Only for Installation

In my MSIs, I have an executable file that runs after the MSI files have been installed, and it's sole purpose is to do some work during the installation, but then is no longer needed.

What do I need to do to remove that .exe after it's done it's work? Would I need to create an InstallScript to remove it or is there some easier way?

Pardon my ignorance on this as I'm not an InstallShield expert. 😮
Labels (1)
0 Kudos
5 Replies
BrHartmann
Level 7

I have a similar scenario, and I include the exe as a support file (these should be cleaned up automatically at the end of install).

This works more easily if your project is Installscript-MSI ... then call the exe in your OnFirstUIAfter event (before showing the Finish dialog) - it sounded like you need some other files installed before running this temporary exe.

I can get a bit trickier with Basic MSI - if this is the case and you run into problems, I can go into more detail about this scenario.
0 Kudos
rrinblue22
Level 9

Hey it does work fine in Basic MSI as well.
Only thing to remember would be
If your custom action that triggers the exe in support files is set to Deferred, you'll have to use Custom Action Data to access public property SUPPORTDIR.

this is doable using InstallScript custom action.
0 Kudos
OneDayBehind
Level 4

Yes, I'm using a Basic MSI project. I just got the folder delete working with the help of this HelpNet article:

Accessing or Setting Windows Installer Properties Through Deferred, Commit, and Rollback Custom Actions

The script sample in the link above allowed me to retrieve the path to the folder where I installed the .exe. I then used the DeleteDir() function to delete the folder the .exe was installed in. Yeah me.
0 Kudos
Tim_Mayert
Level 9

Is there any way to use a standard "launch an executable" custom action to launch an executable that has been placed into the SUPPORTDIR without using and InstallScript?

We have an executable and supporting files that need to be triggered during the install and once they are complete need to be removed. So I figured that I would look at the SUPPORTDIR to place these files so they are removed when the install is done, but if I can not call/execute them from a basic MSI without InstallScript then I may have to use a custom action just to delete these file at the end.
0 Kudos
KathyMorey
Level 10

Have you tried including the files in the binary table? They can then be accessed by the MSI CA's, and since they aren't installed, they don't have to be removed.
0 Kudos