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.

Extra Directory for Files

2 replies to this topic


  • Full Members
  • 2 posts

Posted 12 February 2008 - 10:42


we have to install an application that should be able to have a larger amount of sound files installed:
1) leave on CD
2) copy to a user defined folder

For 2) INSTALLDIR\sounds would be the default, but the user should be able to change it

Please, could you give me a pointer to the steps I should go?

thx, alex

Edited by afarny, 12 February 2008 - 10:42.


  • Full Members
  • 50 posts

Posted 12 February 2008 - 11:25

As I'm using a German version of IS I don't know if my GUI translation is correct but I hope you'll find what I mean.

I solved the problems of having two different Target folders as follows:

- in Installation designer select the item "Files and Folders" under the "Application data" tree item.
- in "Target computer folders" under "Script defined folders" select "New folder" in context menu, give it a name, i.e. "SOUNDDIR"
- you can select "<SOUNDDIR>" now as a a target folder for components

- define a global variable for the sound directory (i.e. TARGETDIR_SOUND)

Now you have to allow the user to select the path in your "OnFirstUIBefore"-function.
First select the installpath:

   szTargetPath = TARGETDIR;
       nResult = SdAskDestPath2( szTitle, szMsg, szTargetPath );
   if (nResult = BACK)
       goto Dlg_SetupType;
   TARGETDIR = szTargetPath;

Now select the second path:

   if (nResult = BACK)
       goto Dlg_SdAskDestPathBin;
   szTargetPath = TARGETDIR ^ "Sounds";
   nResult = SdAskDestPath2(szTitle, szMsg, szTargetPath);
   if (nResult = BACK)
       goto Dlg_SdAskDestPathBin;
   TARGETDIR_SOUND = szTargetPath;
   LogWriteCustomString("SoundDir", TARGETDIR_SOUND);

I don't know whether saving the directory in the log is really necessary but we had some trouble with program upgrading which is why I restored the second target folder "manually". In OnMaintUIBefore do the readout at the beginning:


   LogReadCustomString("SoundDir", szPath);

This did it for me. If there are any more elegant ways to do this I'd like to know, too, because I didn't find out.
It would be very nice if IS would support something like this because you can't store everything under one target folder with Vista as the program folder access is very restricted.

For the "leave files on CD option": Check out the "AskOptions"-dialog, that will do. Usage is somewhat bizarre but with only two options it's not too difficult.

Hope this helps. I had to cut and change my snippets in order to simplify so they might be not error free but they should show the general idea.

Best regards


  • Full Members
  • 2 posts

Posted 12 February 2008 - 16:04

Hi Rita,

thanks - I will try it this evenning.

(Dann wärs wohl auch auf deutsch gegangen?
Merci - ich hab letzte Nacht mehrere Stunden gegoogelt und in der Doku gewühlt - jetzt hab ich zumindest nen Plan)

regards alex