RubenRybnick
Posts: 1
Joined: Tue Sep 27, 2016 3:41 pm

Custom Action, run a .exe File

Hey,

i have a simple .exe File that i want to be run, but not saved on the Target Computer.

I made a Custom Action >>> Laucn attached file and attached the file, but it does not work. When i run the .msi there is a error. The error says "There is a problem with this Windows Installer package. A programm required for this install to complete could not be run. Contact....

What is wrong? Why cant i simple attach a .exe and run it? Can you help pls?
ans
Posts: 17
Joined: Tue Jul 26, 2011 9:06 pm

Re: Custom Action, run a .exe File

Possibly, the exe might return a result code other than zero?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Custom Action, run a .exe File

Hello and welcome to our forums,

From your description it seems you selected the correct custom action according to your project specs (the EXE application file must not be saved on target machine).

As "ans" suggested, the issue here might be the code your application (your EXE file) returns to the Windows Installer. A custom action return code 0 means the application completed with success. Any other return code Windows Installer will interpret as failure.

So, in order to address the issue you can use one of the following solutions:
1. On your “Launch attached file” custom action properties page you uncheck the “Wait for return code at the end of the sequence”, in this case Windows Installer will ignore the exit code returned by your application.
2. You can rebuild the application you run in custom action to return code 0 on success, so Windows Installer doesn't throw any error.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”