https://bbs.deepin.org/post/196746 社区商店维护团队可以看看,这是很实用的一个技巧
https://bbs.deepin.org/post/196746 我们用的好像是apt吧@maicss
非常感谢,采用了
Featured Collection
Popular Events
有时安装软件后需要告诉用户如何使用这个软件。
一个简单的方法是:在 postinst 中调用 deepin-editor 打开软件文档(用户手册)。
但是,deepin软件安装器在安装软件时调用dpkg,环境变量没有正确设置导致无法在 postinst 中直接运行GUI程序,这不是BUG,而是设计如此。
解决方案如下: postinst 中加载桌面用户 .xAuthority 文件,设置DISPLAY环境变量。然后就可以调用GUI程序了。
在DEBIAN文件夹 postinst 文件中加入:
#!/bin/bash
export DISPLAY=:0
export XAUTHORITY=/home/`id -un 1000`/.Xauthority
sudo -u `id -un 1000` deepin-editor /opt/xxx-ext4/readme.txt
exit 0