Jump to content

This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.

Using FeatureMoveData more than once

2 replies to this topic


  • Full Members
  • 2 posts

Posted 26 April 2012 - 05:29


In one of my InstallShield(2010) projects, I need to run FeatureMoveData twice to install my application to local host computer hard disk and USB flash drive depending on whether the target computer has USB flash drive plugged in.

To achieve this FeatureMoveData was used.

The codes are as below:
function MoveFileData()


TARGETDIR = strPath1; // path for local pc directory
nResult = FeatureMoveData( MEDIA, nvDisk, 0 ); // 1st run

//now update files to the USB flash drive
TARGETDIR = strPath2;

// MEDIA was replaced by "" TO RESET MEDIA
nResult = FeatureMoveData( "", nvDisk, 0 );

nResult = FeatureMoveData( MEDIA, nvDisk, 0 ); // 2nd run



codes runs ok until "nResult = FeatureMoveData( "", nvDisk, 0 );" after initialise the MEDIA, when 2nd run was performed. nResult returns -118.

This is a InstallScript project and FeatureMoveData is supposed ok to use this way as presented in FeatureMoveData.

Excerpted from FeatureMoveData
"You can call FeatureMoveData more than once on the same media, but you must reset internal structures before the second and subsequent calls by calling FeatureMoveData with a null string ("") in the first parameter position. InstallShield automatically initializes the default media and internal structures before your first call to FeatureMoveData. "

Function: FeatureMoveData
Project type: InstallScript
Description: Transfers and decompresses files associated with selected features in the file media.

error code: -118
Description: Attempted operation not allowed with script-created feature sets.
Cause: A script-created feature set name was passed to a feature function that operates only on file media.

Am I missing anything here?

Please advise.

Thank you in advance for your kindly helps.



Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 26 April 2012 - 14:32

I've never tried to run FeatureMoveData twice like this and you seem to be doing what's suggested by the documentation, so I can't make any suggestions there.

Instead I would consider just using XCopyFile with disabled logging to copy the files from the hard drive to the USB stick. Especially since the USB stick doesn't need uninstall support.
user posted image


  • Full Members
  • 2 posts

Posted 27 April 2012 - 03:44

Hi Taco Bell:


It appears that I could only do the way you suggested.

Thank you again.