01-29-2019 12:27 PM
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.
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:
01-30-2019 04:47 PM
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?
02-20-2019 02:31 PM - edited 02-20-2019 02:32 PM
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".
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.