CPACK_PRODUCTBUILD_RESOURCES_DIR files not added to pkg

I’m trying to add some additional files to the macos installer.

So I am using CPACK_PRODUCTBUILD_RESOURCES_DIR that should add the files in the directory to the Resource folder in the pkg.
And then add a script that copies the files to the correct folder on the users computer.

But the files does not show up in the Resource filer. I have a _CPack_Packages folder in my build tree where I can see that the files are added together with the license readme and welcome files. But in the final pkg file they are not added.

What could be the problem?

Known issue, but unfortunately no-one working on a fix that I’m aware of.

Thanks for the reply! :+1:
So a workaround could be to add a custom CPack.distribution.dist.in where I add the files manually?
Where should I put it and How do I add it? do you know?

edit:
I did a workaround script using
pkgutil --expand to unpack the pkg and then copy the files the files
and then pkgutil --flatten to restore the pkg again.
I think it will be good for me.

I don’t know the details and haven’t had time to explore it (and likely won’t for some time). Not sure if your workaround will break code signing, but I’ll have to leave you to explore that.