1) No - there isn't a way to run the standard action, InstallFiles, twice. You 
won't be able to react to the locked file so you're going to have to 
unilaterally unlock it before-hand. You might be able to write a CA to figure 
out if it's locked and populate a property and use that as a guard to do the 
unlock but you will not be able to  

2) 
It sounds like what you want to do is basically:
-> You have a DLL that may or may not be locked
-> You have an EXE file you've already written that can unlock said DLL somehow
-> You want to execute the EXE at some point prior to the files being copied to 
prevent a lock error

If I've understood then my suggestion:
Stream it in to the Binary table with a Binary element. Author an immediate 
sequence action to stream out the binary table entry to a known temporary 
directory and send that path as CustomActionData to a deferred custom action 
that runs the streamed out BEFORE InstallFiles. (Alternatively, remove the EXE 
entirely and put the code in a DLL Custom Action you run deferred with an 
Immediate CA to find the appropriate file to unlock but no clue if that's 
viable).

For ease of use, I strongly suggest checking out a C# custom action first. DTF 
has all you need to access and stream the binary table out to a specific point 
and run your action. If I am remembering correctly, if you set the action to 
compile as 64-bit then the DTF engine should actually run it as 64-bit. Before 
getting in too deep, I strongly recommend going through the WiX tutorial page 
on the topic to familiarize yourself with the tech: 
http://wix.tramontana.co.hu/tutorial/events-and-actions/how-to-manage (for some 
reason the page isn't loading for me, but I think that's a work internet 
accessibility thing). Once you have a basic understanding, streaming the 
executable out and just running it -before- InstallFiles. You can use DTF to 
also schedule it for execution using Session.DoAction("DeferredAction").

I can't find any good samples out there but maybe someone else knows of one.

3) I can't imagine how - you need to run an executable, not copy a file.

You should think about the install more as a transaction of atomic activities 
and less as a sequence of things that are done. It's more like a SQL Script 
than an XCOPY in the MSI world :) It brings some frustration early but it does 
save time/cost/effort on your user end.

Hope this points you in the right direction.

-----Original Message-----
From: Jack Sojourn [mailto:jack.sojo...@gmail.com] 
Sent: Friday, April 18, 2014 10:50 AM
To: General discussion about the WiX toolset.
Subject: Re: [WiX-users] Tough scenario copying files

The problem is the install is in 32 bit and the function I need to call can 
only be called from a 64bit process (if 64 bit OS).  I need the 64bit helper 
exe in my msi to be extracted to run it.  (my app has a dll that may be loaded 
in another process at time of upgrade.  this "unlocker" exe removes it)

1. is there a way to run the copy files twice?  once to copy all that can be 
copied, run the unlocker and then copy again?

2. or Johns suggestion of streaming the exe out...how would I go about that?

3. or could a separate <copyfile> element work at all?





On Thu, Apr 17, 2014 at 3:11 PM, Bryan Wolf <brw...@jackhenry.com> wrote:

> Files are copied as part of an atomic step. Technically they are 
> staged somewhere during the copy but it's nothing you could 
> meaningfully interact with. There is no "OnFileCopy" type functionality, 
> either.
>
> Is there a reason you couldn't run the unlock CA before InstallFiles 
> and just attempt to unlock it and gracefully exit if it's unnecessary?
>
> -----Original Message-----
> From: Jack Sojourn [mailto:jack.sojo...@gmail.com]
> Sent: Thursday, April 17, 2014 2:02 PM
> To: WiX-users@lists.sourceforge.net
> Subject: [WiX-users] Tough scenario copying files
>
> I have a situation where on install a file in my msi may be in use on 
> upgrades.  I have a custom action that will get rid of any lock on the 
> file.  however this custom action has to be run as a 64bit process 
> which it does now.
>
> so I need to run the custom 64bit exe file during install before 
> copying the files to the destination directory....
>
> 1. extract files
> 2.  run custom action
> 3. copy files to dest dir
>
> is it possible to run the custom action exe before all the files are 
> copied to the dest dir?  (i.e. does the msi extract somewhere first 
> where I could run it?)
>
> or I could have the msi copy files (even if one fails because in use), 
> then run CA, the copy them again.
>
> any suggestions on how I could do this?
>
> Thanks.
>
> ----------------------------------------------------------------------
> -------- Learn Graph Databases - Download FREE O'Reilly Book "Graph 
> Databases" is the definitive new guide to graph databases and their 
> applications. Written by three acclaimed leaders in the field, this 
> first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
> NOTICE: This electronic mail message and any files transmitted with it 
> are intended exclusively for the individual or entity to which it is 
> addressed. The message, together with any attachment, may contain 
> confidential and/or privileged information.
> Any unauthorized review, use, printing, saving, copying, disclosure or 
> distribution is strictly prohibited. If you have received this message 
> in error, please immediately advise the sender by reply email and 
> delete all copies.
>
>
>
> ----------------------------------------------------------------------
> -------- Learn Graph Databases - Download FREE O'Reilly Book "Graph 
> Databases" is the definitive new guide to graph databases and their 
> applications. Written by three acclaimed leaders in the field, this 
> first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the 
definitive new guide to graph databases and their applications. Written by 
three acclaimed leaders in the field, this first edition is now available. 
Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are 
intended
exclusively for the individual or entity to which it is addressed. The message, 
together with any attachment, may contain confidential and/or privileged 
information.
Any unauthorized review, use, printing, saving, copying, disclosure or 
distribution 
is strictly prohibited. If you have received this message in error, please 
immediately advise the sender by reply email and delete all copies.


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to