2

Suppose, I have the following folders structure:

c:\Test\setup.exe (this is main installation launcher)

c:\Test\Feature1\setup.exe (Installation of feature1)

c:\Test\Feature2\setup.exe (Installation of feature2)

I created customized InstallShield Dialog in main installation launcher where user can click on appropriate button and run Installation of Feature1 or Feature2. I do it using InstallScript LaunchAppAndWait() function. So, my question is - how can I do it using relative paths?

For example:

LaunchAppAndWait("c:\\Test\\Feature1\\setup.exe", "", LAAW_OPTION_WAIT) - it works.
LaunchAppAndWait("Feature1\\setup.exe", "", LAAW_OPTION_WAIT) - doesn't work.
AndreyS
  • 365
  • 7
  • 18

1 Answers1

1

First off, for scenarios like this, I would typically recommend creating a Suite/Advanced UI project. Once you do that, you can directly associate packages (your included setup.exe files, for example, but the underlying .msi or .hdr files are better choices) with features of the Suite that you're installing.

But assuming that's too large of a change for you, or a bad fit for some other reason, you should be able to create an absolute path that adjusts to where your setup is running. Do this by referencing either PACKAGE_LOCATION if this is an InstallScript wrapper project, or the property SETUPEXEDIR if this is a Basic MSI or InstallScript MSI wrapper project. Assuming the former, it would look something like this:

LaunchAppAndWait(PACKAGE_LOCATION ^ "Feature1\\setup.exe", "", LAAW_OPTION_WAIT);

For the latter, the final step would look similar, but you would first have to retrieve the value of SETUPEXEDIR using MsiGetProperty.

Michael Urman
  • 15,737
  • 2
  • 28
  • 44
  • Thank you, Michael. My project type is Basic MSI, so MsiGetProperty(hMSI, "SETUPEXEDIR", ...) resolved my problem. – AndreyS Jul 30 '13 at 13:50