thomasoatman
Posts: 9
Joined: Tue Dec 13, 2011 3:50 pm

Install a prerequisite installation into my appdir

Fri Apr 20, 2012 12:46 am

Hi. Hard to title this.

My product requires a certain prerequisite which I have setup as feature-based. so far so good.
But I would also like to leave this prerequisite behind for my users to deploy along with my components -- so I would like to install the install :-)

I can add the prerequisite msi as a file just like any other; but then it is included twice (once as a prereq and once as a file to install) - making my exe super huge.

I thought I could just add a FileCopy to copy from the temp folder into my target folder, but it appears the prerequisite msi is not extracted unless it is actually needed - so it isn't always available for copy.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Install a prerequisite installation into my appdir

Fri Apr 20, 2012 11:41 am

Hi,

It is not possible to obtain your desired behavior using the "Prerequisites" feature. However, if you want to obtain this behavior you should add your .msi prerequisite file in your package and then launch it through a "EXE with Working Dir" custom action. Also, you can condition the execution of this custom action using a "New Extended Search".

In order to obtain that you want this is what you should do:
- in "Files and Folders" view add the .msi file (your prerequisite, i.e MyPrereq.msi) to your package
- from the "Search" page create a "New Extended Search" (i.e. MY_LAUNCH_CONDITION) and in the "Extended Search Properties" pane choose your search criteria (i.e set the "Criteria" field to "Product Version (identify by Upgrade Code)" and in the "Upgrade Code" field put your prerequisite Upgrade Code)
- in the "Custom Action" page add a "EXE with Working Dir" custom action
- drag it in under "Finish Dialogs Stage"
- set the "Full Path:" field to

Code: Select all

msiexec /i "[#MyPrereq.msi]"
- set the "Condition" field to

Code: Select all

NOT LAUNCH_CONDITION
- uncheck "Maintenance" and "Uninstall" checkboxes
-build and run your package

I have also attached a sample project with this scenario.
InstallInstall.aip
(9.48KiB)Downloaded 586 times
If you have any questions let me know.

Regards,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

thomasoatman
Posts: 9
Joined: Tue Dec 13, 2011 3:50 pm

Re: Install a prerequisite installation into my appdir

Fri Apr 20, 2012 3:12 pm

Wow. Thanks for the excellent information Daniel !
In my case, this truly is a Prerequisite that must be installed before my components can be registered, so I can't wait until the Finish stage to run it.
I tried calling out to the msi during the Install sequence and it says "another installation is in progress" so that obviously won't work :roll:

-thomas

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Install a prerequisite installation into my appdir

Mon Apr 23, 2012 10:46 am

Hi Thomas,

If you need that your prerequisite to be installed before your packet installation then this is what you should do:
- In "Files and Folders" view add the .msi file (your prerequisites, i.e MyPrereq.msi) as a temporary file to your package.
- Select the file and from its context menu choose "Properties..." option. In the new dialog enable "Do not remove the file when setup ends" option.
- Now drag the file from "Temporary" folder to "Application Folder".
- If you want to copy a temporary file in "Application Folder" you should have elevation rights during Wizard dialogs stage. So, from "Install Parameters" page enable "Run as administrator" option.
- From the "Search" page create a "New Extended Search" (i.e. MY_LAUNCH_CONDITION) and in the "Extended Search Properties" pane choose your search criteria (i.e set the "Criteria" field to "Product Version (identify by Upgrade Code)" and in the "Upgrade Code" field put your prerequisites Upgrade Code).
- In the "Custom Action" page add a "EXE with Working Dir" custom action.
- Drag it in under "Wizard Dialogs Stage" -> "User Selection".
- Set the "Full Path:" field to

Code: Select all

msiexec /i "[&MyPrereq.msi]"
- Set the "Condition" field to

Code: Select all

NOT LAUNCH_CONDITION
- Uncheck "Maintenance" and "Uninstall" checkboxes.
- Build and run your package.

If you have any questions let me know.

Regards,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”