[Industry News] 4 月 15 日,统信桌面操作系统 V25 将正式登场
Tofloor
poster avatar
说书人
deepin
2026-04-13 20:27
Author

640.jpeg

Reply Favorite View the author
All Replies
2 / 2
To page
135******00
deepin
2026-04-15 11:05
#21

不知道稳定性怎么样

Reply View the author
comicfans
deepin
2026-04-15 13:19
#22
mozixun

WPS弱在哪?

没有365?

要不是大佬你在玲珑搞了WPS deepin25(arm)都没有新版WPS用 金山主要服务信创系统和amd64 之前w365在deepin25(arm)下是无法登陆的 不知道25.1怎么样 WPS的更新全靠大佬们用爱发电 这里的相对弱是指没有官方支持 功能上基本上差别不大

Reply View the author
UOS小白
deepin
2026-04-15 16:17
#23
comicfans

UOS25就是完美形态的deepin25 deepin试过了 除了wps相对弱以外 多数软件比UOS上要好 主要是win引擎和UOSAI 要好用不少

应该是完美形态的deepin V23,估计到不了25的境界😏

Reply View the author
hkent
deepin
2026-04-15 16:22
#24
yippeeghost

https://pan.baidu.com/s/1y0t1InQZLGWH_ZXpg6A9Qg?pwd=easy

试试这个,记得关闭磐石。

怎么关闭磐石 ,为啥要关闭他啊。

Reply View the author
comicfans
deepin
2026-04-15 18:20
#25
UOS小白

应该是完美形态的deepin V23,估计到不了25的境界😏

看到有版主说UOS25是deepin25了 但应该是重新购买授权 不过今天下午UOS AI总算更新到和deepin25一样的版本了 对UOS25的需求又降低一份

————————————-

看见了 UOS25支持飞腾D3000 不知道D2000行不行啊 需求被打灭了😂

Reply View the author
mozixun
Moderator
4 hours ago
#26
comicfans

要不是大佬你在玲珑搞了WPS deepin25(arm)都没有新版WPS用 金山主要服务信创系统和amd64 之前w365在deepin25(arm)下是无法登陆的 不知道25.1怎么样 WPS的更新全靠大佬们用爱发电 这里的相对弱是指没有官方支持 功能上基本上差别不大

难道你的系统对WPS安装包里postinst和postrm塞的*已经嗷嗷待哺了嘛

太多了塞不下,就先放一点

#!/bin/bash

if [ ! -z "$sys_libs_path" ]; then
	for item in $sys_libs_path ; do
		item_abs_path=$(readlink -f $item)
		item_arch=`hexdump $item_abs_path -n 2 -s 18 -e '1/2 "%u" '`
		item_bit=`hexdump  $item_abs_path -n 1 -s 4 -e '1/1 "%u"'`
		if [ "$wps_lib_arch" = "$item_arch" ] && [ "$wps_lib_bit" = "$item_bit" ]; then
			item_version=$(echo $item_abs_path | awk -F '.so.' '{print $NF}')
			rst=$(vercomp $item_version $wps_lib_version)
			if [ $rst -eq 3 ]; then
				ln -sf $item_abs_path $wps_lib_name
				break
			fi
		fi
	done
fi

}

function ks_check_lib_glibc_version()
{
wps_lib_path=$1 if [ ! -e $wps_lib_path ]; then
return
fi

sys_lib_path=$2
if [ ! -e $sys_lib_path ]; then
	return
fi

wps_glibc_version=$(readelf -V "$wps_lib_path" | grep -o "GLIBC_[0-9]\.[0-9]*" | sort -V | tail -1 | cut -d'_' -f2)
sys_glibc_version=$(readelf -V "$sys_lib_path" | grep -o "GLIBC_[0-9]\.[0-9]*" | sort -V | tail -1 | cut -d'_' -f2)

if [ -z "$wps_glibc_version" ] || [ -z "$sys_glibc_version" ]; then
	return
fi

if [ "$(echo -e "$sys_glibc_version\n$wps_glibc_version" | sort -V | tail -n1)" = "$sys_glibc_version" ]; then
	chmod -r $wps_lib_path
else
	: # 使用自带库
fi

}

function is_valid_group()
{
local group_name=$1 getent group "$group_name" >/dev/null 2>&1
return $?
}

function ks_transfer_auth_info()
{

AUTH_DATA_PATH='/opt/kingsoft/.auth'
if [ ! -d "$AUTH_DATA_PATH" ]; then
	if [ -d "/opt/.auth" ]; then
		cp /opt/.auth /opt/kingsoft -r
		rm -rf /opt/.auth
	fi
	mkdir -p "$AUTH_DATA_PATH/tmp"
	touch "${AUTH_DATA_PATH}/license2.dat"
	chmod -R 777 "$AUTH_DATA_PATH"
fi

find /home/*/.kingsoft/office6/data/license2.dat -exec bash -c 'cp "$0" /opt/kingsoft/.auth/tmp/$RANDOM.dat && rm -f "$0"' {} \; >/dev/null 2>&1 || true
find /home/*/.local/share/Kingsoft/office6/data/license2.dat -exec bash -c 'cp "$0" /opt/kingsoft/.auth/tmp/$RANDOM.dat && rm -f "$0"' {} \; >/dev/null 2>&1 || true
cp /root/.kingsoft/office6/data/license2.dat /opt/kingsoft/.auth/tmp/$RANDOM.dat >/dev/null 2>&1 || true
cp /root/.local/share/Kingsoft/office6/data/license2.dat /opt/kingsoft/.auth/tmp/$RANDOM.dat >/dev/null 2>&1 || true
[ -f /root/.kingsoft/office6/data/license2.dat ] && rm -f /root/.kingsoft/office6/data/license2.dat >/dev/null 2>&1 || true
[ -f /root/.local/share/Kingsoft/office6/data/license2.dat ] && rm -f /root/.local/share/Kingsoft/office6/data/license2.dat >/dev/null 2>&1 || true

chown -R root:root $AUTH_DATA_PATH
if is_valid_group "root"; then
	chgrp -R root $AUTH_DATA_PATH
fi
chmod -R 777 $AUTH_DATA_PATH

AUTH_CONF_PATH='/opt/kingsoft/.auth/Auth.conf'
AUTH_CONF_SEC_OLD_PATH='/opt/kingsoft/Auth.conf'
AUTH_CONF_OLD_PATH='/etc/wps-office/Auth.conf'
if [ -f "$AUTH_CONF_PATH" ]; then
	return
fi

mkdir -p "$(dirname "$AUTH_CONF_PATH")" && touch "$AUTH_CONF_PATH"
chmod 666  -R $AUTH_CONF_PATH

if [ -f "$AUTH_CONF_SEC_OLD_PATH" ]; then
	cp "$AUTH_CONF_SEC_OLD_PATH" "$AUTH_CONF_PATH" -a
	rm -f "$AUTH_CONF_SEC_OLD_PATH"
	return
fi

if [ -f "$AUTH_CONF_OLD_PATH" ]; then
	cp "$AUTH_CONF_OLD_PATH" "$AUTH_CONF_PATH" -a
	rm -rf "$(dirname "$AUTH_CONF_OLD_PATH")"
	return
fi

OFFICE_CONF_PATH="/root/.config/Kingsoft/Office.conf"
if [ -f $OFFICE_CONF_PATH ]; then
	WPS_T=$(kmin $WPS_T $(grep -oP '(?<=wps\\wps_t=)\d+' $OFFICE_CONF_PATH))
	WPP_T=$(kmin $WPP_T $(grep -oP '(?<=wpp\\wpp_t=)\d+' $OFFICE_CONF_PATH))
	ET_T=$(kmin $ET_T $(grep -oP '(?<=et\\et_t=)\d+' $OFFICE_CONF_PATH))
	WPS_L=$(kmax $WPS_L $(grep -oP '(?<=wps\\wps_l=)\d+' $OFFICE_CONF_PATH))
	WPP_L=$(kmax $WPP_L $(grep -oP '(?<=wpp\\wpp_l=)\d+' $OFFICE_CONF_PATH))
	ET_L=$(kmax $ET_L $(grep -oP '(?<=et\\et_l=)\d+' $OFFICE_CONF_PATH))
fi

for HOMEDIR in /home/*; do
	USERNAME="${HOMEDIR##*/}"
	[ ! -d "${HOMEDIR}" ] && continue
	getent passwd "${USERNAME}" >/dev/null 2>&1 || continue
	OFFICE_CONF_PATH="$HOMEDIR/.config/Kingsoft/Office.conf"
	if [ -f $OFFICE_CONF_PATH ]; then
		WPS_T=$(kmin $WPS_T $(grep -oP '(?<=wps\\wps_t=)\d+' $OFFICE_CONF_PATH))
		WPP_T=$(kmin $WPP_T $(grep -oP '(?<=wpp\\wpp_t=)\d+' $OFFICE_CONF_PATH))
		ET_T=$(kmin $ET_T $(grep -oP '(?<=et\\et_t=)\d+' $OFFICE_CONF_PATH))
		WPS_L=$(kmax $WPS_L $(grep -oP '(?<=wps\\wps_l=)\d+' $OFFICE_CONF_PATH))
		WPP_L=$(kmax $WPP_L $(grep -oP '(?<=wpp\\wpp_l=)\d+' $OFFICE_CONF_PATH))
		ET_L=$(kmax $ET_L $(grep -oP '(?<=et\\et_l=)\d+' $OFFICE_CONF_PATH))
	fi
done

if [ -n "${WPS_T}" ] || [ -n "${WPP_T}" ] || [ -n "${ET_T}" ] || [ -n "${WPS_L}" ] || [ -n "${WPP_L}" ] || [ -n "${ET_L}" ]; then
	AUTHCONTENT=$(cat <<-EOF
	[wps]
	wps_t=${WPS_T}
	wps_l=${WPS_L}

	[wpp]
	wpp_t=${WPP_T}
	wpp_l=${WPP_L}

	[et]
	et_t=${ET_T}
	et_l=${ET_L}
	EOF
	)
	echo "$AUTHCONTENT" > $AUTH_CONF_PATH
fi

}

function ks_install_icon()
{
local context=$1 shift
local mode=$1 shift

local png=
local mime=
local nextIsPng=0
for item in $@
do
	if [ "" = "${item}" ] ; then
		continue
	fi
	if [ ${nextIsPng} -eq 1 ] ; then
		png=${item}
		for i in 16 22 32 48 64 128 256; do
			if [ -e "${ksv_xdg_dir}/${ksv_def_icon_theme}/${i}x${i}/${context}/${png}" ] ; then
				xdg-icon-resource install --noupdate --mode ${mode} --context ${context} --size ${i} "${ksv_xdg_dir}/${ksv_def_icon_theme}/${i}x${i}/${context}/${png}" ${mime}
			fi
		done
		nextIsPng=0
	else
		mime=${item}
		nextIsPng=1
	fi
done

}

function ks_init()
{
set -e
for i in echo "${ksv_xdg_dirs}" | sed 's/:/ /g'
do
if [ -w ​{i}/{ksv_def_icon_theme} ] ; then
ksv_xdg_dir="${i}"
fi
done
}

function ks_install_desk()
{
if [ $isUos ]; then
deskFiles="find /usr/share/applications -name "wps*.desktop" 2>/dev/null" || true
if [[ -n "${deskFiles}" ]]; then
for deskFile in ${deskFiles};do
deskName="echo ${deskFile##*/}"
if [[ -n "${deskName}" ]]; then
if [ ! -e "​{ksv_xdg_data_dir}/applications/{deskName}" ]; then
ln -sf ​{deskFile} "{ksv_xdg_data_dir}/applications/${deskName}" 2>/dev/null || true
fi
fi
done
fi
fi
}

function ks_copy_icon()
{
if $isUos ;then
oempath="/opt/kingsoft/wps-office/office6/cfgs/oem.ini"
if [ -f ${oempath} ] ;then
if $isManualCopyIcon ;then
deskpath="/usr/share/applications/"
icon_parentpath="echo "${deskpath::-13}""
icon_parentpath_length=${#icon_parentpath}
iconpath="${icon_parentpath}icons"
if [ -d ${iconpath} ]; then
iconFiles="find ${iconpath} -name "wps*.png" 2>/dev/null" || true
if [[ -n "${iconFiles}" ]]; then
for iconFile in ${iconFiles};do
src_iconpath="echo "${iconFile:${icon_parentpath_length}}""
tar_iconPath="/usr/share/${src_iconpath}"
tar_iconoarentPath="${tar_iconPath%/*}"
real_iconpath="readlink -f ${tar_iconPath} 2>/dev/null || true"
if [ "​{real_iconpath}" != "{iconFile}" ]; then
if [ ! -e "${tar_iconoarentPath}" ]; then
mkdir -p ${tar_iconoarentPath} >/dev/null 2>&1 || true
fi
ln -sf ​{iconFile} {tar_iconPath} >/dev/null 2>&1 || true
fi
done
fi
fi
fi
fi
fi
}

function ks_config_del()
{
if [ -f "/opt/kingsoft/wps-office/INSTALL/delconfs" ]; then
while read -r item
do
[ -f "/root/.config/Kingsoft/Office.conf" ] && sed -i "/${item}/d" "/root/.config/Kingsoft/Office.conf"
find /home//.config/Kingsoft/Office.conf 2>/dev/null | xargs sed -i "/${item}/d" 2>/dev/null || true
done < "/opt/kingsoft/wps-office/INSTALL/delconfs"
else
[ -f "/root/.config/Kingsoft/Office.conf" ] && sed -i "/AcceptedEULA/d" "/root/.config/Kingsoft/Office.conf" 2>/dev/null || true
find /home/
/.config/Kingsoft/Office.conf 2>/dev/null | xargs sed -i "/AcceptedEULA/d" 2>/dev/null || true
fi
for HOMEDIR in /home/; do
USERNAME="${HOMEDIR##
/}"
[ ! -d "${HOMEDIR}" ] && continue
getent passwd "${USERNAME}" >/dev/null 2>&1 || continue
if [ -f "$HOMEDIR/.local/share/Kingsoft/office6\synccfg\default\head\workarea.cfg" ]; then
rm -f "$HOMEDIR/.local/share/Kingsoft/office6\synccfg\default\head\workarea.cfg"
fi
if [ -d "$HOMEDIR/.config/wpsofdreader" ]; then
rm -rf "$HOMEDIR/.config/wpsofdreader"
fi
if [ -d "$HOMEDIR/.config/suwellofdplugin" ]; then
rm -rf "$HOMEDIR/.config/suwellofdplugin"
fi
done
}

function ks_config_menu()
{
if [ -f /usr/share/mime/packages/custom-wps-office.xml ]; then
[ -f /usr/share/mime/packages/wps-office-et.xml ] && rm -f /usr/share/mime/packages/wps-office-et.xml
[ -f /usr/share/mime/packages/wps-office-wps.xml ] && rm -f /usr/share/mime/packages/wps-office-wps.xml
[ -f /usr/share/mime/packages/wps-office-wpp.xml ] && rm -f /usr/share/mime/packages/wps-office-wpp.xml
[ -f /usr/share/mime/packages/wps-office-pdf.xml ] && rm -f /usr/share/mime/packages/wps-office-pdf.xml
fi
#如果存在这个文件(安装时勾选了不默认使用doc等文件),则在卸载前先把相应的xml和desktop文件处理一下,不生成mime,不进行关联。卸载后为防止失败,还需要在把相应的xml文件加回来。
noUse=0
fileName="/tmp/cancleFileAssociation"
touch /usr/share/applications/mimeapps.list || true
if [ -f "$fileName" ]; then
rm -f "$fileName"
noUse=1
[ -f /usr/share/mime/packages/custom-wps-office.xml ] && rm -f /usr/share/mime/packages/custom-wps-office.xml
sed -i '/^MimeType/d' /usr/share/applications/wps-office-wps.desktop
sed -i '/^MimeType/d' /usr/share/applications/wps-office-wpp.desktop
sed -i '/^MimeType/d' /usr/share/applications/wps-office-et.desktop
fi
if [ -e "/etc/xdg/mimeapps.list" ]; then
sed -i '/^application/wps-office.pdf/d' "/etc/xdg/mimeapps.list"
sed -i '/^application/pdf/d' "/etc/xdg/mimeapps.list"
fi
if [ -f '/usr/share/mime/packages/custom-wps-office.xml' ]; then
ln -sf /usr/share/mime/packages/custom-wps-office.xml /usr/share/mime/packages/business-office.xml
fi
if [ -f "/usr/share/applications/wps-office-et.desktop" ] && [ $noUse -eq 0 ]; then
ks_install_icon "mimetypes" "system" "​{ksv_et_mimes[*]}" "{ksv_excel_mimes[*]}"
write_mimeapp_config "${common_excel_mimes[*]}" "wps-office-et.desktop" "/usr/share/applications/mimeapps.list"
write_mimeapp_config "${wps_excel_mimes[*]}" "wps-office-et.desktop" "/usr/share/applications/mimeapps.list"
fi

if [ -f "/usr/share/applications/wps-office-wpp.desktop" ] && [ $noUse -eq 0 ]; then
	ks_install_icon "mimetypes" "system" "${ksv_wpp_mimes[*]}" "${ksv_ppt_mimes[*]}"
	write_mimeapp_config "${common_ppt_mimes[*]}" "wps-office-wpp.desktop" "/usr/share/applications/mimeapps.list"
	write_mimeapp_config "${wps_ppt_mimes[*]}" "wps-office-wpp.desktop" "/usr/share/applications/mimeapps.list"
fi

if [ -f "/usr/share/applications/wps-office-wps.desktop" ] && [ $noUse -eq 0 ]; then
	ks_install_icon "mimetypes" "system" "${ksv_wps_mimes[*]}" "${ksv_word_mimes[*]}"
	xdg-icon-resource forceupdate --mode system

	write_mimeapp_config "${common_word_mimes[*]}" "wps-office-wps.desktop" "/usr/share/applications/mimeapps.list"
	write_mimeapp_config "${wps_word_mimes[*]}" "wps-office-wps.desktop" "/usr/share/applications/mimeapps.list"
fi

if [ -f "/usr/share/applications/wps-office-pdf.desktop" ] && [ $noUse -eq 0 ] && [ $domesticVersion -eq 1 ]; then
	ks_install_icon "mimetypes" "system" "${ksv_pdf_mimes[*]}"
	xdg-icon-resource forceupdate --mode system
fi
if [ -f "/usr/share/applications/wps-office-ofd.desktop" ] && [ $noUse -eq 0 ]; then
	ks_install_icon "mimetypes" "system" "${ksv_ofd_mimes[*]}"
	xdg-icon-resource forceupdate --mode system
	write_mimeapp_config "${common_ofd_mimes[*]}" "wps-office-ofd.desktop" "/usr/share/applications/mimeapps.list"
fi
if [ -f "/usr/share/applications/wps-office-flow.desktop" ] && [ $noUse -eq 0 ]; then
	ks_install_icon "mimetypes" "system" "${ksv_flow_mimes[*]}"
	xdg-icon-resource forceupdate --mode system
	write_mimeapp_config "${common_flow_mimes[*]}" "wps-office-flow.desktop" "/usr/share/applications/mimeapps.list"
fi
if [ -f "/usr/share/applications/wps-office-mind.desktop" ] && [ $noUse -eq 0 ]; then
	ks_install_icon "mimetypes" "system" "${ksv_mind_mimes[*]}"
	xdg-icon-resource forceupdate --mode system
	write_mimeapp_config "${common_mind_mimes[*]}" "wps-office-mind.desktop" "/usr/share/applications/mimeapps.list"
fi
update-mime-database ${ksv_xdg_dir}/mime &> /dev/null || :
update-desktop-database &> /dev/null || true

}

root用户注销时杀死WPS的后台进程

其他用户注销可通过autostart中desktop中quickstartoffice restart实现

function ks_config_wpsdaemon()
{
[ ! -f /usr/bin/quickstartoffice ] && return
quickstartoffice stop

declare -A property
sessionid=
user=
for session in $(loginctl --no-legend list-sessions | awk '{ print $1 }' ); do
	while IFS="=" read key value ; do
		property[$key]="$value"
	done < <(loginctl show-session $session)

	if [ "${property[Type]}" = "x11" ] || [ "${property[Type]}" = "wayland" ]; then
		sessionid=$session
		user=${property[Name]}
		if [ "${property[Active]}" = "yes" ];then
			break;
		fi
	fi
done
[ -z "$user" -o -z "$sessionid" ] && return
id -u $user >/dev/null 2>&1 || return 0
pids=($(ps e -u "$user" 2>/dev/null | sed -rn "/^.*XDG_SESSION_ID=$sessionid.*/p" | sed -rn "/^.*DISPLAY.*/p" | sed -rn "/^.*XMODIFIERS.*/p" | sed -rn "/^.*(SESSION_MANAGER|DESKTOP_SESSION_ID).*/p" | sed -rn "s/^\s*([0-9]+).*/\1/p"))

for i in ${pids[*]}; do 
	if [ -f "/proc/$i/environ" ]; then
		environ=$(cat /proc/$i/environ 2>/dev/null | tr '\0' '\n')
		if echo $environ | grep "DESKTOP_AUTOSTART_ID" >/dev/null 2>&1; then
			unset environ
			continue
		fi
		break;
	fi
done
[ -z "$environ" ] && return
(
	set +e
	for e in $environ; do 
		export $e >/dev/null 2>&1
	done
	unset LD_LIBRARY_PATH
	[ -n "$DISPLAY" ] && su $user -c "quickstartoffice start" >/dev/null 2>&1 || true
)

}

function copy_install_to_desktop()
{
if [ $# -ne 3 ] ; then
return;
fi
local curFileName=$1 local wpsDesktopName=$2 local curUserName=$3 if [ -e "/usr/share/applications/${wpsDesktopName}" ]; then
cp -f /usr/share/applications/​{wpsDesktopName} "{curFileName}/​{gDesktopName}/{wpsDesktopName}"
if test $? -eq 0; then
chmod +x "​{curFileName}/{gDesktopName}/${wpsDesktopName}"
chown ​{curUserName} "{curFileName}/​{gDesktopName}/{wpsDesktopName}"
fi
fi

}

function readforcefushionoem()
{
oempath="/opt/kingsoft/wps-office/office6/cfgs/oem.ini"
if [ -e $oempath ]; then
if $isForceFushion ; then
echo 0
else
echo 1
fi
else
echo 1
fi
}

function get_desktop_type()
{
desktopType=0
currentMode=""
currentLine=0
haveConf=0
if [ $# -ne 1 ] ; then
return;
fi
local curFileName=$1 if [ -e "${curFileName}/.config/Kingsoft/Office.conf" ];then
haveConf=1
fi
if [ $haveConf -eq 1 ]; then
currentMode=​(awk -v line=(awk '/[6.0]/{print NR}' "​{curFileName}/.config/Kingsoft/Office.conf") -F"=" '$1=="wpsoffice\\Application%20Settings\\AppComponentModeInstall" {if(NR>=line){print $2}}' "{curFileName}/.config/Kingsoft/Office.conf")
currentLine=​(awk -v line=(awk '/[6.0]/{print NR}' "​{curFileName}/.config/Kingsoft/Office.conf") -F"=" '$1=="wpsoffice\\Application%20Settings\\AppComponentModeInstall" {if(NR>=line){print NR}}' "{curFileName}/.config/Kingsoft/Office.conf")
fi
if [ ​haveConf -eq 1 ] && [ "currentMode" = "prome_fushion" ]; then
desktopType=0
elif [ ​haveConf -eq 1 ] && [ "currentMode" = "prome_independ" ]; then
desktopType=1
else
if [ "$productName" = "Unified" ]; then
desktopType=0
elif [ $domesticVersion -eq 1 ]; then
desktopType=$(readforcefushionoem)
else
desktopType=0
fi
fi
}

function deploy_wps_desktop_icon()
{
if [ $# -ne 2 ] ; then
return;
fi
local curFileName=$1 local curUserName=$2 if [ -d "${curFileName}/.config" ] ; then
touch "${curFileName}/.config/mimeapps.list"
chmod 666 "${curFileName}/.config/mimeapps.list"
chown ​{curUserName} "{curFileName}/.config/mimeapps.list"
fi
if [ ​haveConf -eq 1 ] && [ desktopType -eq 0 ]; then
#有本地配置且是整合模式
if [ "${currentMode}" = "prome_fushion" ]; then
#有本地配置,配置中写的是整合模式
sed -i "​{currentLine}a\wpsoffice\\\Application%20Settings\\\AppComponentMode={currentMode}" "${curFileName}/.config/Kingsoft/Office.conf"
else
#有本地配置,但是配置中没有写整合,社区版第一次装,默认用整合,需要将整合配置写进去
startLine=​(awk '/\[6.0\]/{print NR}' "{curFileName}/.config/Kingsoft/Office.conf")
sed -i "​{startLine}a\wpsoffice\\\Application%20Settings\\\AppComponentModeInstall=prome_fushion" "{curFileName}/.config/Kingsoft/Office.conf"
sed -i "​{startLine}a\wpsoffice\\\Application%20Settings\\\AppComponentMode=prome_fushion" "{curFileName}/.config/Kingsoft/Office.conf"
fi
if [ -d "${curFileName}/.config" ] ; then
write_mimeapp_config "​{common_excel_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
write_mimeapp_config "​{wps_excel_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
write_mimeapp_config "​{common_ppt_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
write_mimeapp_config "​{wps_ppt_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
write_mimeapp_config "​{common_word_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
write_mimeapp_config "​{wps_word_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
fi
if [ -e "/usr/share/applications/wps-office-ofd.desktop" ]; then
write_mimeapp_config "​{common_ofd_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
fi
if [ -e "/usr/share/applications/wps-office-flow.desktop" ]; then
write_mimeapp_config "​{common_flow_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
fi
if [ -e "/usr/share/applications/wps-office-mind.desktop" ]; then
write_mimeapp_config "​{common_mind_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
fi
copy_install_to_desktop ​{curFileName} "wps-office-prometheus.desktop" {curUserName}
else
if [ $desktopType -eq 0 ]; then
#无配置是整合(创建配置文件,写进去整合配置)
if [ -d "${curFileName}/.config" ] ; then
write_mimeapp_config "​{common_excel_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
write_mimeapp_config "​{wps_excel_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
write_mimeapp_config "​{common_ppt_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
write_mimeapp_config "​{wps_ppt_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
write_mimeapp_config "​{common_word_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
write_mimeapp_config "​{wps_word_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
fi
if [ -e "/usr/share/applications/wps-office-ofd.desktop" ]; then
write_mimeapp_config "​{common_ofd_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
fi
if [ -e "/usr/share/applications/wps-office-flow.desktop" ]; then
write_mimeapp_config "​{common_flow_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
fi
if [ -e "/usr/share/applications/wps-office-mind.desktop" ]; then
write_mimeapp_config "​{common_mind_mimes[*]}" "wps-office-prometheus.desktop" "{curFileName}/.config/mimeapps.list"
fi
copy_install_to_desktop ​{curFileName} "wps-office-prometheus.desktop" {curUserName}
if [ ! -e "${curFileName}/.config/Kingsoft" ]; then
if [ ! -d "${curFileName}/.config" ]; then
mkdir -p "${curFileName}/.config"
chown ​{curUserName} "{curFileName}/.config"
if is_valid_group "${curUserName}"; then
chgrp ​{curUserName} "{curFileName}/.config"
fi
fi
mkdir -p "${curFileName}/.config/Kingsoft"
chown -R ​{curUserName} "{curFileName}/.config/Kingsoft"
if is_valid_group "${curUserName}"; then
chgrp -R ​{curUserName} "{curFileName}/.config/Kingsoft"
fi
chmod 775 "${curFileName}/.config/Kingsoft"
fi
touch "${curFileName}/.config/Kingsoft/Office.conf"
chmod 664 "${curFileName}/.config/Kingsoft/Office.conf"
chown ​{curUserName} "{curFileName}/.config/Kingsoft/Office.conf"
if is_valid_group "${curUserName}"; then
chgrp ​{curUserName} "{curFileName}/.config/Kingsoft/Office.conf"
fi
echo '[6.0]' > "${curFileName}/.config/Kingsoft/Office.conf"
sed -i "1a\wpsoffice\\Application%20Settings\\AppComponentModeInstall=prome_fushion" "${curFileName}/.config/Kingsoft/Office.conf"
sed -i "1a\wpsoffice\\Application%20Settings\\AppComponentMode=prome_fushion" "${curFileName}/.config/Kingsoft/Office.conf"
else
#有无配置是多组建
copy_install_to_desktop ​{curFileName} "wps-office-et.desktop" {curUserName}
copy_install_to_desktop ​{curFileName} "wps-office-wpp.desktop" {curUserName}
copy_install_to_desktop ​{curFileName} "wps-office-wps.desktop" {curUserName}
copy_install_to_desktop ​{curFileName} "wps-office-pdf.desktop" {curUserName}
copy_install_to_desktop ​{curFileName} "wps-office-ofd.desktop" {curUserName}
if [ -e "/usr/share/applications/wps-office-flow.desktop" ]; then
copy_install_to_desktop ​{curFileName} "wps-office-flow.desktop" {curUserName}
fi
if [ -e "/usr/share/applications/wps-office-mind.desktop" ]; then
copy_install_to_desktop ​{curFileName} "wps-office-mind.desktop" {curUserName}
fi
if [ -e "/usr/share/applications/wps-office-official.desktop" ]; then
copy_install_to_desktop ​{curFileName} "wps-office-official.desktop" {curUserName}
fi
if [ $haveConf -eq 1 ]; then
#有本地配置并且是多组件
startLine=​(awk '/\[6.0\]/{print NR}' "{curFileName}/.config/Kingsoft/Office.conf")
sed -i "​{startLine}a\wpsoffice\\\Application%20Settings\\\AppComponentModeInstall=prome_independ" "{curFileName}/.config/Kingsoft/Office.conf"
sed -i "​{startLine}a\wpsoffice\\\Application%20Settings\\\AppComponentMode=prome_independ" "{curFileName}/.config/Kingsoft/Office.conf"
fi
fi
fi

if [ -e "/usr/share/applications/wps-office-wpsclouddisk.desktop" ]; then
	copy_install_to_desktop ${curFileName} "wps-office-wpsclouddisk.desktop" ${curUserName}
fi

}

function to_deploy_wps_desktop_icon()
{
if [ $# -ne 2 ] ; then
return;
fi
local curFileName=${1}
local curUserName=${2}
get_desktop_type ${curFileName}
deploy_wps_desktop_icon ​{curFileName} {curUserName}
}

function ks_config_desktop_templates()
{
gTemplatesName="模板"
if [ -d "/root/模板" ]; then
gTemplatesName="模板"
elif [ -d "/root/Templates" ]; then
gTemplatesName="Templates"
fi

if [ ! -d "/root/${gTemplatesName}" ]; then
	gTemplatesName="模板"
	mkdir -p "/root/${gTemplatesName}" >/dev/null 2>&1 || true
fi

gDesktopName="桌面"
if [ -d "/root/桌面" ]; then
	gDesktopName="桌面"
elif [ -d "/root/Desktop" ]; then
	gDesktopName="Desktop"
fi

if [ -d "/opt/kingsoft/wps-office/templates/" ]; then
	if [ -d "/root/${gTemplatesName}" ]; then
		for tempFile in `ls /root/${gTemplatesName} | tr " " "\?"`
		do
			if [ "${tempFile##*.}" = "et" ]||[ "${tempFile##*.}" = "wps" ]||[ "${tempFile##*.}" = "dps" ]; then
				[ -f "/root/${gTemplatesName}/${tempFile}" ] && rm -f "/root/${gTemplatesName}/${tempFile}"
			fi
			if [ "${tempFile:0:3}" = "DOC" ]||[ "${tempFile:0:3}" = "XLS" ]||[ "${tempFile:0:3}" = "PPT" ]; then
				[ -f "/root/${gTemplatesName}/${tempFile}" ] && rm -f "/root/${gTemplatesName}/${tempFile}"
			fi
		done
		cp -f "/opt/kingsoft/wps-office/templates/"* "/root/${gTemplatesName}"
	fi

	if [ ! -d "/etc/skel/${gTemplatesName}" ]; then
		mkdir /etc/skel/${gTemplatesName}
		chmod 755 /etc/skel/${gTemplatesName}
		if is_valid_group "root"; then
			chgrp root /etc/skel/${gTemplatesName}
		fi
	fi
	cp -f "/opt/kingsoft/wps-office/templates/"* "/etc/skel/${gTemplatesName}"

fi

[ -f "/root/${gDesktopName}/wps-office-wps.desktop" ] && rm -f "/root/${gDesktopName}/wps-office-wps.desktop"
[ -f "/root/${gDesktopName}/wps-office-et.desktop" ] && rm -f "/root/${gDesktopName}/wps-office-et.desktop"
[ -f "/root/${gDesktopName}/wps-office-wpp.desktop" ] && rm -f "/root/${gDesktopName}/wps-office-wpp.desktop"
[ -f "/root/${gDesktopName}/wps-office-pdf.desktop" ] && rm -f "/root/${gDesktopName}/wps-office-pdf.desktop"
[ -f "/root/${gDesktopName}/wps-office-ofd.desktop" ] && rm -f "/root/${gDesktopName}/wps-office-ofd.desktop"
[ -f "/root/${gDesktopName}/wps-office-flow.desktop" ] && rm -f "/root/${gDesktopName}/wps-office-flow.desktop"
[ -f "/root/${gDesktopName}/wps-office-mind.desktop" ] && rm -f "/root/${gDesktopName}/wps-office-mind.desktop"
[ -f "/root/${gDesktopName}/wps-office-official.desktop" ] && rm -f "/root/${gDesktopName}/wps-office-official.desktop"
[ -f "/root/${gDesktopName}/wps-office-prometheus.desktop" ] && rm -f "/root/${gDesktopName}/wps-office-prometheus.desktop"
[ -f "/root/${gDesktopName}/wps-office-officeassistant.desktop" ] && rm -f "/root/${gDesktopName}/wps-office-officeassistant.desktop"
[ -f "/root/${gDesktopName}/wps-office-uninstall.desktop" ] && rm -f "/root/${gDesktopName}/wps-office-uninstall.desktop"
if [ -d "/root/${gDesktopName}" ] && $hasDesktopMenu; then
	to_deploy_wps_desktop_icon "/root" "root"
fi

if [ -f "/root/.kingsoft/office6/templates/wps/zh_CN/Normal.dotm" ]; then
	rm -f "/root/.kingsoft/office6/templates/wps/zh_CN/Normal.dotm"
fi

for FILENAME in /home/*; do
	USERNAME="${FILENAME##*/}"
	[ ! -d "${FILENAME}" ] && continue
	getent passwd "${USERNAME}" >/dev/null 2>&1 || continue

	if id -u `echo ${FILENAME} | awk '{print substr($FILENAME, 7, 32)}'` >/dev/null 2>&1; then
		:
	else
		continue
	fi

	if [ -f "${FILENAME}/.kingsoft/office6/templates/wps/zh_CN/Normal.dotm" ]; then
		rm -f "${FILENAME}/.kingsoft/office6/templates/wps/zh_CN/Normal.dotm"
	fi

	if [ -f "${FILENAME}/.config/user-dirs.dirs" ] && \
		grep "XDG_DESKTOP_DIR" "${FILENAME}/.config/user-dirs.dirs" >/dev/null 2>&1  && \
		grep "XDG_TEMPLATES_DIR" "${FILENAME}/.config/user-dirs.dirs" >/dev/null 2>&1 ; then
		if [ ! $HOME ]; then 
			HOME=${FILENAME} 
		fi
		export $(sed 's|$HOME|'"${FILENAME}"'|g' ${FILENAME}/.config/user-dirs.dirs | grep XDG_DESKTOP_DIR | grep -v '^#')
		XDG_DESKTOP_DIR=${XDG_DESKTOP_DIR#\"*}
		XDG_DESKTOP_DIR=${XDG_DESKTOP_DIR%*\"}
		export $(sed 's|$HOME|'"${FILENAME}"'|g' ${FILENAME}/.config/user-dirs.dirs | grep XDG_TEMPLATES_DIR | grep -v '^#')
		XDG_TEMPLATES_DIR=${XDG_TEMPLATES_DIR#\"*}
		XDG_TEMPLATES_DIR=${XDG_TEMPLATES_DIR%*\"}
		if [ ! -d "${XDG_DESKTOP_DIR}" ]; then
			mkdir -p "${XDG_DESKTOP_DIR}" >/dev/null 2>&1 || true
			chown ${USERNAME} "${XDG_DESKTOP_DIR}" >/dev/null 2>&1 || true
			if is_valid_group "${USERNAME}"; then
				chgrp ${USERNAME} "${XDG_DESKTOP_DIR}" >/dev/null 2>&1 || true
			fi
		fi
		gDesktopName="${XDG_DESKTOP_DIR//${FILENAME}\//}"
		if [ ! -d "${XDG_TEMPLATES_DIR}" ]; then
			mkdir -p "${XDG_TEMPLATES_DIR}" >/dev/null 2>&1 || true
			chown ${USERNAME} "${XDG_TEMPLATES_DIR}" >/dev/null 2>&1 || true
			if is_valid_group "${USERNAME}"; then
				chgrp ${USERNAME} "${XDG_TEMPLATES_DIR}" >/dev/null 2>&1 || true
			fi
		fi
		gTemplatesName="${XDG_TEMPLATES_DIR//${FILENAME}\//}"
	else 
		if [ -d "${FILENAME}/桌面" ]; then
			gDesktopName="桌面"
		elif [ -d "${FILENAME}/Desktop" ]; then
			gDesktopName="Desktop"
		fi

		if [ -d "${FILENAME}/模板" ]; then
			gTemplatesName="模板"
		elif [ -d "${FILENAME}/Templates" ]; then
			gTemplatesName="Templates"
		fi

		if [ ! -d "${FILENAME}/${gTemplatesName}" ]; then
			gTemplatesName="模板"
			mkdir -p "${FILENAME}/${gTemplatesName}" >/dev/null 2>&1 || true
			chown ${USERNAME} "${FILENAME}/${gTemplatesName}" >/dev/null 2>&1 || true
			if is_valid_group "${USERNAME}"; then
				chgrp ${USERNAME} "${FILENAME}/${gTemplatesName}" >/dev/null 2>&1 || true
			fi
		fi
	fi 

	if [ -d "${FILENAME}/${gDesktopName}" ]; then
		if [ -e "/etc/xdg/menus/applications-merged/wps-office.menu" ]; then
			if [ -e "${FILENAME}/.config/menus/applications-merged" ]; then
				cp -f /etc/xdg/menus/applications-merged/wps-office.menu "${FILENAME}/.config/menus/applications-merged"
			fi
		fi

		local curUserName=`echo ${FILENAME} | awk '{print substr($FILENAME, 7, 32)}'`
		[ -f "/home/${curUserName}/${gDesktopName}/wps-office-wps.desktop" ] && rm -f "/home/${curUserName}/${gDesktopName}/wps-office-wps.desktop"
		[ -f "/home/${curUserName}/${gDesktopName}/wps-office-et.desktop" ] && rm -f "/home/${curUserName}/${gDesktopName}/wps-office-et.desktop"
		[ -f "/home/${curUserName}/${gDesktopName}/wps-office-wpp.desktop" ] && rm -f "/home/${curUserName}/${gDesktopName}/wps-office-wpp.desktop"
		[ -f "/home/${curUserName}/${gDesktopName}/wps-office-pdf.desktop" ] && rm -f "/home/${curUserName}/${gDesktopName}/wps-office-pdf.desktop"
		[ -f "/home/${curUserName}/${gDesktopName}/wps-office-ofd.desktop" ] && rm -f "/home/${curUserName}/${gDesktopName}/wps-office-ofd.desktop"
		[ -f "/home/${curUserName}/${gDesktopName}/wps-office-flow.desktop" ] && rm -f "/home/${curUserName}/${gDesktopName}/wps-office-flow.desktop"
		[ -f "/home/${curUserName}/${gDesktopName}/wps-office-mind.desktop" ] && rm -f "/home/${curUserName}/${gDesktopName}/wps-office-mind.desktop"
		[ -f "/home/${curUserName}/${gDesktopName}/wps-office-official.desktop" ] && rm -f "/home/${curUserName}/${gDesktopName}/wps-office-official.desktop"
		[ -f "/home/${curUserName}/${gDesktopName}/wps-office-prometheus.desktop" ] && rm -f "/home/${curUserName}/${gDesktopName}/wps-office-prometheus.desktop"
		[ -f "/home/${curUserName}/${gDesktopName}/wps-office-officeassistant.desktop" ] && rm -f "/home/${curUserName}/${gDesktopName}/wps-office-officeassistant.desktop"
		[ -f "/home/${curUserName}/${gDesktopName}/wps-office-uninstall.desktop" ] && rm -f "/home/${curUserName}/${gDesktopName}/wps-office-uninstall.desktop"
		if $hasDesktopMenu; then
			to_deploy_wps_desktop_icon ${FILENAME} ${curUserName}
		fi

	fi

	if [ -d "${FILENAME}/${gTemplatesName}" ]; then
		for tempFile in `ls ${FILENAME}/${gTemplatesName} | tr " " "\?"`
		do
			if [ "${tempFile##*.}" = "et" ]||[ "${tempFile##*.}" = "wps" ]||[ "${tempFile##*.}" = "dps" ]; then
				[ -f "${FILENAME}/${gTemplatesName}/${tempFile}" ] && rm -f "${FILENAME}/${gTemplatesName}/${tempFile}"
			fi
			if [ "${tempFile:0:3}" = "DOC" ]||[ "${tempFile:0:3}" = "XLS" ]||[ "${tempFile:0:3}" = "PPT" ]; then
				[ -f "${FILENAME}/${gTemplatesName}/${tempFile}" ] && rm -f "${FILENAME}/${gTemplatesName}/${tempFile}"
			fi
		done
		cp -f "/opt/kingsoft/wps-office/templates/"* "${FILENAME}/${gTemplatesName}"
	fi
done

ks_config_wpsdaemon

if [ -f "/opt/kingsoft/wps-office/office6/libbrowsergrapher.so" ] && [ -d "/usr/lib64/mozilla/plugins" ]; then
	ln -sf "/opt/kingsoft/wps-office/office6/libbrowsergrapher.so" "/usr/lib64/mozilla/plugins/libbrowsergrapher.so"
fi
if [ -f "/opt/kingsoft/wps-office/office6/libbrowsergrapher.so" ] && [ -d "/usr/lib/mozilla/plugins" ]; then
	ln -sf "/opt/kingsoft/wps-office/office6/libbrowsergrapher.so" "/usr/lib/mozilla/plugins/libbrowsergrapher.so"
fi
if [ -f "/opt/kingsoft/wps-office/office6/addons/ofdplugin/libnpWpsOFDReader.so" ] && [ -d "/usr/lib64/mozilla/plugins" ]; then
	ln -sf "/opt/kingsoft/wps-office/office6/addons/ofdplugin/libnpWpsOFDReader.so" "/usr/lib64/mozilla/plugins/libnpWpsOFDReader.so"
fi

if [ -f "/opt/kingsoft/wps-office/office6/libwps-print.so" ] && ! $isZYJ ; then
	if [ -d "/usr/lib/x86_64-linux-gnu/caja/extensions-2.0/" ] ; then
		cp -f "/opt/kingsoft/wps-office/office6/libwps-print.so" "/usr/lib/x86_64-linux-gnu/caja/extensions-2.0/libwps-print.so"
	fi
	if [ -d "/usr/lib64/caja/extensions-2.0" ] ; then
		cp -f "/opt/kingsoft/wps-office/office6/libwps-print.so" "/usr/lib64/caja/extensions-2.0/libwps-print.so"
	fi
	if [ -d "/usr/lib/aarch64-linux-gnu/caja/extensions-2.0" ] ; then
		cp -f "/opt/kingsoft/wps-office/office6/libwps-print.so" "/usr/lib/aarch64-linux-gnu/caja/extensions-2.0/libwps-print.so"
	fi
	if [ -d "/usr/lib/mips64el-linux-gnu/caja/extensions-2.0" ] ; then
		cp -f "/opt/kingsoft/wps-office/office6/libwps-print.so" "/usr/lib/mips64el-linux-gnu/caja/extensions-2.0/libwps-print.so"
	fi
fi
cp -f "/opt/kingsoft/wps-office/office6/libpeony-wpsprint-menu-plugin.so" /usr/lib/$(uname -m)*-linux-gnu*/peony-extensions/ >/dev/null 2>&1 || true

if [ -d "/usr/share/applications/context-menus" ] && [ -f "/opt/kingsoft/wps-office/desktops/wps-office-print.conf" ] ; then 
	cp -f  "/opt/kingsoft/wps-office/desktops/wps-office-print.conf" "/usr/share/applications/context-menus"
fi

#mbset
if [ -f "/opt/kingsoft/wps-office/office6/libwps-cajambset.so" ] && ! $isZYJ ; then
if [ -d "/usr/lib/x86_64-linux-gnu/caja/extensions-2.0/" ] ; then
cp -f "/opt/kingsoft/wps-office/office6/libwps-cajambset.so" "/usr/lib/x86_64-linux-gnu/caja/extensions-2.0/libwps-cajambset.so"
fi
if [ -d "/usr/lib64/caja/extensions-2.0" ] ; then
cp -f "/opt/kingsoft/wps-office/office6/libwps-cajambset.so" "/usr/lib64/caja/extensions-2.0/libwps-cajambset.so"
fi
if [ -d "/usr/lib/aarch64-linux-gnu/caja/extensions-2.0" ] ; then
cp -f "/opt/kingsoft/wps-office/office6/libwps-cajambset.so" "/usr/lib/aarch64-linux-gnu/caja/extensions-2.0/libwps-cajambset.so"
fi
if [ -d "/usr/lib/mips64el-linux-gnu/caja/extensions-2.0" ] ; then
cp -f "/opt/kingsoft/wps-office/office6/libwps-cajambset.so" "/usr/lib/mips64el-linux-gnu/caja/extensions-2.0/libwps-cajambset.so"
fi
fi

if [ -f "/opt/kingsoft/wps-office/office6/libwps-nautilusmbset.so" ] && ! $isZYJ ; then
if [ -d "/usr/lib/nautilus/extensions-3.0/" ] ; then
cp -f "/opt/kingsoft/wps-office/office6/libwps-nautilusmbset.so" "/usr/lib/nautilus/extensions-3.0/libwps-nautilusmbset.so"
fi
if [ -d "/usr/lib/aarch64-linux-gnu/nautilus/extensions-3.0/" ] ; then
cp -f "/opt/kingsoft/wps-office/office6/libwps-nautilusmbset.so" "/usr/lib/aarch64-linux-gnu/nautilus/extensions-3.0/libwps-nautilusmbset.so"
fi
if [ -d "/usr/lib/x86_64-linux-gnu/nautilus/extensions-3.0/" ] ; then
cp -f "/opt/kingsoft/wps-office/office6/libwps-nautilusmbset.so" "/usr/lib/x86_64-linux-gnu/nautilus/extensions-3.0/libwps-nautilusmbset.so"
fi
if [ -d "/usr/lib/arm-linux-gnueabihf/nautilus/extensions-3.0/" ] ; then
cp -f "/opt/kingsoft/wps-office/office6/libwps-nautilusmbset.so" "/usr/lib/arm-linux-gnueabihf/nautilus/extensions-3.0/libwps-nautilusmbset.so"
fi
if [ -d "/usr/lib/powerpc64le-linux-gnu/nautilus/extensions-3.0/" ] ; then
cp -f "/opt/kingsoft/wps-office/office6/libwps-nautilusmbset.so" "/usr/lib/powerpc64le-linux-gnu/nautilus/extensions-3.0/libwps-nautilusmbset.so"
fi
if [ -d "/usr/lib/s390x-linux-gnu/nautilus/extensions-3.0/" ] ; then
cp -f "/opt/kingsoft/wps-office/office6/libwps-nautilusmbset.so" "/usr/lib/s390x-linux-gnu/nautilus/extensions-3.0/libwps-nautilusmbset.so"
fi
fi
}

function ks_config_user_language
{
local curUserName=$1 local curFileName=$2 local curKingsoftDir="${curFileName}/.config/Kingsoft"
local curOfficeConf="${curKingsoftDir}/Office.conf"

if [ ! -e "${curFileName}/.config" ]; then
	return;
fi

if [ ! -e "${curKingsoftDir}" ]; then
	mkdir -p "${curKingsoftDir}"
	chown -R ${curUserName} "${curKingsoftDir}"
	if is_valid_group "${curUserName}"; then
		chgrp -R ${curUserName} "${curKingsoftDir}"
	fi
	chmod 775 "${curKingsoftDir}"
fi

if [ ! -e "${curOfficeConf}" ]; then
	touch "${curOfficeConf}"
	chmod 664 "${curOfficeConf}"
	chown ${curUserName} "${curOfficeConf}"
	if is_valid_group "${curUserName}"; then
		chgrp ${curUserName} "${curOfficeConf}"
	fi
fi
if [ -e "/opt/kingsoft/wps-office/office6/wps" ] && [ ! -e "/opt/kingsoft/wps-office/office6/libclang_rt.asan.so" ]; then
	/opt/kingsoft/wps-office/office6/wps -misc_linux -confirm_language  ${curOfficeConf} > /dev/null 2>&1 || true
	chown ${curUserName} "${curOfficeConf}"
	if is_valid_group "${curUserName}"; then
		chgrp ${curUserName} "${curOfficeConf}"
	fi
fi

}

function ks_config_language()
{
ks_config_user_language root /root

for FILENAME in /home/*; do
	USERNAME="${FILENAME##*/}"
	[ ! -d "${FILENAME}" ] && continue
	getent passwd "${USERNAME}" >/dev/null 2>&1 || continue

	if id -u `echo ${FILENAME} | awk '{print substr($FILENAME, 7, 32)}'` >/dev/null 2>&1; then
		:
	else
		continue
	fi

	local curUserName=`echo ${FILENAME} | awk '{print substr($FILENAME, 7, 32)}'`
	local curFileName=/home/${USERNAME}
	ks_config_user_language ${curUserName} ${curFileName}
done

}

if [ -d "/usr/share/applications/context-menus" ] && [ -f "/opt/kingsoft/wps-office/desktops/wps-office-mbset.conf" ] && [ -f "/opt/kingsoft/wps-office/desktops/../oem/mbconfig.cfg" ]; then
cp -f "/opt/kingsoft/wps-office/desktops/wps-office-mbset.conf" "/usr/share/applications/context-menus"
fi

function ks_config()
{
is_loong64=false
if uname -r | grep -q "loong64"; then
is_loong64=true
elif lscpu | grep -q "Architecture:[[:space:]]*loongarch64" && lscpu | grep -i "Model name" | grep -q "Loongson" && lscpu | grep -i "Model name" | grep -q "6000"; then
is_loong64=true
fi

if ! $is_loong64; then
	ks_check_library_version libstdc++.so.6
	ks_check_library_version libfreetype.so.6
fi

ks_check_lib_glibc_version /opt/kingsoft/wps-office/office6/addons/cef/libm.so.6 /usr/lib/$(uname -m)-linux-gnu/libm.so.6
ks_check_lib_glibc_version /opt/kingsoft/wps-office/office6/libm.so.6 /usr/lib/$(uname -m)-linux-gnu/libm.so.6

ks_install_desk
ks_copy_icon
ks_config_del
ks_config_menu
ks_config_desktop_templates
ks_config_language

# 教育版需要授权操作
if [ $domesticVersion -eq 1 ] || [ $isEducation = true ]; then
	ks_transfer_auth_info
fi

for holdFilePath in ${holdFilePaths[@]} 
do
	if [ -f "/tmp/wpstmp$holdFilePath" ] || [ -d "/tmp/wpstmp$holdFilePath" ] ; then 
		cp /tmp/wpstmp$holdFilePath $holdFilePath -arT
	fi
done

if [ -f "/opt/kingsoft/wps-office/office6/applyoldconfig.py" ]; then
	python3 /opt/kingsoft/wps-office/office6/applyoldconfig.py > /dev/null 2>&1 || true
fi

[ -d /tmp/wpstmp ] && rm -rf /tmp/wpstmp

if [ -f '/usr/bin/caja' ] && [ -f '/usr/bin/xdotool' ]; then
	{ xdotool search --class caja key F5; } 2>/dev/null || true # 向caja桌面系统发送F5 解决麒麟系统安装后不刷新的问题
fi 

nohup fc-cache >/dev/null 2>&1 || true &
ks_update_init
ks_allinone_init
ks_fuse_init

if [ -f /tmp/wpsupgrade.prerm ]; then 
	rm -f /tmp/wpsupgrade.prerm
fi

}

function ks_update_init()
{
updatePath="/opt/kingsoft/wps-office/office6/wtool"
if [ -d ${updatePath} ] ; then
chmod 755 ${updatePath}
cfgDir="${updatePath}/update"
downDir="${updatePath}/update/down"
if [[ ! -d "${downDir}" ]]; then
mkdir -m 777 -p "${downDir}"
fi
chmod 777 "${cfgDir}"
if [ -e "${updatePath}/update.cfg" ] ; then
cp "​{updatePath}/update.cfg" "{cfgDir}" >/dev/null 2>&1 || true
fi
chmod 666 "${cfgDir}/update.cfg" >/dev/null 2>&1 || true
if [ -e "${updatePath}/wpsupdateserver" ] ; then
chmod 754 "${updatePath}/wpsupdateserver"
fi
if [ -e "${updatePath}/wpsupdate" ] ; then
[ -f /opt/kingsoft/wtool/wpsupdate ] && rm -f /opt/kingsoft/wtool/wpsupdate
[ -f /opt/kingsoft/wtool/wpsupdateserver ] && rm -f /opt/kingsoft/wtool/wpsupdateserver

		if [ -f "/opt/kingsoft/wtool/libc++.so.1.0" ]; then
			rm -f "${updatePath}/libc++"*
		fi 
		[ -d /opt/kingsoft/wtool ] && rm -rf /opt/kingsoft/wtool/*
		cp ${updatePath}/../libssl* ${updatePath} -arp  >/dev/null 2>&1 || true 
		cp ${updatePath}/../libcrypto* ${updatePath} -arp  >/dev/null 2>&1 || true 
		cp ${updatePath}/../libQt5Core* ${updatePath} -arp  >/dev/null 2>&1 || true 
		cp ${updatePath}/../libQt5Gui* ${updatePath} -arp  >/dev/null 2>&1 || true 
		cp ${updatePath}/../libQt5Widgets* ${updatePath} -arp  >/dev/null 2>&1 || true 
		cp ${updatePath}/../libQt5Network* ${updatePath} -arp  >/dev/null 2>&1 || true 
		cp ${updatePath}/../libQt5XcbQpa* ${updatePath} -arp  >/dev/null 2>&1 || true 
		cp ${updatePath}/../libQt5DBus* ${updatePath} -arp  >/dev/null 2>&1 || true 
		cp ${updatePath}/../libauth.so ${updatePath} -arp  >/dev/null 2>&1 || true
		cp ${updatePath}/../libkbaseconfigcenter.so  ${updatePath} -arp  >/dev/null 2>&1 || true
		cp ${updatePath}/../addons/kccsdk/libkccsdk.so ${updatePath} -arp  >/dev/null 2>&1 || true
		mkdir -p ${updatePath}/platforms
		cp ${updatePath}/../qt/plugins/platforms/libqxcb.so* ${updatePath}/platforms -arp  >/dev/null 2>&1 || true 
                    rm -f /opt/kingsoft/wtool/libQt*
		cp ${updatePath} /opt/kingsoft/ -arp >/dev/null 2>&1 || true
		cp ${updatePath}/../libc++* ${updatePath} -arp  >/dev/null 2>&1 || true 
		chmod 755 /opt/kingsoft/wtool
		strAppInfo=$(cat <<-EOF

		[app]
		officedir=/opt/kingsoft/wps-office/office6
		EOF
		)
		echo "${strAppInfo}" >> /opt/kingsoft/wtool/update/update.cfg || true
		if ! $isUos ; then
			cp /opt/kingsoft/wtool/wps-office-xcupdate.desktop /etc/xdg/autostart/ -p
			MINUTES=$((RANDOM % 60))
			echo "$MINUTES * * * * root /bin/bash -c 'sleep $((RANDOM % 60)) && /opt/kingsoft/wtool/wpsupdate /from:task'" > /opt/kingsoft/wtool/wpsupdatetask
			echo "@reboot root /opt/kingsoft/wtool/wpsupdateserver" >> /opt/kingsoft/wtool/wpsupdatetask
			cp /opt/kingsoft/wtool/wpsupdatetask /etc/cron.d/ -p
		fi
		HOME=/root /opt/kingsoft/wtool/wpsupdate /sendinstallinfo:true >/dev/null 2>&1 &
	else
		mkdir -p /opt/kingsoft/wtool
		chmod 755 /opt/kingsoft/wtool
	fi
fi
updateTaskPath="/etc/cron.d/wpsupdatetask"
if [ -e ${updateTaskPath} ] ; then
	chmod 644 ${updateTaskPath}
	chown root ${updateTaskPath}
	if is_valid_group "root"; then
		chgrp root ${updateTaskPath}
	fi
fi
updateLogPath="/var/log/wpslog"
if [ -d ${updateLogPath} ] ; then
	chmod 777 ${updateLogPath}
else
	mkdir -m 777 -p ${updateLogPath}
fi

}

function ks_allinone_init()
{
allinonePath="/opt/kingsoft/wps-office/office6/ofdmodule"
if [ -e "${allinonePath}/ofd" ] ; then
if [ -e ${allinonePath}/../libc++abi.so.1 ] ; then
ln -sf ​{allinonePath}/../libc++abi.so.1 {allinonePath}/libc++abi.so.1
fi
if [ -e ${allinonePath}/../libc++.so.1 ] ; then
ln -sf ​{allinonePath}/../libc++.so.1 {allinonePath}/libc++.so.1
fi
if [ -e ${allinonePath}/../libstdc++.so.6 ] ; then
ln -sf ​{allinonePath}/../libstdc++.so.6 {allinonePath}/libstdc++.so.6
fi
if [ -e ${allinonePath}/../libgcc_s.so.1 ] ; then
ln -sf ​{allinonePath}/../libgcc_s.so.1 {allinonePath}/libgcc_s.so.1
fi
fi
}

function ks_fuse_init()
{
fusermount3Path="/opt/kingsoft/wps-office/office6/fusermount3"
if [ -e ${fusermount3Path} ] ; then
chown root:root ${fusermount3Path}
chmod u+s ${fusermount3Path}
fi
}

function ks_custom()
{
custom_folder="/opt/kingsoft/wps-office/office6/custom_script/install"
for file in $custom_folder/*.sh; do
if [[ -f "​file" && ! -h "file" && ! -d "$file" ]]; then
bash $file
fi
done
}

function ks_main()
{
if [ $# -eq 0 ] ; then
return;
fi

ks_init
case $1 in
	configure )
		shift
		if [ "$isFullPackage" != "true" ]; then
			if ! /opt/kingsoft/wps-office/office6/cfgs/wpsupgrade/patch.py -a MYMD5SUM; then
				echo "增量补丁应用失败"
				exit 1
			fi
		fi
		if [ "$isRunScripts" = "true" ]; then
			ks_config $@
		fi
		if [ -f '/opt/kingsoft/wps-office/office6/cfgs/wpsupgrade/patch.py' ]; then
			/opt/kingsoft/wps-office/office6/cfgs/wpsupgrade/patch.py -m "/"
		fi
		if [ -e '/opt/kingsoft/wps-office/office6/mui/zh_CN/resource/help.tar' ]; then
			tar xf /opt/kingsoft/wps-office/office6/mui/zh_CN/resource/help.tar -C /opt/kingsoft/wps-office/office6/mui/zh_CN/resource >/dev/null 2>&1 || true  &
		fi
		ks_custom
		;;
	abort-remove )
		;;
	abort-upgrade )
		;;
esac

}

args="$@"
ks_main $@

#!/bin/bash
set -e
isFullPackage=true
isRunScripts=true
isCustom=true
isZYJ=false
isShop=false
productName="Unified"
holdFilePaths=($allpaths)

res=dpkg -l | grep "soc-heartbeat" | wc -l
if [ "$isZYJ" == "true" ]; then
if [ $res == 0 ] ; then
echo "无法满足依赖:soc-heartbeat"
echo "非ZYJ无法安装此安装包"
exit 2

else
fi
else
if [ $res == 0 ] ; then
:
else
echo "无法满足依赖:soc-heartbeat"
echo "ZYJ无法安装此安装包"
exit 2
fi
fi

deb_res=dpkg -l cn.wps.wps-office cn.wps.wps-office-pro 2>/dev/null | grep "ii" | wc -l

if [ $deb_res == 0 ]; then
else
echo "系统中存在版本 cn.wps.wps-office 或 cn.wps.wps-office-pro 与此版本不能共存,无法安装此安装包"
exit 2
fi

if [ $(dpkg -l wps-office 2>/dev/null | grep "iHR" | wc -l) == 1 ] && [[ -f /opt/kingsoft/wps-office/office6/cfgs/setup.cfg ]]; then
if [ "$productName" == "Professional" ]; then
if [ "$isShop" == "true" ] ; then
if [ -f /opt/kingsoft/wps-office/office6/cfgs/oem.ini ]; then
result=cat /opt/kingsoft/wps-office/office6/cfgs/oem.ini | grep "uDDISgSjbircLc3gPTwW-w..=WHfH10HHgeQrW2N48LfXrA.." | wc -l
if [ $result == 1 ];then
echo "当前版本不支持从应用商店更新"
echo "dpkg: error processing archive"
echo "(--unpack)"
echo "error executing hook"
echo "/usr/sbin/deepin-pkg-install-hook -e hc-verifysign"
exit 2
fi
result=cat /opt/kingsoft/wps-office/office6/cfgs/oem.ini | grep "IsCustom=true" | wc -l
if [ $result == 1 ];then
echo "当前版本不支持从应用商店更新"
echo "dpkg: error processing archive"
echo "(--unpack)"
echo "error executing hook"
echo "/usr/sbin/deepin-pkg-install-hook -e hc-verifysign"
exit 2
fi
result=cat /opt/kingsoft/wps-office/office6/cfgs/oem.ini | grep "IsCustom" | wc -l
resultEncry=cat /opt/kingsoft/wps-office/office6/cfgs/oem.ini | grep "uDDISgSjbircLc3gPTwW-w.." | wc -l
if [ ​result == 0 ] && [ resultEncry == 0 ]; then
echo "当前版本不支持从应用商店更新"
echo "dpkg: error processing archive"
echo "(--unpack)"
echo "error executing hook"
echo "/usr/sbin/deepin-pkg-install-hook -e hc-verifysign"
exit 2
fi
fi
fi
fi
fi

kill pidof wps wpp et wpsoffice promecefpluginhost wpspdf wpsofd parsecloudfiletool wpsflow wpsmind wpsofd wpsclouddisk &>/dev/null || true
sleep 3
kill -9 pidof wps wpp et wpsoffice promecefpluginhost wpspdf wpsofd parsecloudfiletool wpsflow wpsmind EverythingDaemon wpsofd wpsclouddisk &>/dev/null || true

cloudsvrPid="pidof wpscloudsvr" || true
if [ -n "${cloudsvrPid}" ];then
for i in $cloudsvrPid;do
res="cat -v /proc/$i/cmdline " || true
if [[ ${res} =~ "/wps-office/" ]]; then
kill -9 $i &>/dev/null || true
fi
done
fi

if [ "$isFullPackage" != "true" ]; then
if [ "$1" = "install" ]; then
echo "增量包不支持独立安装,请使用完整安装包"
exit 1
fi

if [ "$1" = "upgrade" ]; then
	if [ ! -f "/opt/kingsoft/wps-office/office6/cfgs/wpsupgrade/patch.py" ]; then
		echo "不满足增量安装要求,请使用完整安装包"
		exit 1
	fi
	if /opt/kingsoft/wps-office/office6/cfgs/wpsupgrade/patch.py -c MYMD5SUM -w WHITELIST; then
		[ "$isRunScripts" = "true" ] && /tmp/wpsupgrade.prerm "remove" "$2"
		[ -f /tmp/wpsupgrade.prerm ] && rm -f /tmp/wpsupgrade.prerm
	else
		[ -f /tmp/wpsupgrade.prerm ] && rm -f /tmp/wpsupgrade.prerm
		echo "旧版本文件校验失败,请使用完整安装包"
		exit 1
	fi
fi

else
if [ "$isZYJ" != "true" ]; then
if [ -f /tmp/wpsupgrade.prerm ]; then
/tmp/wpsupgrade.prerm "remove" "$2"
fi
fi
fi

[ -d /tmp/wpstmp ] && rm -rf /tmp/wpstmp
mkdir -p /tmp/wpstmp
for holdFilePath in ${holdFilePaths[@]}
do
if [ -f "​holdFilePath" ] || [ -d "holdFilePath" ] ; then
_dirname=​(dirname "holdFilePath")
mkdir -p /tmp/wpstmp$_dirname
cp ​holdFilePath /tmp/wpstmp_dirname -arv
fi
donereturn

fi
wps_lib_arch=

hexdump $wps_lib_name -n 2 -s 18 -e '1/2 "%u" '

wps_lib_bit=

hexdump $wps_lib_name -n 1 -s 4 -e '1/1 "%u"'

wps_lib_abs_path=

​(readlink -f

wps_lib_name)
wps_lib_version=

​(echo

wps_lib_abs_path | awk -F '.so.' '{print $NF}')
sys_libs_path=

​(ldconfig -p 2>/dev/null | grep

wps_lib_name | awk -F '> ' '{print $2}')

官方支持不代表没有隐患, 我因为dpkg被WPS 365干死机过所以坚决维护了个ban掉所有安装脚本的版本

Reply View the author
yippeeghost
deepin
2 hours ago
#27
hkent

怎么关闭磐石 ,为啥要关闭他啊。

sudo deepin-immutable-writable enable -d /usr

因为磐石锁定了/usr目录,不允许普通app写入数据,而easyconnect需要往/usr里写入信息,所以要禁用。

Reply View the author
2 / 2
To page