diff --git a/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_gl-wine/gdid3d.reg b/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_gl-wine/gdid3d.reg new file mode 100644 index 0000000..d5cf5c2 Binary files /dev/null and b/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_gl-wine/gdid3d.reg differ diff --git a/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_gl-wine/gl-wine32 b/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_gl-wine/gl-wine32 new file mode 100755 index 0000000..06bc64d Binary files /dev/null and b/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_gl-wine/gl-wine32 differ diff --git a/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_gl-wine/gl-wine64 b/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_gl-wine/gl-wine64 new file mode 100755 index 0000000..222f829 Binary files /dev/null and b/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_gl-wine/gl-wine64 differ diff --git a/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_gl-wine/run_gl.sh b/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_gl-wine/run_gl.sh new file mode 100755 index 0000000..68118a9 --- /dev/null +++ b/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_gl-wine/run_gl.sh @@ -0,0 +1,17 @@ +#/bin/bash + +cd $(dirname $0) + +runtime_path=/opt/deepinwine/runtime-i386 +if [ -f "$runtime_path/init_runtime.sh" ];then + source "$runtime_path/init_runtime.sh" + + init_runtime + init_32bit_config + echo "use deepinwine runtime" + "$WINELDPATH" ./gl-wine32 + exit $? +fi + +./gl-wine32 +exit $? diff --git a/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_run_v4.sh b/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_run_v4.sh index b10852e..abffb6d 100755 --- a/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_run_v4.sh +++ b/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_run_v4.sh @@ -21,10 +21,13 @@ APPVER="" APPTAR="files.7z" BOTTLENAME="" WINE_CMD="deepin-wine" -#这里会被后续覆盖,似乎没啥用 +#这里会被后续覆盖 LOG_FILE=$0 PUBLIC_DIR="/var/public" + + + if [ -e /opt/p7zip-legacy/bin/7z ];then log.debug "Using p7zip-legacy as unpacker" UNPACK_CMD=/opt/p7zip-legacy/bin/7z @@ -54,20 +57,13 @@ if [ $SPECIFY_SHELL_DIR ]; then SHELL_DIR=$SPECIFY_SHELL_DIR fi -# Check if some visual feedback is possible -if command -v zenity >/dev/null 2>&1; then + progressbar() { WINDOWID="" zenity --progress --title="$1" --text="$2" --pulsate --width=400 --auto-close --no-cancel || WINDOWID="" zenity --progress --title="$1" --text="$2" --pulsate --width=400 --auto-close } -else - progressbar() - { - cat - - } -fi _DeleteRegistry() { @@ -132,8 +128,14 @@ FixLink() { if [ -d ${WINEPREFIX} ]; then CUR_DIR=$PWD - cd "${WINEPREFIX}/dosdevices" - # Link to Document + cd "${WINEPREFIX}/dosdevices" + check_link ../drive_c c: + check_link / z: + check_link $HOME y: + cd "../drive_c/users/$USER" + check_link "$HOME/Desktop" Desktop + check_link "$HOME/Downloads" Downloads + # Link to Document if [ -L "$WINEPREFIX/drive_c/users/$(whoami)/My Documents" ]; then env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg add 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders' /t REG_EXPAND_SZ /v Personal /d "%USERPROFILE%\My Documents" /f @@ -141,10 +143,6 @@ else env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg add 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders' /t REG_EXPAND_SZ /v Personal /d "%USERPROFILE%\Documents" /f fi - rm c: z: y: - ln -s -f ../drive_c c: - ln -s -f / z: - ln -s -f $HOME y: cd $CUR_DIR #ls -l "${WINEPREFIX}/dosdevices" fi @@ -176,6 +174,29 @@ is_autostart() return 1 } #########自动启动相关,等用到了再研究 + +Test_GL_wine() +{ + gl_wine_path="/opt/deepinwine/tools/spark_gl-wine" + + #如果不支持32的GLX,d3d改为gdi的实现 + if [[ ! -f "${WINEPREFIX}/.init_d3d" ]];then + if [[ $WINE_CMD == *"deepin-wine8-stable"* ]];then + gl_wine="${gl_wine_path}/gl-wine64" + else + gl_wine="${gl_wine_path}/run_gl.sh" + fi + + run_gl=`${gl_wine} 2>&1` + + #如果opengl测试程序运行失败,所有进程的渲染方式改为gdi渲染模式 + if [ $? != 0 ];then + WINEPREFIX="$WINEPREFIX" $WINE_CMD regedit /S "${gl_wine_path}/gdid3d.reg" + fi + + touch "${WINEPREFIX}/.init_d3d" + fi +} urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; } #######url转义 @@ -194,7 +215,11 @@ CallProcess() if [[ $autostart -ne 0 ]] && [[ "$1" != *"pluginloader.exe" ]];then $SHELL_DIR/spark_kill.sh "$BOTTLENAME" block fi - + #run gl-wine for test opengl + get_arch=`uname -m` + if [[ $get_arch = "x86_64" ]];then + Test_GL_wine + fi #change current dir to excute path path=$(dirname "$path") cd "$path" @@ -211,7 +236,7 @@ CallProcess() - debug_log_to_file "Starting process $* ..." + debug_log "Starting process $* ..." ############# WARNING: Here is the modified content: Now will run set-dwine-scale.sh /opt/durapps/spark-dwine-helper/scale-set-helper/set-wine-scale.sh "$WINEPREFIX" @@ -311,12 +336,13 @@ ResetApp() } UpdateApp() { - if [ -f "$WINEPREFIX/PACKAGE_VERSION" ] && [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" = "$APPVER" ]; then - return - fi if [ -d "${WINEPREFIX}.tmpdir" ]; then rm -rf "${WINEPREFIX}.tmpdir" fi + if [ -f "$WINEPREFIX/PACKAGE_VERSION" ] && [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" = "$APPVER" ]; then + return + fi + if [ -f "/opt/apps/${DEB_PACKAGE_NAME}/files/pre_update.sh" ];then source "/opt/apps/${DEB_PACKAGE_NAME}/files/pre_update.sh" CallPreUpdate @@ -348,7 +374,9 @@ RunApp() exit 0 fi if [ -d "$WINEPREFIX" ]; then - UpdateApp + if [ ! -f "$WINEPREFIX/PACKAGE_VERSION" ] || [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" != "$APPVER" ]; then + UpdateApp + fi else DeployApp fi @@ -359,7 +387,9 @@ RunApp() CreateBottle() { if [ -d "$WINEPREFIX" ]; then - UpdateApp + if [ ! -f "$WINEPREFIX/PACKAGE_VERSION" ] || [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" != "$APPVER" ]; then + UpdateApp + fi else DeployApp fi @@ -380,7 +410,7 @@ ParseArgs() fi } -init_log_file +#init_log_file @@ -392,9 +422,6 @@ if [ $# -lt 3 ]; then exit 0 fi -BOTTLENAME="$1" -WINEPREFIX="$HOME/.deepinwine/$1" - APPDIR="/opt/apps/${DEB_PACKAGE_NAME}/files" if [ -f "$APPDIR/files.md5sum" ];then @@ -405,6 +432,10 @@ fi debug_log "Run $*" +if [ -z "$WINE_WMCLASS" ]; then + export WINE_WMCLASS="$DEB_PACKAGE_NAME" +fi + #执行lnk文件通过判断第5个参数是否是“/Unix”来判断 if [ "$4" == "/Unix" ];then RunApp "$3" "$4" "$5"