mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-05-21 23:49:51 +08:00
初步添加统信的wine打包脚本
This commit is contained in:
parent
2eb05c9b7c
commit
a01287dd6f
VM
ISO
VirtualMachine.pro.userWindows7X64Auto.isoWindows7X64Auto.iso.uibakWindows7X86Auto.isoWindows7X86Auto.iso.uibak[common-opts]]api
globalhost:mainwindow.cppmainwindow.uirun.py图标.qrc截图
package-script
IYWB.datcleanbottle.sh
debian.template
debian
deepin.msstylesdocs
elephant_debian_ex
icotoolmain.pymkicons.shpackage-hshw.shscript-packager.shspecified/temp/bottle
template
wps.logwrestool
3
VM/ISO/autorun.inf
Normal file
3
VM/ISO/autorun.inf
Normal file
@ -0,0 +1,3 @@
|
||||
[autorun]
|
||||
ICON=icon.ico
|
||||
LABEL=自动部署
|
BIN
VM/ISO/icon.png
Executable file
BIN
VM/ISO/icon.png
Executable file
Binary file not shown.
After ![]() (image error) Size: 35 KiB |
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.8.2, 2022-07-12T16:51:35. -->
|
||||
<!-- Written by QtCreator 4.8.2, 2022-07-13T14:26:12. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
BIN
VM/Windows7X64Auto.iso
Executable file → Normal file
BIN
VM/Windows7X64Auto.iso
Executable file → Normal file
Binary file not shown.
BIN
VM/Windows7X64Auto.iso.uibak
Normal file
BIN
VM/Windows7X64Auto.iso.uibak
Normal file
Binary file not shown.
BIN
VM/Windows7X86Auto.iso
Executable file → Normal file
BIN
VM/Windows7X86Auto.iso
Executable file → Normal file
Binary file not shown.
BIN
VM/Windows7X86Auto.iso.uibak
Normal file
BIN
VM/Windows7X86Auto.iso.uibak
Normal file
Binary file not shown.
0
VM/]
0
VM/]
@ -109,4 +109,17 @@ class Manager:
|
||||
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --draganddrop bidirectional")
|
||||
|
||||
def ShareFile(self, name, path):
|
||||
os.system(f"\"{self.managerPath}\" sharedfolder add \"{self.name}\" -name \"{name}\" -hostpath \"{path}\"")
|
||||
os.system(f"\"{self.managerPath}\" sharedfolder add \"{self.name}\" -name \"{name}\" -hostpath \"{path}\"")
|
||||
|
||||
def SetVBoxSVGA(self):
|
||||
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --graphicscontroller vboxsvga")
|
||||
|
||||
def SetMousePS2(self):
|
||||
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --mouse usb")
|
||||
|
||||
def SetKeyboardPS2(self):
|
||||
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --keyboard usb")
|
||||
|
||||
def OpenUSB(self):
|
||||
os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --usbohci on")
|
||||
pass
|
Binary file not shown.
0
VM/host:
0
VM/host:
@ -21,7 +21,7 @@ MainWindow::~MainWindow()
|
||||
void MainWindow::on_browser_clicked()
|
||||
{
|
||||
// 浏览镜像文件
|
||||
QString filePath = QFileDialog::getOpenFileName(this, "选择 ISO 文件", "~", "ISO 镜像文件(*.iso);;所有文件(*.*)");
|
||||
QString filePath = QFileDialog::getOpenFileName(this, "选择 ISO 文件", QDir::homePath(), "ISO 镜像文件(*.iso);;所有文件(*.*)");
|
||||
if(filePath != ""){
|
||||
ui->isoPath->setText(filePath);
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
<string>Windows 应用适配工具</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
@ -21,7 +21,7 @@
|
||||
<enum>QTabWidget::Rounded</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
@ -149,9 +149,22 @@ p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Noto Sans CJK SC'; font-size:10.5pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:26pt; font-weight:600;">给小白的一段话</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">其实本质上跑完安装程序就没有然后了,顶多如果想要运行舒服一点点,可以安装加强功能,直接拉到最底下看就可以了</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">如果爱折腾的话,下面的都看看也无所谓的</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">如果爱折腾的话,下面的都看看也无所谓的,想看往下翻就可以了</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(如果鼠标被锁定到里面了按下键盘右边的“Ctrl”键就可以了)</p>
|
||||
<hr />
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:26pt; font-weight:600;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:26pt; font-weight:600;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:26pt; font-weight:600;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:26pt; font-weight:600;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:26pt; font-weight:600;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:26pt; font-weight:600;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:26pt; font-weight:600;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:26pt; font-weight:600;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:26pt; font-weight:600;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:26pt; font-weight:600;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:26pt; font-weight:600;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:26pt; font-weight:600;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:26pt; font-weight:600;">安装是否需要人工进行操作?</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">如果您下载的镜像本程序支持,则大部分不用,已经尽量省去了让新手头疼的虚拟机程序安装,创建、设置虚拟机,虚拟磁盘分区,寻找原版镜像文件等内容</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图/截图_VirtualBox Machine_20220712191756.png" /></p>
|
||||
@ -159,13 +172,24 @@ p, li { white-space: pre-wrap; }
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图/截图_VirtualBox Machine_20220712192850.png" /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图/截图_VirtualBox Machine_20220712193527.png" /></p>
|
||||
<hr />
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:26pt; font-weight:600;">什么样的镜像本程序不支持?</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">1、过老的镜像,如 Windows XP、Windows Server 2003 等等,将完全无法自动安装,需要手动安装</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">2、非 Windows 7 安装镜像</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">3、Windows 7 企业版镜像</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">4、选择了错误的 Windows 7 位数的镜像,部分/全部无法自动处理安装</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:26pt; font-weight:600;">什么样的镜像本程序(可能)不支持自动安装?</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">非 Windows 7 镜像可能不支持自动安装(纯的 Windows 7 企业版镜像可能不支持自动安装),不保证系统能自动安装成功,例如 Windows XP、Windows 10、Deepin、Ubuntu 等等</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<hr />
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:26pt; font-weight:600;">默认的虚拟机设置不习惯怎么改?</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">1、打开启动器,打开 Oracle VM VirtualBox 程序</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">2、选择名字为“Windows”的虚拟机,然后在右边点击设置</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图/截图_VirtualBox Manager_20220712223602.png" /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">3、在这里修改即可</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图/截图_VirtualBox_20220712223705.png" /></p>
|
||||
<hr />
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:26pt; font-weight:600;">安装加强功能有什么好处?</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">1、支持鼠标自由从虚拟机和实体机切换</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">2、支持虚拟机根据窗口大小自动设置分辨率</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">3、支持文件共享、剪切板共享、文件拖放</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">4、支持无缝模式</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图/截图_选择区域_20220712224639.png" /></p>
|
||||
<hr />
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:26pt; font-weight:600;">如何安装加强功能?</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">1、点击“设备”=》“加强功能”</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/picture/截图_VirtualBox Machine_20220712142929.png" /></p>
|
||||
@ -254,13 +278,14 @@ p, li { white-space: pre-wrap; }
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Noto Sans CJK SC'; font-size:10.5pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">此为 wine 运行器附属组件,基于 C++ Qt、Python 和 Virtualbox 制作,通过运行安装 Windows 操作系统的虚拟机实现在 Linux 运行 Windows exe 程序的功能。</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">此为 wine 运行器附属组件(虽然违背了“Wine Is Not An Emulator”&lt;Wine 不是一个模拟器&gt;的原意),旨在能更加完美、简单的运行 Windows 应用</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">本程序基于 C++ Qt、Python 和 Virtualbox 制作,通过运行安装 Windows 操作系统的虚拟机实现在 Linux 运行 Windows exe 程序的功能。</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">基于 GPL V3 协议开源</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">项目地址:</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Gitee:<a href="https://gitee.com/gfdgd-xi/deep-wine-runner"><span style=" font-size:11pt; text-decoration: underline; color:#0082fa;">https://gitee.com/gfdgd-xi/deep-wine-runner</span></a></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Github:<a href="https://github.com/gfdgd-xi/deep-wine-runner"><span style=" font-size:11pt; text-decoration: underline; color:#0082fa;">https://github.com/gfdgd-xi/deep-wine-runner</span></a></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Gitlink:<a href="https://gitlink.org.cn/gfdgd_xi/deep-wine-runner"><span style=" font-size:11pt; text-decoration: underline; color:#0082fa;">https://gitlink.org.cn/gfdgd_xi/deep-wine-runner</span></a></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">此组件也有非常大的缺点,就是相比于 Wine,会需要占用大量的空间、安装需要大量的时间、某些情况下需要相比于 Wine 需要消耗更多的系统资源,但可以更加完美、流畅的运行 Windows 应用,会尽量减少因为缺少或未实现导致的 Windows exe 程序运行异常</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">该组件制作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢</p>
|
||||
<hr />
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">参考文献:</p>
|
||||
|
@ -5,6 +5,7 @@ import sys
|
||||
import psutil
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.system("clear")
|
||||
programPath = os.path.split(os.path.realpath(__file__))[0]
|
||||
if len(sys.argv) < 3 :
|
||||
print("参数不齐!")
|
||||
@ -33,13 +34,17 @@ if __name__ == "__main__":
|
||||
vm.MountISO(f"{programPath}/Windows7X86Auto.iso", device=1)
|
||||
elif sys.argv[2] == "1":
|
||||
vm.MountISO(f"{programPath}/Windows7X64Auto.iso", device=1)
|
||||
vm.SetCPU(2)
|
||||
vm.SetCPU(1)
|
||||
vm.SetMemory(psutil.virtual_memory().total // 1024 // 1024 // 3)
|
||||
vm.SetDisplayMemory(32)
|
||||
vm.SetNetBridge(net)
|
||||
vm.EnabledAudio()
|
||||
vm.EnabledClipboardMode()
|
||||
vm.EnabledDraganddrop()
|
||||
vm.SetVBoxSVGA()
|
||||
vm.SetMousePS2()
|
||||
vm.SetKeyboardPS2()
|
||||
vm.OpenUSB()
|
||||
vm.ShareFile("ROOT", "/")
|
||||
vm.ShareFile("HOME", api.homePath)
|
||||
vm.Start()
|
@ -13,5 +13,8 @@
|
||||
<file>截图/截图_VirtualBox Machine_20220712191756.png</file>
|
||||
<file>截图/截图_VirtualBox Machine_20220712192850.png</file>
|
||||
<file>截图/截图_VirtualBox Machine_20220712193527.png</file>
|
||||
<file>截图/截图_VirtualBox Manager_20220712223602.png</file>
|
||||
<file>截图/截图_VirtualBox_20220712223705.png</file>
|
||||
<file>截图/截图_选择区域_20220712224639.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
BIN
VM/截图/截图_VirtualBox Manager_20220712223602.png
Normal file
BIN
VM/截图/截图_VirtualBox Manager_20220712223602.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 107 KiB |
BIN
VM/截图/截图_VirtualBox_20220712223705.png
Normal file
BIN
VM/截图/截图_VirtualBox_20220712223705.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 47 KiB |
BIN
VM/截图/截图_选择区域_20220712224639.png
Normal file
BIN
VM/截图/截图_选择区域_20220712224639.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 1006 KiB |
2
package-script/IYWB.dat
Executable file
2
package-script/IYWB.dat
Executable file
@ -0,0 +1,2 @@
|
||||
|
||||
|
390
package-script/cleanbottle.sh
Executable file
390
package-script/cleanbottle.sh
Executable file
@ -0,0 +1,390 @@
|
||||
#!/bin/sh
|
||||
|
||||
WINE_CMD="deepin-wine5"
|
||||
userdir=$USER
|
||||
|
||||
remove_file()
|
||||
{
|
||||
echo "============remove [$1]"
|
||||
rm -rfv "$1"
|
||||
}
|
||||
|
||||
purge_dir()
|
||||
{
|
||||
echo "=============clean [$1]"
|
||||
if [ -e "$1" ]; then
|
||||
find "$1" -mindepth 1 -ignore_readdir_race -exec rm -rfv {} \;
|
||||
else
|
||||
mkdir -p "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
clean_gecko()
|
||||
{
|
||||
geckoid=$($WINE_CMD $BottleBase/windows/system32/uninstaller.exe --list | grep Gecko | cut -d"|" -f1)
|
||||
echo " gecko GUID: ${geckoid}"
|
||||
if [ -n "${geckoid}" ]; then
|
||||
echo "uninstall gecko..."
|
||||
$WINE_CMD $BottleBase/windows/system32/uninstaller.exe --remove ${geckoid}
|
||||
fi
|
||||
if [ -e "$BottleBase/windows/system32/gecko" ]; then
|
||||
for i in $(ls "$BottleBase/windows/system32/gecko/" | grep -v plugin); do
|
||||
echo "=============remove gecko dir [$i]"
|
||||
rm -rfv "$BottleBase/windows/system32/gecko/$i"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
clean_common_temp()
|
||||
{
|
||||
remove_file "$BottleBase/../winetricks.log"
|
||||
purge_dir "$BottleBase/windows/ControlPanelDB"
|
||||
remove_file "$BottleBase/windows/control-panel.db"
|
||||
purge_dir "$BottleBase/windows/temp"
|
||||
purge_dir "$BottleBase/windows/Installer"
|
||||
purge_dir "$BottleBase/users/$userdir/Temp"
|
||||
purge_dir "$BottleBase/users/$userdir/Cookies"
|
||||
purge_dir "$BottleBase/users/$userdir/Recent"
|
||||
remove_file "$BottleBase/users/$userdir/Application Data/pcmaster"
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/wine_gecko"
|
||||
purge_dir "$BottleBase/users/$userdir/Local Settings/History"
|
||||
purge_dir "$BottleBase/users/$userdir/Local Settings/Temporary Internet Files"
|
||||
#remove_file "$BottleBase/users/${USER}"
|
||||
purge_dir "$BottleBase/users/Public/Temp"
|
||||
remove_file "$BottleBase/../PACKAGE_VERSION"
|
||||
remove_file "$BottleBase/../update.policy"
|
||||
purge_dir "$BottleBase/deepin"
|
||||
}
|
||||
|
||||
cleanup_aliwangwang()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/AliWangWang/AliIM.exe" ]; then return; fi
|
||||
|
||||
echo "++++AliWangWang detected. cleaning..."
|
||||
purge_dir "$BottleBase/Program Files/AliWangWang/profiles"
|
||||
purge_dir "$BottleBase/Program Files/AliWangWang/new"
|
||||
purge_dir "$BottleBase/users/$userdir/Local Settings/Application Data/aef"
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/AliWangWang"
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/TaobaoProtect"
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/wwbizsrv"
|
||||
}
|
||||
|
||||
cleanup_aliworkbench()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/AliWorkbench/AliWorkbench.exe" ]; then return; fi
|
||||
|
||||
echo "++++AliWorkbench detected. cleaning..."
|
||||
purge_dir "$BottleBase/users/Public/Documents/AliWorkbench"
|
||||
purge_dir "$BottleBase/users/$userdir/Local Settings/Application Data/aef/"
|
||||
purge_dir "$BottleBase/users/$userdir/Local Settings/Application Data/AliWorkbench/"
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/AliWorkbench/"
|
||||
}
|
||||
|
||||
cleanup_flash()
|
||||
{
|
||||
if [ ! -e "$BottleBase/windows/system32/Macromed/Flash/" ]; then return; fi
|
||||
|
||||
echo "++++flash detected. cleaning..."
|
||||
remove_file "$BottleBase/users/$userdir/Application Data/Adobe"
|
||||
remove_file "$BottleBase/users/$userdir/Application Data/Macromedia"
|
||||
remove_file "$BottleBase/windows/system32/FlashPlayerApp.exe"
|
||||
remove_file "$BottleBase/windows/ControlPanelDB/FlashPlayerCPLApp.ico"
|
||||
remove_file "$BottleBase/windows/system32/FlashPlayerCPLApp.cpl"
|
||||
remove_file "$BottleBase/windows/system32/Macromed/Flash/FlashInstall.log"
|
||||
#remove_file "$BottleBase/windows/system32/Macromed/Flash/Flash*.dll"
|
||||
#remove_file "$BottleBase/windows/system32/Macromed/Flash/Flash*.exe"
|
||||
}
|
||||
|
||||
cleanup_foobar2000()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/foobar2000/foobar2000.exe" ]; then return; fi
|
||||
|
||||
echo "++++foobar2000 detected. cleaning..."
|
||||
purge_dir "$BottleBase/Program Files/foobar2000/configuration"
|
||||
purge_dir "$BottleBase/Program Files/foobar2000/library"
|
||||
purge_dir "$BottleBase/Program Files/foobar2000/playlists-v1.3"
|
||||
remove_file "$BottleBase/Program Files/foobar2000/theme.fth"
|
||||
}
|
||||
|
||||
cleanup_mailmaster()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/Netease/MailMaster/MailMaster.exe" ]; then return; fi
|
||||
|
||||
echo "++++MailMaster detected. cleaning..."
|
||||
remove_file "$BottleBase/Program Files/Netease/MailMaster/account"
|
||||
remove_file "$BottleBase/Program Files/Netease/MailMaster/address"
|
||||
remove_file "$BottleBase/Program Files/Netease/MailMaster/tmp"
|
||||
remove_file "$BottleBase/Program Files/Netease/MailMaster/UpdateTemp"
|
||||
remove_file "$BottleBase/Program Files/Netease/MailMaster/applog.txt"
|
||||
remove_file "$BottleBase/Program Files/Netease/MailMaster/netlog.txt"
|
||||
remove_file "$BottleBase/Program Files/Netease/MailMaster/global.cfg"
|
||||
remove_file "$BottleBase/Program Files/Netease/MailMaster/schd.sdb"
|
||||
}
|
||||
|
||||
cleanup_nativeie()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/Internet Explorer/iexplore.exe.mui" ]; then return; fi
|
||||
|
||||
echo "++++native IE detected. cleaning..."
|
||||
purge_dir "$BottleBase/users/$userdir/Local Settings/Application Data/Microsoft/"
|
||||
|
||||
remove_file "$BottleBase/windows/ie8"
|
||||
remove_file "$BottleBase/windows/%DownloadedProgramFiles%"
|
||||
|
||||
#remove all useless gecko files
|
||||
remove_file "$BottleBase/windows/system32/gecko"
|
||||
}
|
||||
|
||||
cleanup_qq_before()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/Tencent/QQ/Bin/QQ.exe" ]; then return; fi
|
||||
|
||||
echo "++++QQ detected. cleaning..."
|
||||
if [ -f "$BottleBase/Program Files/Tencent/Qzone/QQPhotoDrawUpdateSvr.exe" ]; then
|
||||
remove_file "$BottleBase/Program Files/Tencent/Qzone"
|
||||
fi
|
||||
if [ -f "$BottleBase/Program Files/Tencent/QQGameMicro/QQGameMicro.exe" ]; then
|
||||
remove_file "$BottleBase/Program Files/Tencent/QQGameMicro"
|
||||
fi
|
||||
}
|
||||
|
||||
cleanup_qq()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/Tencent/QQ/Bin/QQ.exe" ]; then return; fi
|
||||
|
||||
echo "++++cleaning QQ remains..."
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/Tencent"
|
||||
purge_dir "$BottleBase/users/$userdir/Local Settings/Application Data/Tencent"
|
||||
purge_dir "$BottleBase/users/Public/Application Data/Tencent/QQPCMgr"
|
||||
purge_dir "$BottleBase/users/Public/Application Data/Tencent/QQProtect"
|
||||
purge_dir "$BottleBase/users/Public/Application Data/Tencent/QQDownload"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/Npchrome"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/QQDownload"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/QQMiniDL"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/TXFTN"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/TXPTOP"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/TXSSO"
|
||||
purge_dir "$BottleBase/Program Files/Tencent/QQGameMicro"
|
||||
purge_dir "$BottleBase/Program Files/Tencent/QQMusic"
|
||||
remove_file "$BottleBase/Program Files/Tencent/QQ/Plugin/Com.Tencent.QQPet/bin/QQPet"
|
||||
remove_file "$BottleBase/Program Files/Tencent/QQ/Users"
|
||||
}
|
||||
|
||||
cleanup_tim()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/Tencent/TIM/Bin/TIM.exe" ]; then return; fi
|
||||
|
||||
echo "++++cleaning TIM remains..."
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/Tencent"
|
||||
purge_dir "$BottleBase/users/$userdir/Local Settings/Application Data/Tencent"
|
||||
purge_dir "$BottleBase/users/Public/Application Data/Tencent/QQPCMgr"
|
||||
purge_dir "$BottleBase/users/Public/Application Data/Tencent/QQProtect"
|
||||
purge_dir "$BottleBase/users/Public/Application Data/Tencent/QQDownload"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/Npchrome"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/QQDownload"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/QQMiniDL"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/TXFTN"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/TXPTOP"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/TXSSO"
|
||||
purge_dir "$BottleBase/Program Files/Tencent/QQGameMicro"
|
||||
purge_dir "$BottleBase/Program Files/Tencent/QQMusic"
|
||||
purge_dir "$BottleBase/Program Files/Tencent/SSPlus"
|
||||
remove_file "$BottleBase/Program Files/Tencent/TIM/Users"
|
||||
}
|
||||
|
||||
cleanup_wxwork()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/WXWork/WXWork.exe" ]; then return; fi
|
||||
|
||||
echo "++++cleaning WXWork remains..."
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/Tencent"
|
||||
}
|
||||
|
||||
cleanup_wechat()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/Tencent/WeChat/WeChat.exe" ]; then return; fi
|
||||
|
||||
echo "++++cleaning WeChat remains..."
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/Tencent"
|
||||
}
|
||||
|
||||
cleanup_baidupan()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/baidu/BaiduNetdisk/baidunetdisk.exe" ]; then return; fi
|
||||
|
||||
echo "++++cleaning baidu net disk remains..."
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/BaiduYunGuanjia"
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/BaiduYunKernel"
|
||||
purge_dir "$BottleBase/BaiduNetdiskDownload"
|
||||
purge_dir "$BottleBase/Program Files/baidu/Download"
|
||||
remove_file "$BottleBase/Program Files/baidu/BaiduNetdisk/users"
|
||||
}
|
||||
|
||||
cleanup_foxmail()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/Foxmail 7.2/Foxmail.exe" ]; then return; fi
|
||||
|
||||
echo "++++cleaning Foxmail remains..."
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/HBuilder"
|
||||
remove_file "$BottleBase/Program Files/Foxmail 7.2/Storage"
|
||||
remove_file "$BottleBase/Program Files/Foxmail 7.2/FMStorage.list"
|
||||
}
|
||||
|
||||
cleanup_hbuilder()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/HBuilder/HBuilder.exe" ]; then return; fi
|
||||
|
||||
echo "++++cleaning HBuilder remains..."
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/HBuilder"
|
||||
purge_dir "$BottleBase/users/$userdir/HBuilder"
|
||||
purge_dir "$BottleBase/users/$userdir/HBuilder settings"
|
||||
$WINE_CMD reg DELETE "HKCU\\Software\\HBuilder" /f
|
||||
}
|
||||
|
||||
cleanup_thunderspeed()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/Thunder Network/Thunder/Program/Thunder.exe" ]; then return; fi
|
||||
|
||||
echo "++++cleaning ThunderSpeed remains..."
|
||||
purge_dir "$BottleBase/users/$userdir/AppData/LocalLow/Thunder Network"
|
||||
purge_dir "$BottleBase/users/Public/Application Data/Thunder Network"
|
||||
purge_dir "$BottleBase/users/Public/Thunder Network"
|
||||
purge_dir "$BottleBase/Program Files/Thunder Network/Thunder/Data/ThunderPush"
|
||||
purge_dir "$BottleBase/Program Files/Thunder Network/Thunder/Data/SmallHornCtrlCenter"
|
||||
purge_dir "$BottleBase/Program Files/Thunder Network/Thunder/XLApp"
|
||||
}
|
||||
|
||||
cleanup_qqdownload()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/Tencent/QQDownload/QQDownload.exe" ]; then return; fi
|
||||
|
||||
echo "++++QQDownload detected. cleaning..."
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/Tencent/TXSSO/SetupLogs"
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/Tencent/Logs"
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/Tencent/QQDownload"
|
||||
#mkdir -p "$BottleBase/users/$userdir/Application Data/Tencent/QQDownload/115248456/Setting"
|
||||
}
|
||||
|
||||
cleanup_qqcrm()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/Tencent/BizQQ/Bin/QQCRM.exe" ]; then return; fi
|
||||
|
||||
echo "++++QQCRM detected. cleaning..."
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/Tencent/Logs"
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/Tencent/QQCRM/STemp"
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/Tencent/TXSSO"
|
||||
}
|
||||
|
||||
cleanup_qqeim()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/Tencent/QQEIM/Bin/QQEIM.exe" ]; then return; fi
|
||||
|
||||
echo "++++QQEIM detected. cleaning..."
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/Tencent/Logs"
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/Tencent/QQEIM/STemp"
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/Tencent/TXSSO"
|
||||
}
|
||||
|
||||
cleanup_richez()
|
||||
{
|
||||
if [ ! -e "$BottleBase/GTJA/RichEZ/TdxW.exe" ]; then return; fi
|
||||
|
||||
echo "++++Richez detected. cleaning..."
|
||||
remove_file "$BottleBase/GTJA/RichEZ/JBPlugins/pyerr"
|
||||
remove_file "$BottleBase/GTJA/RichEZ/RichET/bin/flyingfish.log"
|
||||
purge_dir "$BottleBase/GTJA/RichEZ/RichET/fflog"
|
||||
purge_dir "$BottleBase/GTJA/RichEZ/RichET/tmp"
|
||||
remove_file "$BottleBase/GTJA/RichEZ/T0002/customcfg_gtjazd.zip"
|
||||
remove_file "$BottleBase/GTJA/RichEZ/T0002/hq_cache"
|
||||
purge_dir "$BottleBase/GTJA/RichEZ/T0002/tmp"
|
||||
remove_file "$BottleBase/GTJA/RichEZ/T0002/xml_cache"
|
||||
remove_file "$BottleBase/GTJA/RichEZ/webs/web_cache"
|
||||
}
|
||||
|
||||
software_cleaner_before()
|
||||
{
|
||||
cleanup_qq_before
|
||||
}
|
||||
|
||||
cleanup_qqlite()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/Tencent/QQLite/Bin/QQ.exe" ]; then return; fi
|
||||
|
||||
echo "++++cleaning QQ Lite remains..."
|
||||
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/Tencent"
|
||||
purge_dir "$BottleBase/users/$userdir/Local Settings/Application Data/Tencent"
|
||||
purge_dir "$BottleBase/users/Public/Application Data/Tencent"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/Npchrome"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/QQDownload"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/QQMiniDL"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/TXFTN"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/TXPTOP"
|
||||
remove_file "$BottleBase/Program Files/Common Files/Tencent/TXSSO"
|
||||
remove_file "$BottleBase/Program Files/Tencent/QQLite/Users"
|
||||
}
|
||||
|
||||
cleanup_youku()
|
||||
{
|
||||
if [ ! -e "$BottleBase/Program Files/YouKu/YoukuClient/YoukuDesktop.exe" ]; then return; fi
|
||||
|
||||
echo "++++cleaning YouKu remains..."
|
||||
purge_dir "$BottleBase/Program Files/YouKu/YoukuClient/repaire"
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/youku"
|
||||
purge_dir "$BottleBase/users/$userdir/Application Data/ytmediacenter"
|
||||
}
|
||||
|
||||
software_cleaner()
|
||||
{
|
||||
cleanup_aliwangwang
|
||||
cleanup_aliworkbench
|
||||
#cleanup_flash
|
||||
cleanup_foobar2000
|
||||
cleanup_mailmaster
|
||||
cleanup_nativeie
|
||||
cleanup_qq
|
||||
cleanup_tim
|
||||
cleanup_qqdownload
|
||||
cleanup_qqeim
|
||||
cleanup_qqcrm
|
||||
cleanup_richez
|
||||
cleanup_qqlite
|
||||
cleanup_youku
|
||||
cleanup_foxmail
|
||||
cleanup_thunderspeed
|
||||
cleanup_wechat
|
||||
cleanup_wxwork
|
||||
cleanup_baidupan
|
||||
cleanup_hbuilder
|
||||
}
|
||||
|
||||
#=============================================
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "prefix should be given"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BottlePath=$1
|
||||
BottleBase=${BottlePath}/drive_c
|
||||
|
||||
if [ ! -d "${BottlePath}" ]; then
|
||||
echo "prefix do not exists"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
#if [ ! -e "${BottlePath}/.update-timestamp" ]; then
|
||||
# echo "invalid prefix"
|
||||
# exit 3
|
||||
#fi
|
||||
|
||||
echo "clean $BottlePath"
|
||||
export WINEPREFIX=${BottlePath}
|
||||
/usr/lib/i386-linux-gnu/deepin-wine5/wineserver -k
|
||||
|
||||
software_cleaner_before
|
||||
clean_gecko
|
||||
software_cleaner
|
||||
clean_common_temp
|
||||
|
||||
exit 0
|
29
package-script/debian.template/postinst.template
Executable file
29
package-script/debian.template/postinst.template
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
"configure")
|
||||
echo "most recently configured version $2"
|
||||
;;
|
||||
"abort-upgrade")
|
||||
echo "Old: abort upgrade to $2"
|
||||
;;
|
||||
"abort-remove")
|
||||
if [ "#$2" == "#in-favour" ]; then
|
||||
echo "Conflictor: try to install package $3 version $4"
|
||||
else
|
||||
echo "abort-remove"
|
||||
fi
|
||||
;;
|
||||
"abort-deconfigure")
|
||||
# $2 == "in-favour"
|
||||
echo "Conflictor: failed install package:$3 version $4"
|
||||
if [ "#$5" == "removing" ]; then
|
||||
echo "Deconfigured: removing conflicting package $6 version $7"
|
||||
fi
|
||||
*)
|
||||
esac
|
||||
|
||||
# Make sure the script returns 0
|
||||
true
|
||||
|
||||
#DEBHELPER#
|
39
package-script/debian.template/postrm.template
Executable file
39
package-script/debian.template/postrm.template
Executable file
@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
"remove")
|
||||
if [ "#$2" = "in-favour" ]; then
|
||||
echo "Conflictor: install $3 version $4 to remove me"
|
||||
else
|
||||
echo "normal remove me"
|
||||
fi
|
||||
;;
|
||||
"purge")
|
||||
echo "purge"
|
||||
;;
|
||||
"upgrade")
|
||||
echo "Old: upgrade to $2"
|
||||
;;
|
||||
"abort-upgrade")
|
||||
echo "abort to upgrade to $2"
|
||||
;;
|
||||
"failed-upgrade")
|
||||
echo "failed upgrade from version $2"
|
||||
;;
|
||||
"abort-install")
|
||||
if [ ! -z "$2" ]; then
|
||||
echo "abort install form version $3"
|
||||
else
|
||||
echo "abort-install"
|
||||
fi
|
||||
;;
|
||||
"disappear")
|
||||
echo "Disappearer: overwirte by $3 version $4"
|
||||
;;
|
||||
*)
|
||||
esac
|
||||
|
||||
# Make sure the script returns 0
|
||||
true
|
||||
|
||||
#DEBHELPER#
|
23
package-script/debian.template/preinst.template
Executable file
23
package-script/debian.template/preinst.template
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
"install")
|
||||
if [ ! -z "$2" ]; then
|
||||
echo "try to install from version $2"
|
||||
else
|
||||
echo "normal install"
|
||||
fi
|
||||
;;
|
||||
"upgrade")
|
||||
echo "upgrade from version $2"
|
||||
;;
|
||||
"abort-upgrade")
|
||||
echo "Old: abort upgrade to version $2"
|
||||
;;
|
||||
*)
|
||||
esac
|
||||
|
||||
# Make sure the script returns 0
|
||||
true
|
||||
|
||||
#DEBHELPER#
|
30
package-script/debian.template/prerm.template
Executable file
30
package-script/debian.template/prerm.template
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
"remove")
|
||||
if [ "#$2" == "#in-favour" ]; then
|
||||
echo "Conflictor: install $3 version $4 to remove me"
|
||||
else
|
||||
echo "normal remove"
|
||||
fi
|
||||
;;
|
||||
"upgrade")
|
||||
echo "Old: upgrade to version $2"
|
||||
;;
|
||||
"failed-upgrade")
|
||||
echo "failed to upgrade from $3"
|
||||
;;
|
||||
"deconfigure")
|
||||
# $2 == "in-favour"
|
||||
echo "Deconfigured: install package:$3 version $4"
|
||||
if [ "#$5" == "removing" ]; then
|
||||
echo "Deconfigured: removing conflicting package $6 version $7"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
esac
|
||||
|
||||
# Make sure the script returns 0
|
||||
true
|
||||
|
||||
#DEBHELPER#
|
15
package-script/debian/build
Executable file
15
package-script/debian/build
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
# (c) Copyright 2008. CodeWeavers, Inc.
|
||||
set -e
|
||||
cd "$1"
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installdirs
|
||||
dh_install --sourcedir=/
|
||||
dh_link
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
dh_installdeb
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb --destdir=.
|
5
package-script/debian/changelog
Executable file
5
package-script/debian/changelog
Executable file
@ -0,0 +1,5 @@
|
||||
@deb_package_name@ (@deb_version_string@) unstable; urgency=low
|
||||
|
||||
* New @app_name@ package.
|
||||
|
||||
-- @deb_packager@ <test@test.com> @deb_date@
|
1
package-script/debian/compat
Executable file
1
package-script/debian/compat
Executable file
@ -0,0 +1 @@
|
||||
5
|
16
package-script/debian/control
Executable file
16
package-script/debian/control
Executable file
@ -0,0 +1,16 @@
|
||||
Source: @deb_package_name@
|
||||
Section: non-free/otherosfs
|
||||
Priority: optional
|
||||
Maintainer: @deb_packager@
|
||||
Build-Depends: debhelper (>= 3.0), fakeroot
|
||||
Standards-Version: 3.7.3.0
|
||||
|
||||
Package: @deb_package_name@
|
||||
Depends: @package_depends@
|
||||
Recommends: libcapi20-3, libcups2, libdbus-1-3, libfontconfig1, libfreetype6, libglu1-mesa | libglu1, libgnutls30 | libgnutls28 | libgnutls26, libgsm1, libgssapi-krb5-2, libjpeg62-turbo | libjpeg8, libkrb5-3, libodbc1, libosmesa6, libpng16-16 | libpng12-0, libsane | libsane1, libsdl2-2.0-0, libtiff5, libv4l-0, libxcomposite1, libxcursor1, libxfixes3, libxi6, libxinerama1, libxrandr2, libxrender1, libxslt1.1, libxxf86vm1
|
||||
Replaces: @old_package@
|
||||
Provides: @old_package@
|
||||
Conflicts: @old_package@
|
||||
Architecture: i386
|
||||
Multi-Arch: foreign
|
||||
Description: @app_description@
|
2
package-script/debian/copyright
Executable file
2
package-script/debian/copyright
Executable file
@ -0,0 +1,2 @@
|
||||
This package contains a virtual Windows environment.
|
||||
See the copyrights and licenses of the individual applications it contains.
|
BIN
package-script/deepin.msstyles
Executable file
BIN
package-script/deepin.msstyles
Executable file
Binary file not shown.
84
package-script/docs/ReadMe.txt
Executable file
84
package-script/docs/ReadMe.txt
Executable file
@ -0,0 +1,84 @@
|
||||
本文打包容器指的是打包deepin-wine维护的应用,主要讲如何将一个容器制作成安装包,以及一些辅助脚本的说明。
|
||||
|
||||
## 准备容器
|
||||
|
||||
这里主要讲打包相关的问题,如何制作容器不在这里赘述。本文前提是已经有了一个可能正常运行的容器。主要注意如下几点问题:
|
||||
|
||||
1. 容器存放目录最好是在~/.deepinwine目录下,因为打包的容器默认是解压到这个目录。放在这个目录方便以后更新容器可以直接在之前打包解压的容器基础之上更新。
|
||||
|
||||
2. 将容器尽量清理干净,不要有个人信息,尽量不要有太多多余的文件。打包过程中会清理一些通用不必要的文件,针对不同容器可能需要特殊处理,可以在cleanbottle.sh脚步中添加。
|
||||
|
||||
对于更新容器的情况,不需要重新创建容器,直接执行运行脚本就可以创建之前打包的容器,如/opt/deepinwine/apps/Deepin-QQ/run.sh -c(注意先删除之前的容器,保证容器是干净的)。
|
||||
通过命令生成容器之后,在这个容器基础上修改,然后打包。
|
||||
|
||||
## 创建配置文件
|
||||
|
||||
这里的配置文件就是一个打包脚本,可以参考[打包工具](https://gitlab.deepin.io/wine/wine-package-script)中package-QQ.sh编写,这个脚本主要是定义一些环境变量,如:
|
||||
|
||||
* app_description 安装包的描述
|
||||
|
||||
* app_name 应用程序的英文名
|
||||
|
||||
* app_name_zh_cn 应用程序的中文名
|
||||
|
||||
* origin_bottle_name 指定打包容器的名字,如果用这个会在home目录查找这个目录打包。一般都不用这个,统一放到~/.deepinwine目录之后就没有必要。
|
||||
|
||||
* public_bottle_name 安装之后运行解压的目录名称,存放在~/.deepinwine目录,目前默认也是用这个参数选择打包容器。
|
||||
|
||||
* desktop_file_categories 应用程序类型,便于系统对应用程序进行分类。打包脚本中如果这个参数为空则不制作desktop文件,下面的两个参数就不需要
|
||||
|
||||
* desktop_file_main_exe desktop文件中StartupWMClass字段。用于让桌面组件将窗口类名与desktop文件相对应。这个值为实际运行的主程序EXE的文件名,wine在程序运行后会将文件名设置为窗口类名。
|
||||
|
||||
* exec_path 应用程序运行的路径,这里指定的是Windows格式的文件路径。
|
||||
|
||||
* deb_package_name 生成安装包的包名。UOS上面命名规则是域名倒序+deepin,如com.qq.im.deepin;之前版本是deepin+域名倒序,如deepin.com.qq.im
|
||||
|
||||
* deb_version_string 生成安装包的版本号。版本号规则是原始版本号+deepin+小版本号,如应用程序原始版本号是9.0.0,那么打包的第一个版本可以是9.0.0deepin0
|
||||
|
||||
* old_package_name 某些情况同一个应用程序包名会改变,在更新之后需要能替换之前的安装包。这样就可以在安装包的replace字段中添加旧的包名达到目的。
|
||||
|
||||
* package_depends 指定安装的依赖,为空的时候为默认通用的依赖。
|
||||
|
||||
## 暗藏机关
|
||||
|
||||
如果容器没有特殊情况,创建上一步的配置文件就可以构建成一个安装包,但是实际情况中往往会有一些各种各样的需求,下面就列举下目前已经存在的可配置项:
|
||||
|
||||
* 应用程序图标:定义了desktop_file_categories字段的应用程序会创建desktop文件,里面指定的图标文件名是包名。图标来源有两个,一是系统主题自带,另一个就是我们打包带上图标。现在打包脚本默认都会带上图标,有两种处理方式,一是手动将svg的图标命名成packagename.svg放到icons目录,如果没有svg图片,打包脚步会自动提取exec_path指定的二进制中的图标文件放到icons目录。mkicons.sh是基于icoutils里面的工具做的,可以自动解压出PE文件中的图标文件,git中icotool和wrestool是有解决一个问题的版本,源码找不到了。
|
||||
|
||||
* [UOS商店上架应用规范](https://shimo.im/docs/dhQd9R3PYprtPVDj/read):新的规范主要限制了文件存放的目录、禁用安装脚本、添加权限配置等。打包脚步对应的分支是v20-uos,之前版本对应的分支是elephant。后面需要合并维护到一个分支,一次打包出两个版本。
|
||||
|
||||
* 安装文件:打包脚本有两种方式处理安装文件,一种是通用的,如desktop、容器压缩包等;另一种是在specified目录创建对应包名的目录,打包脚本会拷贝这个目录下的文件到安装目录。包名目录下有两个目录:bottle存放的文件会拷贝到容器中,最终会存放于容器压缩包中
|
||||
;root存放的文件会拷贝到系统目录,最终安装到系统中会保持原来的目录结构,如root/usr/share/deepin-wine/test最终会安装到系统的/usr/share/deepin-wine/test。
|
||||
|
||||
* 容器更新规则:启动脚本在启动过程中会把当前的版本号写到容器根目录的PACKAGE_VERSION文件中,下次启动会对比版本,如果不一样会执行更新流程。更新用的是deepin-wine-helper中的[updater](https://gitlab.deepin.io/wine/deepin-wine-tools/tree/master/updater)。
|
||||
|
||||
* 文件和注册表覆盖规则:更新就会存在文件覆盖的问题,默认的规则文件放在specified/temp/bottle/update.policy,如果打包应用如要修改可以在specified目录创建对应包名的目录,然后在这个目录下存放bottle/update.policy文件。修改bottle/update.policy这个文件就可以达到想要效果。如何配置可以参考specified/temp/bottle/update.policy文件。
|
||||
|
||||
* 启动脚本:目前有三个版本启动脚本,参看helper/opt/deepinwine/tools/目录下的,run.sh、run_v2和run_v3.sh,目的是兼容不同的版本。run.sh中启动的参数是独立的,每添加一个包都需要修改这个文件添加;run_v2.sh有通用的启动函数调用,如无特殊需要可以不修改,目前elephant分支用的就是这个;run_v3.sh添加UOS版本支持,v20-uos分支用的这个。
|
||||
|
||||
* 退出wine容器:helper/opt/deepinwine/tools/kill.sh,参数加容器中运行的进程名,可以自动查找对应进程所在的容器,退出容器所有的进程。如果参数是services则是退出当前系统运行的所有wine容器。
|
||||
|
||||
* 收集日志: helper/opt/deepinwine/tools/log.sh,第一个参数指定容器,兼容v20-uos和elephant两个分支,v20-uos版本传入包名,elephant版本传入public_bottle_name指定的名字;第二个参数指定日志通道,就是指定WINEDEBUG的环境变量;第三个参数可以指定运行的windows程序的第一个参数。
|
||||
|
||||
* 文件选择对话框: deepin-wine提供了支持Windows程序使用系统原生对话框的机制,需要依赖[deepin-wine-plugin](https://gitlab.deepin.io/wine/deepin-wine-tools/tree/master/deepin-wine-plugin)。如果需要用系统原生对话框,可以参考微信修改启动脚本(helper/opt/deepinwine/tools/run.sh),添加ATTACH_FILE_DIALOG的环境变量
|
||||
|
||||
* 64位依赖:因为我们目前打的容器包都是32位的,某些情况下需要添加64位的依赖(或者是根据当前系统的版本安装,64位系统安装64位的依赖,32位系统安装32位的依赖),目前的做法是添加了一个deepin-wine-plugin-virtual的虚包,将这种情况的依赖写到虚包的depends里面。
|
||||
|
||||
* package-deb.sh: 打包目录中DEBIAN目录配置号之后可用此脚本一键打包,如./package-deb.sh helper/
|
||||
|
||||
* 使用仓库版本deepin-wine:
|
||||
|
||||
使用deepin-wine6-stable:
|
||||
```
|
||||
export package_depends="deepin-wine6-stable:amd64 (>= 6.0.0.12-1), deepin-wine-helper (>= 5.1.25-1)"
|
||||
export apprun_cmd="deepin-wine6-stable"
|
||||
```
|
||||
|
||||
使用deepin-wine5-stable
|
||||
```
|
||||
export package_depends="deepin-wine5-stable:amd64 (>= 5.0.29-1), deepin-wine-helper (>= 5.1.25-1)"
|
||||
export apprun_cmd="deepin-wine5-stable"
|
||||
```
|
||||
|
||||
根据需求定制之后,就可以执行之前配置的脚本进行打包了,比如./package-WeChat.sh
|
||||
|
53
package-script/elephant_debian_ex/postinst
Executable file
53
package-script/elephant_debian_ex/postinst
Executable file
@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
PACK_NAME="@deb_package_name@"
|
||||
BOTTLE_NAME="@public_bottle_name@"
|
||||
ACTIVEX_NAME="@activex_name@"
|
||||
MAKE_AUTOSTART="@make_autostart@"
|
||||
SEND_TO_DESKTOP="@send_to_desktop@"
|
||||
|
||||
make_autostart()
|
||||
{
|
||||
for file in $(ls /home)
|
||||
do
|
||||
if [ -d "/home/$file/.config/autostart" ]
|
||||
then
|
||||
cp /usr/share/applications/${PACK_NAME}.desktop /home/$file/.config/autostart/
|
||||
sed -i "s#%u#\"autostart\"#" /home/$file/.config/autostart/${PACK_NAME}.desktop
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
send_to_desktop()
|
||||
{
|
||||
for file in $(ls /home)
|
||||
do
|
||||
if [ -d "/home/$file/.config/autostart" ]
|
||||
then
|
||||
desktop=$(cat /etc/xdg/user-dirs.defaults | grep DESKTOP | awk -F= '{print $2}')
|
||||
if [ -d "/home/$file/$desktop" ]; then
|
||||
cp /usr/share/applications/${PACK_NAME}*.desktop /home/$file/$desktop
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ -n "$MAKE_AUTOSTART" ]; then
|
||||
make_autostart
|
||||
fi
|
||||
|
||||
if [ -n "$SEND_TO_DESKTOP" ]; then
|
||||
send_to_desktop
|
||||
fi
|
||||
|
||||
if [ -n "$ACTIVEX_NAME" ]; then
|
||||
if [ ! -d "/usr/lib/mozilla/plugins" ];then
|
||||
mkdir -p /usr/lib/mozilla/plugins
|
||||
fi
|
||||
cp /usr/local/share/pipelight/libpipelight.so /usr/lib/mozilla/plugins/libpipelight-${ACTIVEX_NAME}.so
|
||||
fi
|
||||
|
||||
# Make sure the script returns 0
|
||||
true
|
||||
|
||||
#DEBHELPER#
|
49
package-script/elephant_debian_ex/postrm
Executable file
49
package-script/elephant_debian_ex/postrm
Executable file
@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
|
||||
PACK_NAME="@deb_package_name@"
|
||||
BOTTLE_NAME="@public_bottle_name@"
|
||||
ACTIVEX_NAME="@activex_name@"
|
||||
MAKE_AUTOSTART="@make_autostart@"
|
||||
SEND_TO_DESKTOP="@send_to_desktop@"
|
||||
|
||||
make_autostart()
|
||||
{
|
||||
for file in $(ls /home)
|
||||
do
|
||||
if [ -d "/home/$file/.config/autostart" ]
|
||||
then
|
||||
rm /home/$file/.config/autostart/${PACK_NAME}.desktop
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
send_to_desktop()
|
||||
{
|
||||
for file in $(ls /home)
|
||||
do
|
||||
if [ -d "/home/$file/.config/autostart" ]
|
||||
then
|
||||
desktop=$(cat /etc/xdg/user-dirs.defaults | grep DESKTOP | awk -F= '{print $2}')
|
||||
if [ -d "/home/$file/$desktop" ]; then
|
||||
rm /home/$file/$desktop/${PACK_NAME}*.desktop
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ -n "$MAKE_AUTOSTART" ]; then
|
||||
make_autostart
|
||||
fi
|
||||
|
||||
if [ -n "$SEND_TO_DESKTOP" ]; then
|
||||
send_to_desktop
|
||||
fi
|
||||
|
||||
if [ -n "$ACTIVEX_NAME" ]; then
|
||||
rm /usr/lib/mozilla/plugins/libpipelight-${ACTIVEX_NAME}.so
|
||||
fi
|
||||
|
||||
# Make sure the script returns 0
|
||||
true
|
||||
|
||||
#DEBHELPER#
|
6
package-script/elephant_debian_ex/preinst
Executable file
6
package-script/elephant_debian_ex/preinst
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Make sure the script returns 0
|
||||
true
|
||||
|
||||
#DEBHELPER#
|
12
package-script/elephant_debian_ex/prerm
Executable file
12
package-script/elephant_debian_ex/prerm
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
PACK_NAME="@deb_package_name@"
|
||||
BOTTLE_NAME="@public_bottle_name@"
|
||||
ACTIVEX_NAME="@activex_name@"
|
||||
MAKE_AUTOSTART="@make_autostart@"
|
||||
SEND_TO_DESKTOP="@send_to_desktop@"
|
||||
|
||||
# Make sure the script returns 0
|
||||
true
|
||||
|
||||
#DEBHELPER#
|
BIN
package-script/icotool
Executable file
BIN
package-script/icotool
Executable file
Binary file not shown.
93
package-script/mkicons.sh
Executable file
93
package-script/mkicons.sh
Executable file
@ -0,0 +1,93 @@
|
||||
#!/bin/bash
|
||||
|
||||
tmp="mktemp"
|
||||
Bottle_dir="$HOME/.deepinwine"
|
||||
icon_dir="icons/hicolor"
|
||||
|
||||
#public_bottle_name="Deepin-WeChat"
|
||||
#deb_package_name="deepin.com.wechat"
|
||||
#exec_path="c:\\Program Files\\Tencent\\WeChat\\WeChat.exe"
|
||||
|
||||
make_png()
|
||||
{
|
||||
icon_size=$(ls $icon_dir)
|
||||
icon_res=$(./icotool -l $tmp)
|
||||
|
||||
echo "make png"
|
||||
echo "icon src list:"
|
||||
echo "$icon_res"
|
||||
|
||||
for size in $icon_size;do
|
||||
echo ""
|
||||
size_reg="width=$(echo $size | awk -Fx '{print $1}')"
|
||||
echo "make icon for: $size_reg"
|
||||
size_reg=$(./icotool -l $tmp | grep "$size_reg")
|
||||
|
||||
if [ -n "$size_reg" ];then
|
||||
icon_path="$icon_dir/$size/apps/${deb_package_name}.png"
|
||||
./icotool -x $size_reg $tmp -o "$icon_path"
|
||||
ls -l "$icon_path"
|
||||
else
|
||||
echo "not fond size: $size"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
make_svg()
|
||||
{
|
||||
echo "make svg"
|
||||
|
||||
icon_res=$(./icotool -l $tmp)
|
||||
|
||||
echo "icon src list:"
|
||||
echo "$icon_res"
|
||||
|
||||
for size in 256 128 64 48 32 16;do
|
||||
size_reg="width=$size"
|
||||
echo "make icon for: $size_reg"
|
||||
size_reg=$(./icotool -l $tmp | grep "$size_reg" | tail -1)
|
||||
echo "cmd: $size_reg"
|
||||
|
||||
if [ -n "$size_reg" ];then
|
||||
rm tmp.png
|
||||
./icotool -x $size_reg $tmp -o tmp.png
|
||||
if [ -f tmp.png ]; then
|
||||
inkscape -z --without-gui -f tmp.png -l "$icon_dir/48x48/apps/${deb_package_name}.svg"
|
||||
file "$icon_dir/48x48/apps/${deb_package_name}.svg"
|
||||
return
|
||||
fi
|
||||
else
|
||||
echo "not fond size: $size"
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
make_icon()
|
||||
{
|
||||
PE_file=$(echo "$exec_path" | sed -e 's/\\/\//g')
|
||||
PE_file="$Bottle_dir/$public_bottle_name/$(echo "${PE_file/c:/drive_c}")"
|
||||
echo "Get icon form: $PE_file"
|
||||
|
||||
if ./wrestool "$PE_file" -x -t14 > $tmp && [ -s $tmp ]; then
|
||||
if command -v inkscape > /dev/null 2>&1; then
|
||||
make_svg
|
||||
else
|
||||
make_png
|
||||
fi
|
||||
else
|
||||
echo "wrestool failed"
|
||||
fi
|
||||
rm $tmp
|
||||
}
|
||||
|
||||
if [ -z "$exec_path" ] || [ -z "$deb_package_name" ] || [ -z "$public_bottle_name" ];then
|
||||
echo "mkicon args is invaild"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -f "$icon_dir/48x48/apps/${deb_package_name}.svg" ];then
|
||||
echo "don't need make icons"
|
||||
exit 0
|
||||
fi
|
||||
make_icon
|
28
package-script/package-hshw.sh
Executable file
28
package-script/package-hshw.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
#最终生成的包的描述
|
||||
export app_description="风云语音文字转换器"
|
||||
#应用程序英文名
|
||||
export app_name="FengYunVT"
|
||||
#应用程序中文名
|
||||
export app_name_zh_cn="风云语音文字转换器"
|
||||
#desktop文件中的分类
|
||||
export desktop_file_categories="Audio;"
|
||||
#desktop文件中StartupWMClass字段。用于让桌面组件将窗口类名与desktop文件相对应。这个值为实际运行的主程序EXE的文件名,wine/crossover在程序运行后会将文件名设置为窗口类名
|
||||
export desktop_file_main_exe="SpeechConvert.exe"
|
||||
export exec_path="c:\\Program Files\\fyaudioc\\SpeechConvert.exe"
|
||||
#最终生成的包的包名,包名的命名规则以deepin开头,加官网域名(需要前后对调位置),如还不能区分再加上应用名
|
||||
export deb_package_name="com.fengyunvt.www.deepin"
|
||||
#最终生成的包的版本号,版本号命名规则:应用版本号+deepin+数字
|
||||
export deb_version_string="1.0.60.3deepin1"
|
||||
|
||||
export package_depends="deepin-wine6-stable:amd64 (>= 6.0.0.12-1), deepin-wine-helper (>= 5.1.25-1)"
|
||||
export apprun_cmd="deepin-wine6-stable"
|
||||
#export package_depends="deepin-wine5-stable:amd64 (>= 5.0.29-1), deepin-wine-helper (>= 5.1.25-1)"
|
||||
#export apprun_cmd="deepin-wine5-stable"
|
||||
|
||||
# rm -fr final.dir/
|
||||
# rm -fr icons/
|
||||
# rm -fr staging.dir/
|
||||
|
||||
./script-packager.sh $@
|
335
package-script/script-packager.sh
Executable file
335
package-script/script-packager.sh
Executable file
@ -0,0 +1,335 @@
|
||||
#!/bin/bash
|
||||
#export elephant_deb_package_name=""
|
||||
run_sh_dir=""
|
||||
elephant_run_sh_dir=""
|
||||
start_shell="/opt/deepinwine/tools/run_v4.sh"
|
||||
if [[ -n "$SPECIFY_SHELL_PATH" ]] && [[ "$SPECIFY_SHELL_PATH" == "/opt/apps"* ]];then
|
||||
start_shell="$SPECIFY_SHELL_PATH"
|
||||
fi
|
||||
|
||||
wine_name="deepin-wine6-stable"
|
||||
if [ -n "$apprun_cmd" ];then
|
||||
wine_name=${apprun_cmd%%/bin*}
|
||||
wine_name=${wine_name##*/}
|
||||
fi
|
||||
|
||||
export public_bottle_name="$deb_package_name"
|
||||
|
||||
CheckTool()
|
||||
{
|
||||
a=$(which $1)
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "missing $1, need to install package \"$2\""
|
||||
exit
|
||||
fi
|
||||
}
|
||||
CheckParamE()
|
||||
{
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "$2"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
CheckPathExists()
|
||||
{
|
||||
if [ ! -d "$1" ]
|
||||
then
|
||||
echo "$2"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
RepalceVal()
|
||||
{
|
||||
VALUE="$3"
|
||||
VALUE=$(echo ${VALUE//\\/\/})
|
||||
find "$1" -type f -exec sed -i "s#$2#$VALUE#" {} \;
|
||||
}
|
||||
TranslateTemplateFile()
|
||||
{
|
||||
RepalceVal "$1" "@app_description@" "$app_description"
|
||||
RepalceVal "$1" "@app_name@" "$app_name"
|
||||
RepalceVal "$1" "@app_name_zh_cn@" "$app_name_zh_cn"
|
||||
RepalceVal "$1" "@deb_date@" "$deb_date"
|
||||
#RepalceVal "$1" "@deb_package_name@" "$deb_package_name"
|
||||
RepalceVal "$1" "@deb_packager@" "$deb_packager"
|
||||
RepalceVal "$1" "@deb_version_string@" "$deb_version_string"
|
||||
RepalceVal "$1" "@desktop_file_categories@" "$desktop_file_categories"
|
||||
#RepalceVal "$1" "@desktop_file_icon@" "$deb_package_name"
|
||||
RepalceVal "$1" "@desktop_file_main_exe@" "$desktop_file_main_exe"
|
||||
RepalceVal "$1" "@public_bottle_name@" "$public_bottle_name"
|
||||
RepalceVal "$1" "@old_package@" "$old_package_name"
|
||||
RepalceVal "$1" "@package_depends@" "$package_depends"
|
||||
RepalceVal "$1" "@mime_type@" "$mime_type"
|
||||
RepalceVal "$1" "@activex_name@" "$activex_name"
|
||||
RepalceVal "$1" "@make_autostart@" "$make_autostart"
|
||||
RepalceVal "$1" "@send_to_desktop@" "$send_to_desktop"
|
||||
RepalceVal "$1" "@exec_path@" "$EXEC_PATH"
|
||||
}
|
||||
|
||||
TranslateTemplateFileUos()
|
||||
{
|
||||
TranslateTemplateFile "$1"
|
||||
RepalceVal "$1" "@deb_package_name@" "$deb_package_name"
|
||||
RepalceVal "$1" "@desktop_file_icon@" "$deb_package_name"
|
||||
RepalceVal "$1" "@run_sh_dir@" "$run_sh_dir"
|
||||
RepalceVal "$1" "@start_shell_path@" "$start_shell"
|
||||
RepalceVal "$1" "@apprun_cmd@" "$wine_name"
|
||||
RepalceVal "$1" "@patch_loader@" "$patch_loader"
|
||||
RepalceVal "$1" "@version_info@" "$version_info"
|
||||
RepalceVal "$1" "@patch_version@" "$hack_patch_version"
|
||||
}
|
||||
|
||||
Check_icons()
|
||||
{
|
||||
if [[ -n $(find icons/ -name ${1}.svg) ]];then
|
||||
echo "${1}.svg"
|
||||
elif [[ -n $(find icons/ -name ${1}.png) ]];then
|
||||
echo "${1}.png"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
set_version_info()
|
||||
{
|
||||
if [ $# -ne 3 ];then
|
||||
echo "invalid parameter"
|
||||
return 2
|
||||
fi
|
||||
|
||||
file=$1
|
||||
key=$2
|
||||
new_value=$3
|
||||
cat $file | while read line; do
|
||||
name=`echo $line|awk -F '=' '{print $1}'`
|
||||
if [ "$name" = "$key" ];then
|
||||
line_num=`cat -n $file |grep $key|awk '{print $1}'`
|
||||
old_value=`echo $line|awk -F '=' '{print $2}'`
|
||||
sed -i ''$line_num's/'$old_value'/'$new_value'/g' $file
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
checkInstallVersion()
|
||||
{
|
||||
ver=$(dpkg -l $1 | grep ii | awk '{print $3}')
|
||||
if [ -z "$ver" ];then
|
||||
echo "$1 未安装"
|
||||
exit 0
|
||||
elif [ "$ver" != "$2" ];then
|
||||
echo "$1 版本不是$2"
|
||||
exit 1
|
||||
else
|
||||
echo $ver
|
||||
fi
|
||||
}
|
||||
|
||||
checkWineDepends()
|
||||
{
|
||||
WINE5LIBVER="5.0.28-1"
|
||||
WINE6LIBVER="6.0.0.11-1"
|
||||
WINEHELPERVER="5.1.25-1"
|
||||
|
||||
if [ "$wine_name" == "deepin-wine5-stable" ];then
|
||||
checkInstallVersion ${wine_name}-i386 $WINE5LIBVER
|
||||
checkInstallVersion $wine_name $WINE5LIBVER
|
||||
echo "$WINE5LIBVER" > "$outfiles/wine_archive.md5sum"
|
||||
else
|
||||
checkInstallVersion ${wine_name}-i386 $WINE6LIBVER
|
||||
checkInstallVersion $wine_name $WINE6LIBVER
|
||||
echo "$WINE6LIBVER" > "$outfiles/wine_archive.md5sum"
|
||||
fi
|
||||
checkInstallVersion deepin-wine-helper $WINEHELPERVER
|
||||
checkInstallVersion deepin-wine-plugin $WINEHELPERVER
|
||||
|
||||
cp /usr/lib/i386-linux-gnu/deepin-wine/gtkGetFileNameDlg "$outfiles"
|
||||
|
||||
7z a -t7z -mx=9 -ms=on -mmt=on -m0=BCJ2 -m1=LZMA2:d=64m:fb=273 "$outfiles/wine_archive.7z" /usr/lib/i386-linux-gnu/deepin-wine5-stable/*
|
||||
echo "$WINELIBVER" > "$outfiles/wine_archive.md5sum"
|
||||
|
||||
7z a -t7z -mx=9 -ms=on -mmt=on -m0=BCJ2 -m1=LZMA2:d=64m:fb=273 "$outfiles/helper_archive.7z" /opt/deepinwine/tools/*
|
||||
echo "$WINEHELPERVER" > "$outfiles/helper_archive.md5sum"
|
||||
}
|
||||
|
||||
CheckTool "fakeroot" "fakeroot"
|
||||
|
||||
CheckParamE "$app_description" "App description not given"
|
||||
CheckParamE "$app_name" "App name not given"
|
||||
CheckParamE "$app_name_zh_cn" "App zh-cn name not given"
|
||||
#CheckParamE "$desktop_file_categories" "Categories of desktop file not given"
|
||||
#CheckParamE "$desktop_file_icon" "Icon file of desktop file not given"
|
||||
CheckParamE "$desktop_file_main_exe" "Main exe filename not given
|
||||
===>Wine set this value to WMClass of app window, Dock/Launcher need this for matching"
|
||||
CheckParamE "$deb_package_name" "Package name not given"
|
||||
CheckParamE "$deb_version_string" "Package version not given"
|
||||
|
||||
CheckParamE "$package_depends" "Package depends not given"
|
||||
|
||||
if [[ "$package_depends" == *"libc6"* ]];then
|
||||
echo "wine依赖直接改为deepin-wine5-stable或者deepin-wine6-stable"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ "$package_depends" != *"$wine_name"* ]];then
|
||||
echo "wine 依赖和执行的wine命令不匹配"
|
||||
exit
|
||||
fi
|
||||
|
||||
BottlePath="$HOME/.deepinwine/$public_bottle_name"
|
||||
|
||||
./mkicons.sh
|
||||
desktop_file_icon=$(Check_icons $deb_package_name)
|
||||
#Replace USER value to string
|
||||
EXEC_PATH=$(echo "$exec_path" | sed -e "s/$USER/\$USER/g")
|
||||
|
||||
if [ -n "$desktop_file_categories" ] && [ -z "$desktop_file_icon" ]; then
|
||||
echo "not found icon file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$deb_packager" ];then deb_packager="Deepin WINE Team";fi
|
||||
if [ -z "$deb_packager_email" ];then deb_packager_email="penghao@linuxdeepin.com";fi
|
||||
if [ -z "$deb_date" ];then deb_date=`date -R`;fi
|
||||
|
||||
echo "+++++ Empire Starts here. +++++"
|
||||
echo "app description: $app_description"
|
||||
echo "app name: $app_name"
|
||||
echo "app name zh-cn: $app_name_zh_cn"
|
||||
echo "date: $deb_date"
|
||||
echo "deb package name: $deb_package_name"
|
||||
echo "deb packager: $deb_packager"
|
||||
echo "packager email: $deb_packager_email"
|
||||
echo "version: $deb_version_string"
|
||||
echo "app categories: $desktop_file_categories"
|
||||
echo "desktop icon: $desktop_file_icon"
|
||||
echo "app main executable: $desktop_file_main_exe"
|
||||
echo "origin bottle name: $origin_bottle_name"
|
||||
echo "public bottle name: $public_bottle_name"
|
||||
echo "old package name: $old_package_name"
|
||||
echo "package depends: $package_depends"
|
||||
echo "mime type: $mime_type"
|
||||
echo "activex name: $activex_name"
|
||||
echo "bottle path: $BottlePath"
|
||||
echo "make autostart: $make_autostart"
|
||||
echo "send to desktop: $send_to_desktop"
|
||||
echo "exec file path: $EXEC_PATH"
|
||||
echo "run shell path: $start_shell"
|
||||
echo "run wine cmd: $wine_name"
|
||||
|
||||
curdir=`pwd`
|
||||
stgdir="$curdir/staging.dir"
|
||||
dstdir="$curdir/final.dir"
|
||||
outdir="$dstdir/opt/apps/$deb_package_name"
|
||||
outentries="$outdir/entries"
|
||||
outfiles="$outdir/files"
|
||||
run_sh_dir="/opt/apps/$deb_package_name/files"
|
||||
uos_package_save="$curdir/package_save/uos"
|
||||
|
||||
export DEB_HOST_ARCH=i386
|
||||
PKG_FILE="${deb_package_name}_${deb_version_string}_i386.deb"
|
||||
|
||||
CheckPathExists "$curdir/debian" "debian package building scripts lost."
|
||||
CheckPathExists "$curdir/template" "package template scripts lost."
|
||||
echo "=====>Preparing packaging environment..."
|
||||
if [ -d "$stgdir" ]; then rm -rf "$stgdir"; fi
|
||||
mkdir -p "$stgdir"
|
||||
if [ -d "$dstdir" ]; then rm -rf "$dstdir"; fi
|
||||
mkdir -p "$dstdir"
|
||||
mkdir -p "$outentries"
|
||||
mkdir -p "$outfiles"
|
||||
if [ ! -d "$uos_package_save" ]; then mkdir -p "$uos_package_save"; fi
|
||||
|
||||
echo "<=====done."
|
||||
|
||||
if [ -n "$1" ] && [ -f "/opt/apps/$deb_package_name/files/files.7z" ]; then
|
||||
echo "Use last bottle file"
|
||||
cp /opt/apps/$deb_package_name/files/files.7z "$outfiles/"
|
||||
else
|
||||
CheckPathExists "$BottlePath" "Original bottle $BottlePath do NOT exist."
|
||||
|
||||
echo "=====>Clean bottle..."
|
||||
./cleanbottle.sh $BottlePath
|
||||
echo "<=====done."
|
||||
|
||||
echo "=====>Creating program files archive..."
|
||||
cp -r $BottlePath/* "$stgdir"
|
||||
# Dir links in profile should been recreated when deploy.
|
||||
find "$stgdir/drive_c/users/$USER" -type l -exec rm "{}" \;
|
||||
# Remove packager personal information. We will expand user name when deploy.
|
||||
sed -i "s#$USER#@current_user@#" $stgdir/*.reg
|
||||
mv "$stgdir/drive_c/users/$USER" "$stgdir/drive_c/users/@current_user@"
|
||||
# Merge additional files for this package.
|
||||
if [ -d "$curdir/specified/$deb_package_name/bottle" ]; then
|
||||
cp -ruv $curdir/specified/$deb_package_name/bottle/* $stgdir
|
||||
else
|
||||
cp -ruv $curdir/specified/temp/bottle/* $stgdir
|
||||
fi
|
||||
|
||||
if [ -f "$curdir/specified/$deb_package_name/root/opt/apps/$deb_package_name/files/extensions.so" ]; then
|
||||
if [ ! -f "$stgdir/winx" ]; then
|
||||
mkdir -p "$stgdir/winx"
|
||||
fi
|
||||
ln -s /opt/apps/$deb_package_name/files/extensions.so "$stgdir/winx/extensions.so"
|
||||
ls -l "$stgdir/winx/extensions.so"
|
||||
fi
|
||||
|
||||
7z a -t7z -mx=9 -ms=on -mmt=on -m0=BCJ2 -m1=LZMA2:d=64m:fb=273 "$outfiles/files.7z" "$stgdir/*"
|
||||
fi
|
||||
|
||||
md5sum "$outfiles/files.7z" | awk '{print $1}' > "$outfiles/files.md5sum"
|
||||
|
||||
echo "<=====done."
|
||||
echo "=====>Creating additional files..."
|
||||
cd "$outdir"
|
||||
if [ -d "$dstdir/debian" ]; then
|
||||
rm -rf "$dstdir/debian"
|
||||
fi
|
||||
cp -r "$curdir/debian/" "$dstdir"
|
||||
TranslateTemplateFileUos "$dstdir/debian/"
|
||||
if [ -d "$curdir/specified/$deb_package_name/root/" ]; then
|
||||
echo "copy root files.."
|
||||
cp -ruv $curdir/specified/$deb_package_name/root/* "$dstdir"
|
||||
if [ -d "$dstdir/usr/" ]; then
|
||||
echo "$dstdir/usr/* /usr" &>> "$dstdir/debian/install"
|
||||
fi
|
||||
fi
|
||||
cp "$curdir/template/run.sh" "$outfiles"
|
||||
TranslateTemplateFileUos "$outfiles/run.sh"
|
||||
cp "$curdir/template/info" "$outdir"
|
||||
TranslateTemplateFileUos "$outdir/info"
|
||||
|
||||
#if no desktop_file_categories, don't create desktop
|
||||
if [ -n "$desktop_file_categories" ]; then
|
||||
mkdir -p "$outentries/applications"
|
||||
cp "$curdir/template/target.desktop" "$outentries/applications/$deb_package_name.desktop"
|
||||
TranslateTemplateFileUos "$outentries/applications/$deb_package_name.desktop"
|
||||
|
||||
# TODO: We should generate icons from main program automatically.
|
||||
cd "$curdir/icons"
|
||||
find -iname "$desktop_file_icon" -exec dirname "{}" \; | xargs -I "{}" mkdir -p "$outentries/icons/{}"
|
||||
find -iname "$desktop_file_icon" -exec cp "{}" "$outentries/icons/{}" \;
|
||||
|
||||
fi
|
||||
|
||||
cd "$dstdir"
|
||||
echo "$outdir/* /opt/apps/$deb_package_name" &>> "debian/install"
|
||||
echo "<=====done."
|
||||
|
||||
echo "=====>Creating deb package..."
|
||||
fakeroot "debian/build" "$dstdir"
|
||||
echo "<=====done."
|
||||
|
||||
echo "=====> Removing temporary files..."
|
||||
mv "$dstdir/$PKG_FILE" "$uos_package_save"
|
||||
|
||||
#rm -rf "$stgdir"
|
||||
#rm -rf "$dstdir"
|
||||
echo "<=====done."
|
||||
echo -e "\n\nDeb file generated: $PKG_FILE\n"
|
||||
echo "+++++ all done. +++++"
|
||||
|
||||
exit 0
|
33
package-script/specified/temp/bottle/update.policy
Executable file
33
package-script/specified/temp/bottle/update.policy
Executable file
@ -0,0 +1,33 @@
|
||||
[File]
|
||||
;;=============================================================
|
||||
;; Registry - Mask this file is a registry file.
|
||||
;; Keep - Default. Use template file.
|
||||
;; Override - Use file in current prefix.
|
||||
;; Replace - If it's different type in current prefix and
|
||||
;; in template, use template one to replace it.
|
||||
;; Ingore - Ingore file when copy.
|
||||
|
||||
;; Ingore update.policy itself.
|
||||
"^update.policy$" = "Ingore"
|
||||
"^.update-timestamp$" = "Ingore"
|
||||
|
||||
;; System registry files.
|
||||
"^(system|userdef|user).reg$" = "Registry"
|
||||
|
||||
;; Addtional assist files.
|
||||
"^drive_c/Deepin" = "Keep"
|
||||
|
||||
;; Microsoft Office files.
|
||||
"^drive_c/Windows/(?:control\.ini|hh\.dat|mapiuid\.ini|Reg Save Log\.txt)$" = "Override"
|
||||
|
||||
|
||||
|
||||
[Registry]
|
||||
;;=============================================================
|
||||
;; Keep - Use template key section
|
||||
;; Override - Use user current key section
|
||||
;; Merge - Default. Merge two section, user current values
|
||||
override template
|
||||
|
||||
"^Software\\Wine\\DllOverrides$" = "Keep"
|
||||
"^Software\\Wine\\Fonts\\Replacements$" = "Keep"
|
17
package-script/template/info
Executable file
17
package-script/template/info
Executable file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"appid": "@deb_package_name@",
|
||||
"name": "@app_name@",
|
||||
"version": "@deb_version_string@",
|
||||
"arch": ["i386"],
|
||||
"permissions": {
|
||||
"autostart": false,
|
||||
"notification": false,
|
||||
"trayicon": true,
|
||||
"clipboard": true,
|
||||
"account": false,
|
||||
"bluetooth": false,
|
||||
"camera": true,
|
||||
"audio_record": true,
|
||||
"installed_apps": false
|
||||
}
|
||||
}
|
21
package-script/template/run.sh
Executable file
21
package-script/template/run.sh
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2016 Deepin, Inc.
|
||||
#
|
||||
# Author: Li LongYu <lilongyu@linuxdeepin.com>
|
||||
# Peng Hao <penghao@linuxdeepin.com>
|
||||
|
||||
BOTTLENAME="@public_bottle_name@"
|
||||
APPVER="@deb_version_string@"
|
||||
EXEC_PATH="@exec_path@"
|
||||
START_SHELL_PATH="@start_shell_path@"
|
||||
export MIME_TYPE="@mime_type@"
|
||||
export DEB_PACKAGE_NAME="@deb_package_name@"
|
||||
export APPRUN_CMD="@apprun_cmd@"
|
||||
export PATCH_LOADER_ENV="@patch_loader@"
|
||||
|
||||
if [ -n "$EXEC_PATH" ];then
|
||||
$START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@"
|
||||
else
|
||||
$START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@"
|
||||
fi
|
14
package-script/template/target.desktop
Executable file
14
package-script/template/target.desktop
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env xdg-open
|
||||
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Application
|
||||
X-Created-By=@deb_packager@
|
||||
Categories=@desktop_file_categories@
|
||||
Icon=@desktop_file_icon@
|
||||
Exec="@run_sh_dir@/run.sh" -u %u
|
||||
Name=@app_name@
|
||||
Name[zh_CN]=@app_name_zh_cn@
|
||||
Comment=@app_description@
|
||||
StartupWMClass=@desktop_file_main_exe@
|
||||
MimeType=@mime_type@
|
11
package-script/template/version_info
Executable file
11
package-script/template/version_info
Executable file
@ -0,0 +1,11 @@
|
||||
[version]
|
||||
APP_VERSION="@app_version@"
|
||||
WINE_VERSION="@wine_version@"
|
||||
PATCH_VERSION="@patch_version@"
|
||||
[version]
|
||||
|
||||
[update]
|
||||
CHECK_UPDATE="@check_update@"
|
||||
FORCE_FULL_UPGRADE="@force_full_upgrade@"
|
||||
MIN_VER_SUPPORT="@min_version_support@"
|
||||
[update]
|
1160
package-script/wps.log
Executable file
1160
package-script/wps.log
Executable file
File diff suppressed because one or more lines are too long
BIN
package-script/wrestool
Executable file
BIN
package-script/wrestool
Executable file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user