*Windows Installer* can't do that by default due to the dynamic nature
of the problem.

One way you could solve it (but would require a fair chunk of coding)
would be to do all your UI externally before launching the MSI & then
add the required rows to the Directory & File tables in your MSI before
installing it. That would be far cleaner than using a batch script but
it would involve re-inventing the wheel to some extent due to having to
write an External UI. It does however all you to provide a rich
installation experience since your UI won't be limited to what Windows
Installer provides.

If you wanted an easy way to do it without the ugliness & problems of a
batch script you could use a DTF Custom Action to create the directory
structure & copy the file into the newly created directories from the
installed location. That way you could modify the WiXUI to add a dialog
where you ask the user for the number of directories to create & then
pass that Property & the location of the file to the Custom Action as
parameters. You would however also need to code your Custom Action to
handle uninstall & rollback so you may want to write the value you get
from the user to the registry so you can pass it to your DTF Custom
Action during uninstall.

Palbinder Sandher 
Software Deployment & IT Administrator
T: +44 (0) 141 945 8500 
F: +44 (0) 141 945 8501 

http://www.iesve.com 
**Design, Simulate + Innovate with the <Virtual Environment>**
Integrated Environmental Solutions Limited. Registered in Scotland No.
SC151456 
Registered Office - Helix Building, West Of Scotland Science Park,
Glasgow G20 0SP
Email Disclaimer

-----Original Message-----
From: Keith Hassen [mailto:keith.has...@gmail.com] 
Sent: 07 July 2010 14:03
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

Reply via email to