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:
CODE |
Dlg_SdAskDestPathBin: szTargetPath = TARGETDIR; szTitle = @ID_MSG_TITLE_PROGRAMPATH; szMsg = @ID_MSG_MESSAGE_PROGRAMPATH; //{{IS_SCRIPT_TAG(Dlg_SdAskDestPath2) nResult = SdAskDestPath2( szTitle, szMsg, szTargetPath ); //}}IS_SCRIPT_TAG(Dlg_SdAskDestPath2) if (nResult = BACK) goto Dlg_SetupType; TARGETDIR = szTargetPath;
|
Now select the second path:
CODE |
Dlg_SdAskDestPathSound: if (nResult = BACK) goto Dlg_SdAskDestPathBin; szTargetPath = TARGETDIR ^ "Sounds"; szTitle = @ID_MSG_TITLE_SOUNDPATH; szMsg = @ID_MSG_MESSAGE_SOUNDPATH; nResult = SdAskDestPath2(szTitle, szMsg, szTargetPath); if (nResult = BACK) goto Dlg_SdAskDestPathBin; TARGETDIR_SOUND = szTargetPath; FeatureSetTarget(MEDIA, "<SOUNDDIR>", TARGETDIR_SOUND); 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:
CODE |
TARGETDIR_SOUND = TARGETDIR ^ "Sounds"; LogReadCustomString("SoundDir", szPath); TARGETDIR_SOUND = szPath; FeatureSetTarget(MEDIA, "<SOUNDDIR>", TARGETDIR_SOUND);
|
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
Rita