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

Basic MSI project - custom action - execute from path - does this work ?

Hi,

I am new to InstallShield and am struggling massively with the quality of documentation, so am hoping that I can find help within this forum.

I have created a Basic MSI project.
I can happily manage to get applications installed, along with .Net as a prerequisite.

I have tried to call an external executable using a custom action that is triggered after "InstallFinalize", however, no matter what I try, it fails with error 1721.
I have now tried to simply run the "dir" command and redirect to a file... this gives the same error.
Could somebody please tell me if I am misunderstanding what this custom action is able / supposed to do and whether I am doing something stupid, and if so, what I should actually do to achieve this.

Snippet from Log output.....

Action ended 14:22:50: InstallFinalize. Return value 1.
MSI (s) (48:F0) [14:22:50:705]: Doing action: MY_executeFromPath
Action 14:22:50: MY_executeFromPath.
Action start 14:22:50: MY_executeFromPath.
MSI (s) (48:F0) [14:22:50:709]: Note: 1: 1721 2: MY_executeFromPath 3: C:\Users\Public\AppData\Local\Temp\ 4: "dir > 123.txt"
Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: MY_executeFromPath, location: C:\Users\Public\AppData\Local\Temp\, command: "dir > 123.txt"
MSI (s) (48:F0) [14:22:56:691]: Product: IRIS 2015 -- Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: MY_executeFromPath, location: C:\Users\Public\AppData\Local\Temp\, command: "dir > 123.txt"

Action ended 14:22:56: MY_executeFromPath. Return value 3.
Action ended 14:22:56: INSTALL. Return value 3.


Many thanks

mark
Labels (1)
0 Kudos
(3) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

There are differences between what you can run at a command prompt, and what you can run through the API CreateProcess. Custom actions in Windows Installer use the latter, and it doesn't support redirection or the commands built into cmd.exe (like dir) that are not executables. Sometimes you can call cmd.exe to do your dirty work, for example, set up your package to run: [SystemFolder]cmd.exe /c "dir > 123.txt"
0 Kudos
mark_123
Level 2

Hi Michael,

Thanks for your reply.

To give you a bit of background. I initially tried installing SQL express 2014 via the Redistributable view. This went through the process of extracting & installing but ultimately failed with

"The installation of Microsoft SQL Server 2014 Express RTM (x64) appears to have failed."

So I tried to run the SQL install via the custom action, giving "Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run."

This is frustrating as if I amend my custom action, replacing "[INSTALLDIR]SQLEXPR_x64_ENU.exe" with "[INSTALLDIR]myTest.exe" , everything works without fault.
I have even tried extracting from SQLEXPR_x64_ENU.exe and running the setup.exe directly "[INSTALLDIR]SQLEXPR_x64_ENU\setup.exe" but this too fails.

Is there anyway I can get this to work ?

Thanks.

mark
0 Kudos
hidenori
Level 17

Regarding to the failure of the Microsoft SQL Server 2014 Express prerequisite installation, have you checked out this thread? Also if you are installing a named instance besides the default instance; SQLEXPRESS, make sure that you have updated the prerequisite's condition as to detect the named instance that you are trying to install. The built-in Microsoft SQL Server 2014 Express prerequisites are designed to install the default instance and check for the following registry key to detect the product:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SQLEXPRESS\MSSQLServer\CurrentVersion


If the registry key does not exist after the Microsoft SQL Server 2014 Express setup completed, the prerequisite thinks it failed to install.

I hope that helps.
0 Kudos