I have header files in C: or foo or include and I want to put them into ${installdir}/include/foo but they all go to ${installdir}/include/foo/include. How do I drop the last folder without having to explicitly list all of the header files in C: or foo or include?
Thanks,
Ben
Hi,
You could use an Advanced Filter that allows excluding files located at any level in the folder hierarchy of the <distributionDirectory>.
In this way you can pack C: or or foo only with the header files.
Regards,
Michiel D'Hont
Hi Michael,
I don't think I understand your response. I don't want to exclude any files from C: or or foo or or include in the installer. What I want to explicitly control is the destination folder for the header files. Right now InstallBuilder always appends the name of the folder to the installed location and I don't want that.
C: or or foo or or myheaders or or more_headers gets installed at ${installdir}/include/more_headers and I want them installed at ${installdir}/ or or include.
I have been able to do this by installing to a temp folder and then moving the files to the correct folder but I am looking for an easier way to do that.
Thanks,
Ben
Hi Ben,
Please accept my apologies for the misunderstanding. Unfortunately it's not possible to do this.
Best regards,
Michiel D'Hont
Try the bellow snippet, this should work. I tested and it worked for me.
<folderList>
<folder>
<description>component</description>
<destination>${installdir}/include/foo</destination>
<name>newfolder</name>
<platforms>all</platforms>
<distributionFileList>
<distributionFile>
<allowWildcards>1</allowWildcards>
<origin>C:/foo/include/*</origin>
</distributionFile>
</distributionFileList>
</folder>
</folderList>
I had the same question...I wanted to create a more generic installer script that would allow other users to drop applications files into a folder and them package them up without having to make many modifications to the installer script.
One work-around I found was to package all of these files inside a ZIP file and then extract them to the desired destination directory. I have InstallBuilder create this ZIP file for me during the pre-build action. I packaged the ZIP file in the installer and have it going to a temporary folder. Then during the post-installation step I run the unzip action.
Unfortunately, adding "/*" to the end of the path inside of the <origin> tag didn't work for me. That would have been a much more elegant solution.
Best regards,
Chris
Hi @Chris2021 ,
Did you add <allowWildcards>1</allowWildcards> to the <distributionFile>?
<distributionFile>
...
<allowWildcards>1</allowWildcards>
...
</distributionFile>
Thanks @michieldhont_!
I'm pretty sure I did but when I tried it again this morning it worked. Here is what I used:
<folder>
<description>Install Directory</description>
<destination>${installdir}</destination>
<name>install</name>
<platforms>all</platforms>
<distributionFileList>
<distributionFile>
<allowWildcards>1</allowWildcards>
<origin>copy to destination/*</origin>
</distributionFile>
</distributionFileList>
</folder>
I went back to an older version of my installer script and only difference I could find was that I had been using <distributionDirectory> instead of <distributionFile> but both options are working now. NOTE: I also have <saveRelativePaths> set to 1 so that <origin> resolves to "${build_project_directory}/copy to destination/*"
Thanks for encouraging me to give this another try! This seems to be more reliable then zipping up the files... I was seeing the unzip action fail occasionally if the destination was inside of a Windows UAC protected folder.
Best regards,
Chris