LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Missing dlls in Build Distribution

LabWindows/CVI 2015.

Distribution built on Windows 7 computer

Distribution installed on Windows 10 computer

 

We have some non-NI hardware that won't run without associated dlls.  Various programers use one or more of the following methods to include the dlls in the project.

  • Paste copy of dll in project folder.
  • Add .lib files to the "Library Files" .
  • Add .dll files to the "Library Files".
  • Add .dll files directly to the project under the "Application Name" icon.
  • Add a path to the dlls with the "Include Paths" button of the "Edit Project" dialog.

Eventually we build the distribution (setup.exe installer) with associated files.  When editing the "Files" tab of the "Edit Installer", it seems like some dlls and the DLLDependencies file are automatically added to the program folder (C:\Program Files (x86)\App_Name\).  Sometimes I've clicked on the "Library Files" folder (under the project icon) in the upper left pane and then selected all dlls in the upper right pane and then added those to the program folder.  Usually I get the "one or more files were skipped because they were already included" message.  This extra step seems to give me a little better luck than other programmers. But every so often one of us gets snagged because the dlls don't get installed with the executable on the target computer.  This is a huge pain for us, because building the distribution must be witnessed by a Quality Assurance engineer which makes rebuilding the distribution a complicated event to repeat.

 

Two questions:

  1. What is the "Correct" and "Best" way to add dlls (non-NI) to a project?
  2. What is the "Correct" and "Best" way to ensure they are correctly loaded as part of the installer.
0 Kudos
Message 1 of 3
(2,423 Views)

Hi,

The correct way to add the .dll sounds like what you are doing. It's documented here:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P6AcSAK&l=en-US

As for the second question, I'm not sure. It may be worthwhile to contact our support team to help you troubleshoot in addition to the forums. Are you able to reproduce the behavior every time you build the installer for a certain project?


ZK
Technical Support Engineer | NI | Not actually retired but I don't know how to change that
0 Kudos
Message 2 of 3
(2,386 Views)

Over time I've picked up a few more tips on this topic.  The image below shows how the file zlib1.dll is added to the distribution in the "Files" tab of the "Edit Installer".  You can get here by clicking on "Manage Distributions" under the "Build" menu heading and then clicking on "Edit" "Add" or "New".

adding dlls to project obviscated.png

1.  If files are properly referenced in the "Library Files" folder those files will appear in the "Library Files" folder when you use the "Files" tab of the "Edit Installer" (see red markings in the inserted image)

2. You can put .lib files and .dll files in the "Library Files" folder.

3. The .lib files are used at compile time but not at run time.

4. The .dll files are used at run time but not compile time.

5. Given #3 above, there is no need to add .lib files to the build distribution.

6. Unless you know a .dll already exists on all target computers (where the software will be installed) and that your program can find it, you should consider adding it to the build distribution.

7. The image above shows how to add a .dll that's already in your project to the build distribution.  (follow the numbers steps in blue)

8. You can also add files from any location by expanding the "My Computer" icon below the project files.  But it seems like a better practice to get them from the "Library Files" folder when possible.

9. After adding zlib1.dll to the project the following lines were added to the .cws (workspace) file.

[File 0142]
Path = "/c/path/project_folder/imported_items/zlib1.dll"
File Type = "DLL"
Disk Date = 3576086280
In Projects = "1,"

 

10. After clicking "Save All" or closing the project or LabWindows itself the following lines were added to the .prj (project) file.

[File 0142]
File Type = "DLL"
Res Id = 142
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "zlib1.dll"
Path = "/c/path/project_folder/imported_items/zlib1.dll"
Exclude = False
Project Flags = 0
Folder = "Library Files"
Folder Id = 7

11.  After adding zlib1.dll to the build distribution (as shown in the attached image) the following lines were added to the .cds (config distribution settings?) file.

<simpleFile fileID="8" sourcePath="c:\path\project_folder\imported_items\zlib1.dll" relSourcePath="zlib1.dll" relSourceBase="0" targetDir="100" readonly="true" hidden="false" system="false" regActiveX="false" runAfterInstallStyle="IMMEDIATELY_RESUME_INSTALL" cmdLineArgs="" runAfterInstall="false" uninstCmdLnArgs="" runUninst="false"/>

12. LabWindows was unaware of some changes made to .prj file until I closed and restarted it.

 

0 Kudos
Message 3 of 3
(2,325 Views)