Windows Installer uses a declarative language (implemented in an embedded 
database) to describe the end state of the system. This means that all files in 
selected components are installed at the same conceptual time in no specific 
order. Components can have Conditions that decide whether the component will be 
selected (assuming its parent Feature has already been selected). Perhaps one 
way to do this would be to construct Component Conditions such that they use 
the value of a Property (or Properties as the case might be) whose value is set 
by an immediate CustomAction you execute before the InstallFiles action. Since 
the Windows Installer does not actually install files until the install script 
is executed (at "deferred" time) you cannot use a Component/File to copy your 
dependencies.

Ideally, the immediate CustomAction is implemented in C/C++ with no external 
dependencies (statically linked, for example). WiX provides a very easy way to 
author custom actions in .NET by using the DTF but this will introduce a 
dependency to the .NET runtime of your choice. If you cannot guarantee that the 
appropriate .NET runtime will be installed before your package is installed, 
then you'll need to use a bootstrapper (like Burn) to make sure the .NET 
runtime gets installed before your package is installed. If you decide to use 
scripts to implement your immediate CustomAction (not recommended as they are 
often very fragile and difficult to debug, also anti-virus and anti-malware 
software tend to hate them), then the Windows Installer support JScript and 
VBScript out-of-the-box. You have various options here including adding your 
JScript or VBScript to the Binary table or including the text of the script 
"inline".

For any other kind of script, you'll need to be responsible for making sure the 
script runtime is available (provide it yourself, detect it exists, or provide 
it yourself) and you'll be responsible for providing your own scripts as well. 
If you need to provide the engine and scripts, then you would need to write a 
custom action (using one of the methods in the previous paragraph) to extract 
your script engine and/or scripts from some location (probably the Binary 
table), execute your scripts, and finally clean up after yourself. There are 
two major things to consider here:

1.) You are already writing a custom action in C/C++ or .NET (JScript and 
VBScript do not seem to provide enough features to extract files but I could be 
wrong) so perhaps you should just implement your real custom action in C/C++ or 
.NET.
2.) You lose the ability to interact with the Windows Installer engine (for 
example, you cannot set properties to communicate with other custom actions or 
to affect Conditions on Components) so using these kinds of scripts are only 
really useful to actually make changes to the system (they need to run 
deferred) that are harder to make using another technique.

Perhaps someday WiX can provide a built-in mechanism to extract arbitrary files 
from the Binary table but I suspect that type of functionality is extremely low 
on the WiX developers' priority list (if it is there at all).

Edwin G. Castro
Software Developer - Staff
Digital Channels
Fiserv
Office: 503-746-0643
Fax: 503-617-0291
www.fiserv.com
Please consider the environment before printing this e-mail


> -----Original Message-----
> From: Dan Muller [mailto:dmuller...@comcast.net]
> Sent: Friday, June 15, 2012 9:23 AM
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] Sets of files installed at different times.
> 
> Our installer needs to run a set of scripts on install and uninstall, is 
> there a
> way to write a specific set of files to the disk, then call them using some
> custom actions we made and depending on whether some of them
> produced proper files outputs, wix would then install the rest of the files to
> the specified INSTALLDIR.
> 
> What would be the best way to do this? Would we be able to add them as
> components and have a custom action to install them? Is there another way
> built into wix, or is there something missing?
> 
> Thanks in advance,
> Dan
> 
> --
> View this message in context: http://windows-installer-xml-wix-
> toolset.687559.n2.nabble.com/Sets-of-files-installed-at-different-times-
> tp7578867.html
> Sent from the wix-users mailing list archive at Nabble.com.
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and threat
> landscape has changed and how IT managers can respond. Discussions will
> include endpoint security, mobile security and the latest in malware threats.
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to