swearinb
Posts: 29
Joined: Fri Oct 24, 2008 3:22 pm

Do not bind prerequisite to setup.exe

Is it possible or how do I setup a prerequisite to not be built into the setup.exe. I want the prerequisite to be on the CD/DVD and ran from that location. We support multiple languages and each language binds the prerequisite to the setup.exe. Having a single prerequisite for all of the setup.exe files to use would save a lot of disc space. Not all of our customers have access to the Internet so I cannot use the URL.

Thanks,

Brad
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Do not bind prerequisite to setup.exe

Hi Brad,

I'm afraid that we do not have predefined support for this, however you can use the workaround below:
- in the "Install Parameters" page create a new property called "DRIVE"
- create a custom action that uses the "SETUPEXEDIR" property (this property stores the main package location), takes the drive letter of the CD/DVD drive and store it in the "DRIVE" property (i.e. D:\)
- add that custom action twice in your project, once after the "Wizard Dialogs Stage -> Searches" action group and once after the "Install Execution Stage -> Searches" action group (necessary when the package is installed without UI)
- go in the "Prerequisites" page and add a new prerequisite using the "URL Prerequisite" toolbar button and use the following URL: file://[DRIVE]prerequisiteSetup.exe
- add your prerequisite package on your CD/DVD (if you want to include it in a folder you need to change the above URL: file://[DRIVE]MyFolder\prerequisiteSetup.exe)
- build the project, place the package on the CD/DVD and run it

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
swearinb
Posts: 29
Joined: Fri Oct 24, 2008 3:22 pm

Re: Do not bind prerequisite to setup.exe

I have some questions.
1.
How do you create a custom action that sets a property? The only way I could see to do this was to create a dll and have the dll read in the SETUPEXEDIR and then save the result I want back into the DRIVE property. Is there an easier way to do this? The Set installer property only deals with Formats.

2. I added the custom action Launch attached file with sequence that calls my dll after the "Wizard Dialogs Stage -> Searches" and again after the "Install Execution Stage -> Searches". This is never executed before the prerequisites are launched. How can I modify my setup to call this prior to the prerequisites?

Thanks,

Brad
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Do not bind prerequisite to setup.exe

Hi Brad,
1.
How do you create a custom action that sets a property? The only way I could see to do this was to create a dll and have the dll read in the SETUPEXEDIR and then save the result I want back into the DRIVE property. Is there an easier way to do this? The Set installer property only deals with Formats.
In order to set a property you can use the "Set installer property" predefined custom action. However, in your scenario, you need to also read the SETUPEXEDIR property and extract the drive letter from it which will be stored in the DRIVE property. So, you need, indeed, to create a DLL custom action. For example, you can create your custom action written in C# or written in C++ or a VBScript custom action.
2. I added the custom action Launch attached file with sequence that calls my dll after the "Wizard Dialogs Stage -> Searches" and again after the "Install Execution Stage -> Searches". This is never executed before the prerequisites are launched. How can I modify my setup to call this prior to the prerequisites?
This happens if your prerequisites are added as "pre-install" prerequisites. In this case they are launched by the EXE Bootstrapper and, indeed, they are launched before any custom action to be executed. The solution I described works only for "feature-based" and "post-install" prerequisites.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”