Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Launch EXE through custom action and wait


5 replies to this topic

Andy Shand

Andy Shand
  • Members
  • 20 posts

Posted 26 March 2001 - 15:08

I've got 2 setups - an ISWi based one and a legacy ISPro one. Both will be shipped on CD.

I would like to run my ISWi setup and conditionally launch the ISPro setup (and wait for its finish). The ISPro setup is not a single file, so I don't think I can include it in the binary table.

Can I launch the ISPro based EXE from the install CD, rather than copy it and all its dependant files to a temporary directory on the target drive first ?

If so, what path variable can I read to get the source directory ?


Leigh Ravenhall

Leigh Ravenhall
  • Members
  • 269 posts

Posted 26 March 2001 - 23:33

I haven't actually tried it, but according to the documentation SOURCEDIR stores the the folder where the .msi is located.  This should be what you need.

AndrewWalker

AndrewWalker
  • Members
  • 42 posts

Posted 29 March 2001 - 17:42

SOURCEDIR is not reliable.  The best way to do this is to retrieve the value of the property SOURCEDIR, then use that value for the basis of where the install is running from.

Lucroy99

Lucroy99
  • Members
  • 1 posts

Posted 03 April 2001 - 16:21

This is commonly need functionality, and it surprises me that InstallShield has ignored this problem. I brought up this issue in the training classes and I hope it was returned to the developers.

This is one of the many of problems I have encountered with ISWI 2.1. Here is my solution.

1st
Create a Property to store your file information in. If you need to pass a command line you should use a property for that also.
Properties : CP_INSTALL_FILE
CP_INSTALL_FILE_COMMAND


2nd
Create an Install Script file. In this file you will set your properties. Here is an example for SQL Server silent install,

#include "isrt.h"
#include "iswi.h"

export prototype SetDir(HWND);  

function SetDir(hMSI)  
STRING svName, svSQL_Location, svSQL_SP3_Location, svCommandLine;
NUMBER nvSize, nResponse;

begin

   // Get the source directory
   nvSize = 256;
   MsiGetProperty (hMSI, "SOURCEDIR", svName, nvSize);
                     
   //Add the installation file information we need
   svSQL_Location = svName + "X86\\Setup\\SETUPSQL.exe";
   svCommandLine = "-f1 " + svName + "X86\\Setup\\setup.iss" + " -SMS -s";

// Set our Property
   MsiSetProperty(hMSI, " CP_INSTALL_FILE ", svSQL_Location);
   MsiSetProperty(hMSI, " CP_INSTALL_FILE_COMMAND ", svCommandLine);

end;


3rd
Create a custom that runs your install script.


4th
Create a custom action that launches an executable using the Properties you added.


5th
Insert these custom actions into your sequence


Leigh Ravenhall

Leigh Ravenhall
  • Members
  • 269 posts

Posted 04 April 2001 - 00:12

Why not call the executable from the Installscript you wrote in point number 2?  All it would require is LaunchAppAndWait(svSQL_Location, svCommandLine, WAIT)