forked from CastroFidel/PortWINE
Scripts version 2201
This commit is contained in:
@ -7,17 +7,27 @@ pw_ping_test () {
|
||||
}
|
||||
|
||||
print_error () {
|
||||
echo "ERROR: $@"
|
||||
printf "\E[31m%s Error: $@ %s\e[0m\n"
|
||||
}
|
||||
export -f print_error
|
||||
|
||||
print_warning () {
|
||||
printf "\E[33m%s Warning: $@ %s\e[0m\n"
|
||||
}
|
||||
export -f print_warning
|
||||
|
||||
print_info () {
|
||||
echo "INFO: $@"
|
||||
printf "\E[36m%s Info: $@ %s\e[0m\n"
|
||||
}
|
||||
export -f print_info
|
||||
|
||||
print_debug () {
|
||||
printf "\E[35m%s Debug: $@ %s\e[0m\n"
|
||||
}
|
||||
export -f print_debug
|
||||
|
||||
print_var () {
|
||||
for vp in $@ ; do echo "${vp}=${!vp}" ; done
|
||||
for vp in $@ ; do print_info "${vp}=${!vp}" ; done
|
||||
}
|
||||
export -f print_var
|
||||
|
||||
@ -264,7 +274,7 @@ pw_reinstall_pp () {
|
||||
read -p "Do you want to reinstall PortProton? (Y,y - Yes): " -n 1 -r
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
echo
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
elif ! gui_question "${port_reinstall}"
|
||||
@ -277,7 +287,7 @@ pw_reinstall_pp () {
|
||||
try_remove_file "${PORT_WINE_PATH}/data/user.conf"
|
||||
echo 1000 > "${PORT_WINE_TMP_PATH}/scripts_ver"
|
||||
echo
|
||||
echo "Restarting PP for reinstall files..."
|
||||
print_info "Restarting PP for reinstall files..."
|
||||
/usr/bin/env bash -c ${pw_full_command_line[*]} &
|
||||
exit 0
|
||||
}
|
||||
@ -371,16 +381,16 @@ init_wine_ver () {
|
||||
|
||||
for mono_gecko_chk in "mono" "gecko" ; do
|
||||
if check_symlink "${WINEDIR}/share/wine/${mono_gecko_chk}" ; then
|
||||
echo "${WINEDIR}/share/wine/${mono_gecko_chk} is symlink. OK."
|
||||
print_info "${WINEDIR}/share/wine/${mono_gecko_chk} is symlink. OK."
|
||||
elif [[ -d "${WINEDIR}/share/wine/${mono_gecko_chk}" ]] ; then
|
||||
try_copy_dir "${WINEDIR}/share/wine/${mono_gecko_chk}" "${PORT_WINE_TMP_PATH}" | sszen
|
||||
try_remove_dir "${WINEDIR}/share/wine/${mono_gecko_chk}"
|
||||
try_force_link_dir "${PORT_WINE_TMP_PATH}/${mono_gecko_chk}" "${WINEDIR}"/share/wine/
|
||||
echo "Copy ${WINEDIR}/share/wine/${mono_gecko_chk} to tmp and create symlink to ${WINEDIR}/share/wine/. OK."
|
||||
print_info "Copy ${WINEDIR}/share/wine/${mono_gecko_chk} to tmp and create symlink to ${WINEDIR}/share/wine/. OK."
|
||||
else
|
||||
try_remove_dir "${WINEDIR}/share/wine/${mono_gecko_chk}"
|
||||
try_force_link_dir "${PORT_WINE_TMP_PATH}/${mono_gecko_chk}" "${WINEDIR}"/share/wine
|
||||
echo "${WINEDIR}/share/wine/${mono_gecko_chk} is broken symlink. Repair... OK."
|
||||
print_warning "${WINEDIR}/share/wine/${mono_gecko_chk} is broken symlink. Repair... OK."
|
||||
fi
|
||||
done
|
||||
|
||||
@ -468,7 +478,7 @@ pw_init_runtime () {
|
||||
else export PRESSURE_VESSEL_FILESYSTEMS_RW="${PWRTMRW}"
|
||||
fi
|
||||
done
|
||||
echo "RUNTIME is enabled"
|
||||
print_info "RUNTIME is enabled"
|
||||
}
|
||||
|
||||
pw_mangohud_check () {
|
||||
@ -766,10 +776,10 @@ pw_check_and_download_plugins () {
|
||||
|
||||
pw_init_db () {
|
||||
if [[ ! -z "${portwine_exe}" ]] ; then
|
||||
try_remove_file "${PORT_SCRIPTS_PATH}/portwine_db/setup"
|
||||
export PORTWINE_DB=`echo "${portwine_exe}" | awk -F '/' 'NF>1{print $NF}' | sed s/".exe"/""/gi`
|
||||
if [[ -f "${portwine_exe}".ppdb ]] && [[ "${PORTWINE_DB}" != "RiotClientServices" ]] ; then
|
||||
export PORTWINE_DB_FILE="${portwine_exe}".ppdb
|
||||
# sed -i 's/ PP_/ PW_/g' "${PORTWINE_DB_FILE}"
|
||||
. "${PORTWINE_DB_FILE}"
|
||||
if [[ -z "`ls -p "${PORT_WINE_PATH}/prefixes/" | grep -e "^${PW_PREFIX_NAME}/"`" ]] ; then
|
||||
export PW_PREFIX_NAME=`echo "${portwine_exe}" | awk -F"/prefixes/" '{print $2}' | awk -F"/" '{print $1}'`
|
||||
@ -783,19 +793,17 @@ pw_init_db () {
|
||||
unset ADD_CB_DBFILE
|
||||
for PW_CHECK_DB_FILE in $PW_FIND_DB_FILE ; do
|
||||
if [[ -z "${ADD_CB_DBFILE}" ]] ; then
|
||||
export ADD_CB_DBFILE="${PW_CHECK_DB_FILE}"
|
||||
export ADD_CB_DBFILE="`echo ${PW_CHECK_DB_FILE} | awk -F'/' '{print $NF}'`"
|
||||
else
|
||||
export ADD_CB_DBFILE="${PW_CHECK_DB_FILE}!${ADD_CB_DBFILE}"
|
||||
export ADD_CB_DBFILE="`echo ${PW_CHECK_DB_FILE} | awk -F'/' '{print $NF}'`!${ADD_CB_DBFILE}"
|
||||
fi
|
||||
done
|
||||
PORTWINE_DB_FILE=`"${pw_yad_v12_3}" --text-align=center --text "${PW_SELECTION_DB_LOC}" --borders=15 --form \
|
||||
PORTWINE_DB_FILE="${PORT_SCRIPTS_PATH}/portwine_db"/`"${pw_yad_v12_3}" --text-align=center --text "${PW_SELECTION_DB_LOC}" --borders=15 --form \
|
||||
--title "Database file selection..." --window-icon="$PW_GUI_ICON_PATH/port_proton.png" --form --separator="" \
|
||||
--field="DB FILE: :CB" "${ADD_CB_DBFILE}"`
|
||||
--field="DB FILE: :CB" "${ADD_CB_DBFILE}" 2>/dev/null`
|
||||
if [[ "$?" == "1" || "$?" == "252" ]] ; then exit 0 ; fi
|
||||
# sed -i 's/ PP_/ PW_/g' "${PORTWINE_DB_FILE}"
|
||||
elif [[ `echo "$PW_FIND_DB_FILE" | wc -l` -eq 1 ]] ; then
|
||||
PORTWINE_DB_FILE="${PW_FIND_DB_FILE}"
|
||||
# sed -i 's/ PP_/ PW_/g' "${PORTWINE_DB_FILE}"
|
||||
fi
|
||||
IFS="$orig_IFS"
|
||||
if [[ -f "${PW_FIND_DB_FILE}" ]] && [[ -z `grep "^export PW_DISABLED_CREATE_DB=1" "${PW_FIND_DB_FILE}"` ]] ; then
|
||||
@ -844,7 +852,7 @@ pw_port_update () {
|
||||
xcsd=`"${pw_yad_v12_3}" --title "${scripts_upd2} v.${scripts_current_ver}" --window-icon="$PW_GUI_ICON_PATH/port_proton.png" \
|
||||
--borders=3 --form --separator='%%%' --width=1200 --height=600 \
|
||||
--field=":TXT" "${CHANGLOG_NEWS}" \
|
||||
--field=" ${scripts_upd3} :CB" "${scripts_upd4}!${scripts_upd5}!${scripts_upd6}" `
|
||||
--field=" ${scripts_upd3} :CB" "${scripts_upd4}!${scripts_upd5}!${scripts_upd6}" 2>/dev/null`
|
||||
YAD_STATUS="$?"
|
||||
if [[ "$YAD_STATUS" == "1" || "$YAD_STATUS" == "252" ]] ; then exit 0 ; fi
|
||||
xcsd=`echo "${xcsd}" | awk -F'%%%' '{print $2}'`
|
||||
@ -914,9 +922,9 @@ update_winetricks () {
|
||||
}
|
||||
|
||||
edit_db_from_gui () {
|
||||
echo "edit_db_from_gui PORTWINE_DB_FILE=$PORTWINE_DB_FILE"
|
||||
print_info "edit_db_from_gui PORTWINE_DB_FILE=$PORTWINE_DB_FILE"
|
||||
for mod_db in $@ ; do
|
||||
echo "${mod_db}=${!mod_db}"
|
||||
print_info "${mod_db}=${!mod_db}"
|
||||
if [ -z "`cat "${PORTWINE_DB_FILE}" | grep "export ${mod_db}="`" ] ; then
|
||||
echo "export ${mod_db}=\"${!mod_db}\"" >> "${PORTWINE_DB_FILE}"
|
||||
elif [ "`cat "${PORTWINE_DB_FILE}" | grep "export ${mod_db}=" | grep -v "#"`" ] ; then
|
||||
@ -990,13 +998,13 @@ pw_find_exe () {
|
||||
OrigIFS="$IFS" && IFS=%
|
||||
PW_SET_FIND_EXE="$("${pw_yad_v12_3}" --height="300" --width="1000" --list \
|
||||
--text-align=center --window-icon="$PW_GUI_ICON_PATH/port_proton.png" --title "Create shortcut for..." \
|
||||
--text="\n${loc_gui_create_shortcut_for_exe}" --column="path to .exe file:" ${FIND_TO_GUI})"
|
||||
--text="\n${loc_gui_create_shortcut_for_exe}" --column="path to .exe file:" ${FIND_TO_GUI} 2>/dev/null)"
|
||||
YAD_STATUS="$?"
|
||||
print_var YAD_STATUS
|
||||
if [[ "$YAD_STATUS" == "1" || "$YAD_STATUS" == "252" ]] ; then
|
||||
if [[ -z "${PW_SET_FIND_EXE}" ]] ; then
|
||||
/usr/bin/env bash -c ${pw_full_command_line[*]} &
|
||||
echo "Restarting..."
|
||||
print_info "Restarting..."
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
Reference in New Issue
Block a user