This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Installscript: Howto set targetdir for script-created features?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 06, 2009
09:35 AM
Installscript: Howto set targetdir for script-created features?
I need to install dynamically features depending on the data found in my sourcefolder, e.g. I have two folders apples and cherries:
SOURCE\apples
SOURCE\cherries
Now the user should be able to chose which feature he wants to install. Depending on his choice I want to transfer these folders to a certain folder each:
TARGET\1\apples
TARGET\2\1\cherries
I was able to add my script-features by using FeatureAddItem but now I need to bind a folder to that feature and set the targetdir. How do I do this?
I tried manipulating OnInstalling, but unfortunately the szFile is no byref-variable, which means I can't change the targetdir 😞
And if I use OnInstalled (to move the files) it would be a kind of "temp-folder which needs to be deleted in the end"-solution, which I don't like much.
SOURCE\apples
SOURCE\cherries
Now the user should be able to chose which feature he wants to install. Depending on his choice I want to transfer these folders to a certain folder each:
TARGET\1\apples
TARGET\2\1\cherries
I was able to add my script-features by using FeatureAddItem but now I need to bind a folder to that feature and set the targetdir. How do I do this?
I tried manipulating OnInstalling, but unfortunately the szFile is no byref-variable, which means I can't change the targetdir 😞
And if I use OnInstalled (to move the files) it would be a kind of "temp-folder which needs to be deleted in the end"-solution, which I don't like much.
(10) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 07, 2009
09:22 AM
How are you actually transferring the files associated with the script-defined feature? Could you borrow FEATURE_FIELD_MISC or the like to store the fake destination location?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 07, 2009
10:18 AM
Hi Robert,
they get transfered, because they are part of a feature/component which is not script-generated. I now set the targetdir to supportdir and copy my files to the real targetdir. But I somehow don't like it 😉
FEATURE_FIELD_MISC won't help, because I can't bind the folder "cherries" to that script-based feature and therefore the info in FEATURE_FIELD_MISC is useless.
they get transfered, because they are part of a feature/component which is not script-generated. I now set the targetdir to supportdir and copy my files to the real targetdir. But I somehow don't like it 😉
FEATURE_FIELD_MISC won't help, because I can't bind the folder "cherries" to that script-based feature and therefore the info in FEATURE_FIELD_MISC is useless.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 07, 2009
11:07 AM
Sorry, I'm not sure how the real features/components and the script-defined features are connected? How are you copying files from SUPPORTDIR to the real TARGETDIR?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 07, 2009
11:23 AM
There is a real feature and a real component, which has a dynamiclly linked folder.
During runtime I read an ini-file included in SRCDIR, which contains all modules. With these information I create these script-based features and show them to the user. Now he can select what he wants to install. But at this point I can bind a folder to the feature (a folder which is inside the mentioned component). If I could perform this, it would be possible to deaktivate the normal feature and just install the folders binded to the script-features.
But because this doesn't work, I need to copy each file in OnInstalled and delete then the TARGETDIR which pointed to a temp folder.
Hope that was a bit clearer 🙂
During runtime I read an ini-file included in SRCDIR, which contains all modules. With these information I create these script-based features and show them to the user. Now he can select what he wants to install. But at this point I can bind a folder to the feature (a folder which is inside the mentioned component). If I could perform this, it would be possible to deaktivate the normal feature and just install the folders binded to the script-features.
But because this doesn't work, I need to copy each file in OnInstalled and delete then the TARGETDIR which pointed to a temp folder.
Hope that was a bit clearer 🙂
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 07, 2009
01:02 PM
Is it an option to use only script-defined features, and then use XCopyFile to copy the corresponding files directly from the source to the destination?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 08, 2009
02:44 AM
That's what I do now. But I don't like it much, because I copy all files twice.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 08, 2009
07:58 AM
I mean, is it an option to copy the files directly from the source to the target without the "real" feature and component?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 11, 2009
04:46 AM
Yes, but how will I manage that? There will be no events if there is no real component containing my data. Or what do you have in mind? 🙂
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 11, 2009
08:50 AM
You should still be able to use events in general when doing file transfer with XCopyFile. (Not feature events, of course.) Was there something in particular you're unable to do?
Robert
Robert
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 15, 2009
12:00 PM
What events are you talking about? I can just go through my dialogs and after pressing "Install", waiting for the standard events to occur, or am I wrong :confused:
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)