构建 install4j 安装程序时,当 dpkg 需要 sudo 时,如何添加 and/or 从用户主目录中删除数据

When building an install4j installer, How does one add and/or remove data from the users home directory when dpkg requires sudo

我正在使用 install4j 构建一个 .deb 安装程序,我尝试将桌面图标添加到用户的桌面,但它不起作用,因为 dpkg 需要 sudo,所以它试图将图标复制到 /root/Desktop这是不正确的,不存在。

我们还有一些应用程序数据要在卸载时清除,我相信它同样不会被删除,因为它是 运行 作为 sudo。

我没有为 unix 设置高程,我相信这是 dpkg 的要求。

原始用户的用户主目录不可用。用户主目录中的文件应该由应用程序自己创建,参见

Debian packaging: deploying files to the user home directory