Forum


HomeHomePremiumPremiumDevelopmentDevelopmentExcluding files from a buildExcluding files from a build
Previous
 
Next
New Post
7/18/2017 12:43 PM
 

Hi Steve,

I think I got it. I had to replace this line:

      < installinclude include="**\images\**" exclude="packages\**">< /installinclude>

By these 2:

      < installinclude include="**\images\*.png" exclude="packages\**">< /installinclude>

 

      < installinclude include="**\images\*.svg" exclude="**\resources\images\**;packages\**;">< /installinclude>

 

 

So you actually have to list file type by file type there. There might be other ways, but that was what worked for me.

Cheers,

Aderson

 


 
New Post
7/19/2017 12:30 PM
 

Hi Aderson,

Thank you for your reply.

I'm afraid I don't follow your changes at all and I find this all very confusing.
I'm not sure what your intention is with the 2 new lines you've added.

I've put my guesses as to what I think the lines mean, but I am not at all convinced I've understood it.

I think '**' means any number of directories as opposed to '*' which references a single directory.

So the original line:
< installinclude include="**\images\**" exclude="packages\**">< /installinclude>
Means:
Include all directories in any subdirectory with the name 'images' in the path, exclude all subdirectories under the top level packages directory.

The two added lines:
< installinclude include="**\images\*.png" exclude="packages\**">< /installinclude>
Means:
Include all png files which have a direct parent of 'images' where 'images' could occur at any level in the hierarchy, exclude all directories under the packages directory.

< installinclude include="**\images\*.svg" exclude="**\resources\images\**;packages\**;">< /installinclude>
Means:
Include all svg files with a parent directory of images where 'images' could occur at any level in the hierarchy, exclude all files in the 'resources\images' directory and exclude all files in the packages directory.

So, in summary, the two new lines include all png and svg files which have a parent directory named 'images', exclude all directories in the 'packages' directory and any directory with 'resources\images' in the path name. I don't understand why the packages direcory needs to be excluded twice.

I don't understand why seemingly unrelated directories are referenced in the same line, for example what have png files got to do with files in the packages directory.

In my case,  want to exlude svg files from a sub directory of the images directory, bur include all other files in the images directory and subdirectories, so I'm guessing I need the following line:

<installinclude Include="**\images\**" Exclude="images\MyMenu\Templates\*.svg;packages\**;" />

Again I'm guessing that this would include all files in the images directory but exclude svg files in the '\images\MyMenu\Templates\' directory.  I don't think I need to use '**' as I am referencing the images directory at the top level, but I will leave it in as the original line is using it.

Phew, I'm sorry to drag this one out so much, I will have another look at this tomorrow, it's doing my head in :-)

 

Best Regards,

 

Steve

 
New Post
7/19/2017 11:37 PM
 

Hi Steve,

1 - My understanding is that if you want to exclude some file types from a directory, you cannot use a wild card to add all files and then remove some. You have to break down each file type and what to do for each one.

2 - Also as I understand, the wild card on the "exclude" refers to only the files added in the include - You are creating an exception for what you included.

3 - The packages folder seem to me to be a temporary holding location for files to be zipped up. That is why it keeps excluding the folder.

In your case, try these:

< installinclude Include="**\images\*.png" exclude="packages\**" / >
< installinclude Include="**\images\*.svg" exclude="images\MyMenu\Templates\**;packages\**;" / >


but make sure you don't have this anymore (it will include all):

 < installinclude include="**\images\**" exclude="packages\**">< /installinclude>

Cheers,

Aderson

 
New Post
7/20/2017 6:08 AM
 

Hi Aderson,

Thank you once again for following up, I do appreciate it.

I think I have a solution. To exclude svg files in a specific directory i used:
<installinclude Include="**\images\**\*.svg" Exclude="images\MyMenu\Templates\**;packages\**;"/>

So I found i needed to add '**' so that all directories under images are included. Then specifically exclude all (svg) files from the 'images\MyMenu\Templates\' directory. Now I assume that this only seems to excludes SVG files, as they were specified in the include,  a txt file in the same directory was copied, which is fine.

All files in the images directory are no longer specified by this line which as you suggested I commented out:
<InstallInclude Include="**\images\**" Exclude="packages\**" />
So, I added a line for each type of image file to include:
      <installinclude Include="**\images\**\*.png" Exclude="packages\**"/>
      <installinclude Include="**\images\**\*.jpg" Exclude="packages\**"/>
      <installinclude Include="**\images\**\*.gif" Exclude="packages\**"/>
      <installinclude Include="**\images\**\*.ico" Exclude="packages\**"/>

In my tests, I created new directory under the images directory and put 1 file of each image file type, i.e. svg, png, gif, etc. These was recreated in the new installation, but were not overwritten by subsequent installations. I also tried putting in some newer versions of some of the files under the images directory, these overwrote the files already installed, but newer versions of files were not replaced by older ones.

One other observation, all files in 'images\MyMenu\' are overwritten regardless.

The Complete solution is:
      <installinclude Include="**\images\**\*.png" Exclude="packages\**"/>
      <installinclude Include="**\images\**\*.jpg" Exclude="packages\**"/>
      <installinclude Include="**\images\**\*.gif" Exclude="packages\**"/>
      <installinclude Include="**\images\**\*.ico" Exclude="packages\**"/>
      <installinclude Include="**\images\**\*.svg" Exclude="images\MyMenu\Templates\**;packages\**;"/>
      <!-- 20/07/2017 one line removed -->
      <!--<InstallInclude Include="**\images\**" Exclude="packages\**" />-->

Thank you once again for your help in pushing me along to a solution.

Best Regards,

Steve

 
New Post
7/20/2017 8:19 AM
 

Hi Steve,

I got confused a bit, sorry. What I'm suggesting is just to add or not add files to the install pack. This doesn't refer to overwriting or not overwriting files. If files are in the zip, they will overwrite when installed, that's what I understand about module install packs on DNN.

So it seems to me that you are trying to create an initial install that has some images initially and then under new installs these images don't get replaced (but are in the install file). That I don't really know how to do. I think you cannot do it. But I might have misread you completely.

Sorry,

Aderson


 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentExcluding files from a buildExcluding files from a build



Try FREE
30 days money back guaranteed