You can use either a DTF custom action or C/C++ in a custom action dll to create the temporary rows. If you use C/C++, I recommend using the WCA library that ships with WiX. Either way, you are making a custom action.
-----Original Message----- From: Keith Hassen [mailto:keith.has...@gmail.com] Sent: Thursday, July 08, 2010 7:17 AM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Dynamic directory creation Well this sounds promising. The only trouble I'm having with this is how to dynamically add to the DuplicateFile Table (or the Directory Table for that matter). I realize I can use the CopyFile node to author to the table, but I won't know the number of directories to copy to until the installation is run: the user responds with "10" for the number of directories to replicate, which requires that I then issue 10 CopyFile statements. I don't have this information in advance. So maybe I'm stuck with DTF after all? K [ Original Message ] *Date:* 7/7/2010 10:43:42 AM *From:* os...@live.com *To:* wix-users@lists.sourceforge.net *CC:* *Subject:* Re: [WiX-users] Dynamic directory creation > My recommendation would be to add an immediate custom action in the > InstallExecuteSequence table before CostInitialize that adds "temporary" > rows to the DuplicateFile table and "temporary" rows to the Directory table. > You would also need the following authoring: > > <InstallExecuteSequence> > <DuplicateFiles/> > </InstallExecuteSequence> > > <EnsureTable Id="DuplicateFile"/> > > You should also save the parameters for your custom action so that they can > be retrieved when repairing or uninstalling so your dynamic directories can > be cleaned up/upgraded as appropriate. > > See http://www.joyofsetup.com/2007/07/01/semi-custom-actions/ for the > concept of using native functionality to do non-native things. This tends to > be much more authorable and reliable than trying to implement deferred > actions and getting rollback, etc. working in every case of repair, install, > removal, both kinds of upgrade, etc. > > Such an immediate action can be tested using Lux as well, so you get > testability as a bonus. > > -----Original Message----- > From: Keith Hassen [mailto:keith.has...@gmail.com] > Sent: Wednesday, July 07, 2010 6:03 AM > To: wix-users@lists.sourceforge.net > Subject: [WiX-users] Dynamic directory creation > > Hi, > > I am faced with a problem of building an MSI that requires a set of > directories to be created during installation. These directories are > all prefixed with a common string (eg "folder") followed by a sequence > number (eg "01") so that their final construction might be something > like "folder01", "folder02", etc. I need to place the same executable > in each of these generated directories, but the number of directories > isn't known until install time. I would like to prompt the user for > that number during the setup and then dynamically build the directories. > > My original assumption was that WiX simply couldn't do this task because > of the dynamic nature of the problem. I assumed that I'd have to write > a batch script that would do this work for me: my approach was to always > generate 1 directory, and then use a CA to invoke a batch script that > would copy the directory as many times as was needed. > > I thought I'd post this problem to this list to see if there were other > solutions (using WiX or otherwise) that might be cleaner or more effective. > > > Keith > > ---------------------------------------------------------------------------- > -- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > > ---------------------------------------------------------------------------- -- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > ---------------------------------------------------------------------------- -- This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users