Specify a different destination folder for each component

Got a problem you cannot solve? Try here.
Post Reply
phil3k
Posts: 2
Joined: Tue Dec 13, 2005 7:12 am

Specify a different destination folder for each component

Post by phil3k »

How is it possible to allow different destination folders for different components being specified ? For Example the user decides to install component A to E:\\somewhere and component B to D:\\somewhereelse

I tried various approaches including different $TARGETDIR$ variables, but the problem is how can I fetch the user event resulting from a component selection and how can I modify a Text Field holding a set of different installation destinations.

Is such scenario possible ?

Do I have to build seperate installers ??
sinan
Site Admin
Posts: 1037
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

Sure, there are many ways to achieve this. What you want to do is store the target folders for each component in its own variable, say TARGETONE, TARGETTWO, etc. In the Install Files commands for the components you can just use these new variables as the target folders for the files being installed.

I'd also show the destination dialog once for each component. The pre-built destination dialog already has the logic and controls in place to work with TARGETDIR. So before calling the dialog, I'd assign TARGETDIR to the value of, for example, $TARGETONE$, and after the dialog returns, I'd reassign TARGETONE to $TARGETDIR$ using the Set Variable commands.

This is just one way to do it. You can insert multiple edit fields on a dialog to capture each target variable all at once as well. Its all up to you!
phil3k
Posts: 2
Joined: Tue Dec 13, 2005 7:12 am

Post by phil3k »

Yes, that's what I thought, but what I'd like to have it the "Microsoft" way, they let you specifiy the different component destinations using a single text field with a Browse button. When selecting different components the text field changes to the selected component destination.
sinan
Site Admin
Posts: 1037
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

You might be able to achieve something like this using the dialog editor and dialog rules...by hiding and showing fields as different items are selected on the tree control. I'm not sure how right off the bat though.
Post Reply