This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Custom Action Launch Executable
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 02, 2009
03:30 PM
Custom Action Launch Executable
I'm having a bit of trouble launching an executable during my Basic MSI installation. Here is part of the script I use with the automation interface:
[code]
' Add vcredist executable separately to give us access to file key
Set dfl = compUtilMain.ISWiDynamicFileLinkings(1)
Set compVcRedist = project.AddComponent("VC_REDIST")
compVcRedist.Destination = "[INSTALLDIR]" & strProductDir & "\bin"
If arch = "32" Then
dfl.ExcludeFiles = "vcredist_x86.exe"
Set vcRedistExe = compVcRedist.addFile(strUtilsBin & "\vcredist_x86.exe")
Else
dfl.ExcludeFiles = "vcredist_x64.exe"
Set vcRedistExe = compVcRedist.addFile(strUtilsBin & "\vcredist_x64.exe")
End If
Set action = project.AddCustomAction("VC_REDIST")
action.ActionType = 18 ' Run exe using file installed with this MSI
action.Name = "VC_REDIST"
action.Source = vcRedistExe.Name
action.Target = ""
Set seq = project.InstallExecuteSequence
seqNum = 6500 ' between ScheduleReboot and InstallFinalize
seq.InsertCustomAction action, "MSVCREDIST", "1", seqNum
Set featUtil = project.AddFeature("UTILS")
featUtil.AttachComponent(compVcRedist)
[/code]
The log:
[code]
MSI (s) (18:24) [14:37:23:082]: Doing action: VC_REDIST
Action 14:37:23: VC_REDIST.
Action start 14:37:23: VC_REDIST.
MSI (s) (18:24) [14:37:23:098]: Note: 1: 1721 2: VC_REDIST 3: C:\Program Files\ESI_Software\UTILS_2009.2\bin\vcredist_x86.exe 4:
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: VC_REDIST, location: C:\Program Files\ESI_Software\UTILS_2009.2\bin\vcredist_x86.exe, command:
MSI (s) (18:24) [14:37:45:332]: Product: CFD-UTILS 2009.2 -- 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: VC_REDIST, location: C:\Program Files\ESI_Software\UTILS_2009.2\bin\vcredist_x86.exe, command:
Action ended 14:37:45: VC_REDIST. Return value 3.
[/code]
I've already tried using executable/property (didn't seem to understand [INSTALLDIR]) and executable/directory (error about directory database being uninitialized). I realize this could probably be done with a merge module, but my employer does not want to send out an executable, only an msi.
Any help would be appreciated.
[code]
' Add vcredist executable separately to give us access to file key
Set dfl = compUtilMain.ISWiDynamicFileLinkings(1)
Set compVcRedist = project.AddComponent("VC_REDIST")
compVcRedist.Destination = "[INSTALLDIR]" & strProductDir & "\bin"
If arch = "32" Then
dfl.ExcludeFiles = "vcredist_x86.exe"
Set vcRedistExe = compVcRedist.addFile(strUtilsBin & "\vcredist_x86.exe")
Else
dfl.ExcludeFiles = "vcredist_x64.exe"
Set vcRedistExe = compVcRedist.addFile(strUtilsBin & "\vcredist_x64.exe")
End If
Set action = project.AddCustomAction("VC_REDIST")
action.ActionType = 18 ' Run exe using file installed with this MSI
action.Name = "VC_REDIST"
action.Source = vcRedistExe.Name
action.Target = ""
Set seq = project.InstallExecuteSequence
seqNum = 6500 ' between ScheduleReboot and InstallFinalize
seq.InsertCustomAction action, "MSVCREDIST", "1", seqNum
Set featUtil = project.AddFeature("UTILS")
featUtil.AttachComponent(compVcRedist)
[/code]
The log:
[code]
MSI (s) (18:24) [14:37:23:082]: Doing action: VC_REDIST
Action 14:37:23: VC_REDIST.
Action start 14:37:23: VC_REDIST.
MSI (s) (18:24) [14:37:23:098]: Note: 1: 1721 2: VC_REDIST 3: C:\Program Files\ESI_Software\UTILS_2009.2\bin\vcredist_x86.exe 4:
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: VC_REDIST, location: C:\Program Files\ESI_Software\UTILS_2009.2\bin\vcredist_x86.exe, command:
MSI (s) (18:24) [14:37:45:332]: Product: CFD-UTILS 2009.2 -- 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: VC_REDIST, location: C:\Program Files\ESI_Software\UTILS_2009.2\bin\vcredist_x86.exe, command:
Action ended 14:37:45: VC_REDIST. Return value 3.
[/code]
I've already tried using executable/property (didn't seem to understand [INSTALLDIR]) and executable/directory (error about directory database being uninitialized). I realize this could probably be done with a merge module, but my employer does not want to send out an executable, only an msi.
Any help would be appreciated.
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 02, 2009
07:13 PM
One thing to verify for a custom action launching a file that you're installing is that the action is scheduled for deferred execution (after InstallFiles if during the initial installation, and before RemoveFiles during uninstallation); so you might need to touch up the ActionType field...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 03, 2009
10:14 AM
OK, I made the change. Now the action type is 18+1024. But it still runs during the MSI installation, and the executable complains that another installation is running. It needs to run after my installation completes. Is that even possible?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 03, 2009
05:58 PM
Correct, only one deferred Execute sequence can run at a time. Normally you would handle this with a prerequisite, perhaps feature-based, but that requires setup.exe. A shabby option might be (I haven't tried it) to launch the EXE in immediate mode after InstallFinalize, but there are privileges and other potential issues there.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 03, 2009
07:24 PM
That gives the same error. I will try to convince them to allow me to use setup.exe.
The Visual C++ merge modules should be equivalent, correct? I'm not sure what the Policy ones are. Should I include those as well?
Thanks.
The Visual C++ merge modules should be equivalent, correct? I'm not sure what the Policy ones are. Should I include those as well?
Thanks.