Fabrice,

I think you may be confusing *build-time* source paths (on your machine)
with *run-time* destination paths (potentially on a different machine).  The
only mention of "app\resources" that I see in your code snippet is here:

  <File Id="MyFileId" Name="_dt.xsl" Source="app\resources\_dt.xsl"
KeyPath="yes" /> 

This means that when your installer is built, it takes the file from
app\resources\_dt.xsl on your machine (or the machine where the installer is
built), and puts it in the MSI package.  The "app\resources\_dt.xls" path
tells the WiX toolset where to find this file, to embed it into the MSI
package at "build time", but that is the end of that path's involvement.

Then, when the MSI package is installed (at "run time"), it takes the
_dt.xsl file that is now stored in the MSI package's embedded "CAB", and
installs it to the directory specified by APPLICATIONFOLDER, because that is
the Directory of MyFileId's Component.  The MSI package does not know about
the original "app\resources" source path at this point, as its involvement
ended when the MSI package was built.

Next, MyFileCopyId says to take the same _dt.xsl that it previously
installed to APPLICATIONFOLDER, and install another copy of it to
DestinationDirectory="APPLICATIONFOLDER".  But the MSI runtime detects that
those paths are the same (it is saying to copy the file to *itself*), so it
does nothing.

Now, in the scenario where you build the MSI package and install it *on the
same machine*, the end result (on a superficial level) looks the same as if
you had copied the file from your "app\resources" source path to the
"APPLICATIONFOLDER" destination path, but that is not precisely what
happens:  this is not a *direct* copy-and-paste from the source folder to
the destination folder.  Rather, the file is read from the source path,
embedded in a package, (at this point the package could be distributed to a
different machine), read from the package, and installed to a destination
folder -- and there is a great deal more going on behind the scenes,
including the support for the "resiliency repair" that Phil mentioned.


So unless you have defined an "app\resources" *destination* folder structure
(i.e., with Directory elements in the WiX markup) that you didn't show in
your code snippet, or unless you are trying to copy and/or move an
app\resources\_dt.xsl file that *already existed* on the destination machine
(instead of packaging and delivering your own _dt.xsl), then I don't quite
follow you.

Regards,
Mike


Fabrice MAUPIN wrote
> Hi,
> 
> The file is not copied in the same location !
> 
> The file is copied from "app/resources" to the root of APPLICATION FOLDER.
> 
> The structure of the package after the install :
> 
> APPLICATION FOLDER
>       | APP
>               | Resources
>                       My file
>       | RUNTIME
> 
> " Also, if "the folder which contains this file can be deleted." means
> that you are going to remove the files and folder that were installed
> directly by the install (not the copyfile) then you have an issue there
> because MSI resiliency repair will attempt to restore it."
> 
> It means that it is not possible to remove files or folders (installing by
> MSI) after install (else restore them by MSI)  ?
> 
> -------------
> Fabrice
> 
> -----Message d'origine-----
> De : Phil Wilson [mailto:

> phildgwilson@

> ] 
> Envoyé : vendredi 10 octobre 2014 18:33
> À : General discussion about the WiX toolset.
> Objet : Re: [WiX-users] How to hide a file in WXS configuration file ?
> 
> I think the point Michael is making is that during the install you are
> copying a file to APPLICATIONFOLDER as part of the "normal" MSI install
> process, and then you're doing a separate copyfile of that same file to
> the same location with the same name. This can't be right, so maybe you've
> just made a typo error, but in any case the WiX docs say that a copyfile
> of the same file to the same location with the same name doesn't do
> anything. So presumably you want to copy it to some other location?
> 
> Also, if "the folder which contains this file can be deleted." means that
> you are going to remove the files and folder that were installed directly
> by the install (not the copyfile) then you have an issue there because MSI
> resiliency repair will attempt to restore it.
> ---------------
> Phil Wilson
> 
> 
> On Fri, Oct 10, 2014 at 12:19 AM, Fabrice MAUPIN &lt;

> fmaupin@

> &gt; wrote:
>> Hi,
>>
>> For information, I use WiX 3.8.
>>
>> "...copying a file that you're already installing, but I've never 
>> found a good reason to use it in this way"
>>
>> Yes I've a good reason : I want install certain files to the root of 
>> the application folder for particular functional use-cases and one of 
>> the ways to do that is to package this files into my JavaFX 
>> Application.
>>
>> Once the copied file, the folder which contains this file can be deleted.
>>
>> Fabrice
>>
>> -----Message d'origine-----
>> De : Michael Turner [mailto:

> mcturner319@

> ] Envoyé : jeudi 9 
>> octobre 2014 17:59 À : 

> wix-users@.sourceforge

>  Objet : Re: 
>> [WiX-users] How to hide a file in WXS configuration file ?
>>
>>
>> Fabrice,
>>
>> The CopyFile element is kind of an oddball, particularly in the 
>> use-case where it points to another File in the same installer.  Sure, 
>> the CopyFile element exists, and it supports copying a file that 
>> you're already installing, but I've never found a good reason to use 
>> it in this way; it might be useful for copying a file that's already 
>> on the destination machine (i.e., the syntax where you specify one or 
>> more Source* attributes), but that's about it.  When you use the 
>> FileId="..." syntax, the way that it binds one component to another 
>> has some weird consequences.  But if you're just trying to save space 
>> by not having to store the same file twice in the MSI, you can do that 
>> without CopyFile.  As of WiX 3.5 (I think?), the WiX Linker does 
>> "smart cabbing":  if it detects that two File elements are using the 
>> same physical source file, then it stores the file just once and then has
>> both File elements point to it.
>> http://robmensching.com/blog/posts/2007/6/1/quotsmart-cabbingquot-adde
>> d-to-w
>> ix-toolset/
>>
>> Anyway, if I understand you, you want to install the same file to two 
>> different places, with the Hidden flag set in one place but not in the 
>> other?  (However, your code snippet is specifying APPLICATIONFOLDER 
>> twice, so maybe I misunderstand you.)  This is one of the many things 
>> you can't do with CopyFile; you can't change file attributes during 
>> the copy.  But thanks to "smart cabbing", you can just use two File 
>> elements, and as long as you're using WiX 3.5 or later, this won't make
>> your MSI any larger.
>>
>> E.g.,
>>
>>     
> <DirectoryRef Id="APPLICATIONFOLDER">
>>         
> <Component Win64="yes">
>>             
> <File Id="MyFileId1" Name="_dt.xsl" Source="app\resources\_dt.xsl"
> KeyPath="yes" />
>>         
> </Component>
>>     
> </DirectoryRef>
>         
>>     
> <DirectoryRef Id="AnotherFolder">
>>         
> <Component Win64="yes">
>>             
> <File Id="MyFileId2" Name="_dt.xsl" Source="app\resources\_dt.xsl"
> KeyPath="yes" Hidden="yes" />
>>         
> </Component>
>>     
> </DirectoryRef>
>         
>>
>> (In my example, I am leaving off unnecessary attributes, per 
>> http://www.joyofsetup.com/2009/12/31/simplifying-wix-component-authori
>> ng/ .)
>>
>> Regards,
>> Mike
>>
>>
>> Fabrice MAUPIN wrote
>>> Hello everybody,
>>>
>>> This is an extract of my WXS configuration file :
>>>
>>>
>>> 
> <DirectoryRef Id="APPLICATIONFOLDER">
>>>
>>>
>>> 
> <Component Id="MyFileId" Guid="." Win64="yes">
>>>
>>> 
> <File Id="MyFileId" Name="_dt.xsl"
>>
>> Source="app\resources\_dt.xsl" KeyPath="yes" />
>>>
>>> 
> </Component>
>>>
>>> 
> <Component Id="MyFileCopyId" Guid="." Win64="yes">
>>>
>>> 
> <CopyFile Id="MyFileCopyId" FileId="MyFileId"
>>
>> DestinationDirectory="APPLICATIONFOLDER" />
>>>
>>>
>>> 
> </Component>
>>>
>>> 
> </DirectoryRef>
>>>
>>>
>>>
>>> 
> <Feature Id="MyFeature">
>>>
>>> 
> <ComponentRef Id="MyFileId" />
>>>
>>> 
> <ComponentRef Id="MyFileCopyId" />
>>>
>>> 
> </Feature>
>>>
>>> I would like to hide the  "_dt.xsl" file which was copied : is it 
>>> possible ?
>>>
>>> If yes, how ?
>>>
>>> Thanks you.
>>> Fabrice





--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-hide-a-file-in-WXS-configuration-file-tp7597186p7597282.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://p.sf.net/sfu/Zoho
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to