NI Package Management Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
MaximeR

Add ability to exclude files with filter in NI Package Builder

Status: New

When you add  folder in NI Package Builder it add all the files included. It can be usefull to remove automatically somes files or folder with filters.

 

Just to give some examples. I have to include some Python Script. Python is generating *.pyc files in _pycache_ folder. If I have the ability to exclude automatically a list of extension file, or file/folder of list based on regular expressio, it can be very usefull. 

 

My source code is under SVN source code control. When you selet a folder, it populates also hidden folder. So it adds my ".svn" folder.

 

Add ability to exclude hidden folder and have the first filter will help me better manage my files to distribute. This can be added to the propoerty page of the input folder.

 

Best regards

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

9 Comments
Dane.S
Member

Hi Maxine,

 

This type of functionality does exist in part in NI Package Builder by modifying the'DiscoveryExclusion.txt' in the '[LocalAppData]\National Instruments\NI Package Builder\' directory. 

 

This file is not well documented yet, but it is used to exclude or include discovery for certain files or directories. For example I modified the Exclude Paths and Include Paths sections, I removed the [User Desktop] path from the Include Paths so I can add the '[User Desktop]\\Project\\.*.bmp' line to my Exclude Paths. This will exclude from discovery any .bmp files in the Project Directory or its subdirectories. So when I add my Project file I get all my other files but it does not discover my .bmp files. See the partial snipped below:

"

[Exclude Paths]
[Windows]\\WinSxS
[User Desktop]\\Project\\.*.bmp

[Include Paths]
[Documents]\\National Instruments
[My Documents]

"

Dane S.
Product Support Engineer
National Instruments
MaximeR
Active Participant

Hi,

 

Thanks for the trick. I try to find it by myself without success. I already change it to include some windows dll that I need to deploy.

In my point of view, this configuration should be inside the solution itself.

 

To filter, you need to change a file in LocalAppData which is hidden by default. Hidden file or folder are more me files or folder that user don't have to change.

It applies for all projects of the computer. You can imagine to have different projets to build on the same computer with different specs. If may brake your build if you forgot to change it.

If you have to build the pacakge on differents computer, you may have differents results due to this configuration file if you forgot to update it.

 

in any case, I appreciate your quick support that workaround my problem.

 

Best regards

 

MaximeR

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

Scott_Richardson
Active Participant

Maxime, the original purpose of the file was to apply to all solutions to prevent users from include Microsoft and some NI files in their packages. FWIW, we would like to expose this type of feature more formally in the application in the future. Thanks for the feedback that you would be interested in per solution settings for this type of functionality.

Scott Richardson
https://testeract.com
MaximeR
Active Participant

Hello,

 

I'm really convince that this configuration must be include inside the projet itself.

 

Another point. How do you exclude only files with a specific extension because this token for example "[UserDesktop]\\Project\\.*.bmp" will excludes all files including bmp in the name. How to exclude only files with bmp extension only.

 

At least it's the case with verion 20.5.

 

Best regards

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

Scott_Richardson
Active Participant

Maxime, the following is a better expression:

    [User Desktop]\\Project\\.*\.bmp$

 

Specifically:

  • Uses "\." instead of "." in front of the "bmp" value; otherwise would match any character before the "bmp".
  • The "$" says that the end of line must be reached.

If you want to exclude multiple extension you can do something like this:

    [User Desktop]\\Project\\.*\.(bmp|jpg|png)$

Scott Richardson
https://testeract.com
MaximeR
Active Participant

Hi Scott,

 

Thanks a lot for this quick reply.

A better documentation will be welcome in any case if this feature will not change.

 

Best regards

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

JuliaDawkins
Member

I have a similar question...I'm trying to exclude ".git" folders that are in a folder I'm adding as an input.  

 

The folder I'm adding as an input has the path: D:\myFiles\myProject\myFiles\, and I want to exclude the D:\myFiles\myProject\myFiles\.git folder, but it's not clear for me how to do this in the "DiscoveryExclusion.txt" file.

 

Thanks!

Scott_Richardson
Active Participant

Julia, you should be able to add the following which will exclude a folder called ".git" but it will also match ".gitmoretext":

[Exclude Paths]
.*\.git



Scott Richardson
https://testeract.com
JuliaDawkins
Member

Thank you, that worked perfectly!

 

I used the $ at the end so it wouldn't match extra text.

 

.*\.git$