mirror of
https://github.com/quamotion/dotnet-packaging.git
synced 2026-02-14 21:32:52 +00:00
Is it possible to reference an external file as a content file? #125
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @stephen-swensen on GitHub (Aug 2, 2022).
Let's say I have buillt a package like
myapp.deband distribute it to customers along with a customer-specific config file likemyapp.cfg... when installingmyapp.debfrom a directory withmyapp.cfgplaced along side of it, is it possible formyapp.debto reference the external file (relative to the directory being installed from, like a home directory) so that it is copied to the application installation directory (like/usr/share/myapp/myapp.cfg)? Bonus if installation aborts if the file is missing.Thanks!
@atauenis commented on GitHub (Aug 2, 2022):
Made a separate package, say,
myapp-company-branding, which will install brand configuration to/etc/myapp.conf.d/directory (myappshould read configuration from it). This is correct UNIX-way, and this is used by some Linux distributions to apply branding.@stephen-swensen commented on GitHub (Aug 2, 2022):
Hmm, I see - I'll think on that, thanks. I am a bit hesitant to go down that road because the work I am doing is extending Linux support to an app that currently just supports Windows. I want to minimize code and distribution differences (the Windows app is distributed as an MSI like
myapp.msiwhich picks up the externalmyapp.cfgand copies it to the installation directory, so I was wanting to replicate that as near as possible; the app also expects the configuration file to be present from the directory path of the executable, so I'd rather avoid platform specific differences there too).@stephen-swensen commented on GitHub (Aug 3, 2022):
Maybe debconf could be used somehow to prompt the user for the location of the config file and use it in a preinstall script to copy the file 🤔
Anyways, I'll go ahead and close this Issue if there is no direct way to do this through dotnet deb. Thanks for your insight!
@stephen-swensen commented on GitHub (Aug 3, 2022):
It's definitely hacky / fragile, but I was able to do what I was looking for with a preinstall script like: