diff options
| author | root <root@dc13.lemmi> | 2020-07-21 10:00:46 +0200 |
|---|---|---|
| committer | root <root@dc13.lemmi> | 2020-07-21 10:00:46 +0200 |
| commit | 1192c4575ea7afdf38e3fa0df4587a08620af11e (patch) | |
| tree | 6910a62487c282d0840d2e668aa7eb40b7c8a3fd /project/setup | |
| parent | 76de8a89f7c1d1b4522eb66e8f89d248e8c1781f (diff) | |
SZS v2.18a
Diffstat (limited to '')
| -rw-r--r-- | project/setup.sh | 196 | ||||
| -rw-r--r-- | project/setup/INSTALL.txt | 50 | ||||
| -rwxr-xr-x | project/setup/cygwin-copy.sh | 71 | ||||
| -rwxr-xr-x | project/setup/install.sh | 92 | ||||
| -rw-r--r-- | project/setup/sendto-install.bat | 2 | ||||
| -rw-r--r-- | project/setup/sendto-install.sh | 80 | ||||
| -rw-r--r-- | project/setup/sendto-uninstall.bat | 2 | ||||
| -rw-r--r-- | project/setup/sendto-uninstall.sh | 83 | ||||
| -rw-r--r-- | project/setup/szs.def | 47 | ||||
| -rw-r--r-- | project/setup/version.h | 59 | ||||
| -rw-r--r-- | project/setup/windows-install.exe | bin | 0 -> 425984 bytes | |||
| -rwxr-xr-x | project/setup/windows-install.sh | 128 | ||||
| -rw-r--r-- | project/setup/windows-sendto/adjust-minimap.bat | 3 | ||||
| -rw-r--r-- | project/setup/windows-sendto/clean-KCL-of-SZS.bat | 3 | ||||
| -rw-r--r-- | project/setup/windows-sendto/convert-to-SZS.bat | 3 | ||||
| -rw-r--r-- | project/setup/windows-sendto/convert-to-WBZ.bat | 3 | ||||
| -rw-r--r-- | project/setup/windows-sendto/create-autoadd-library.bat | 3 | ||||
| -rw-r--r-- | project/setup/windows-sendto/normalize-SZS.bat | 3 | ||||
| -rw-r--r-- | project/setup/windows-uninstall.bat | 2 | ||||
| -rw-r--r-- | project/setup/windows-uninstall.sh | 103 |
20 files changed, 933 insertions, 0 deletions
diff --git a/project/setup.sh b/project/setup.sh new file mode 100644 index 0000000..205ec80 --- /dev/null +++ b/project/setup.sh @@ -0,0 +1,196 @@ +#!/usr/bin/env bash + +revision=0 +[[ $STATIC = 1 ]] || STATIC=0 + +[[ -s revision.sh ]] && . revision.sh + +if [[ -d .svn ]] && which svn >/dev/null 2>&1 +then + revision="$( svn info . | awk '$1=="Revision:" {print $2}' )" + if which svnversion >/dev/null 2>&1 + then + rev="$(svnversion|sed 's/.*://')" + (( ${revision//[!0-9]/} < ${rev//[!0-9]/} )) && revision=$rev + fi + echo "revision=$revision" > revision.sh +fi + +revision_num="${revision//[!0-9]/}" +revision_next=$revision_num +[[ $revision = $revision_num ]] || let revision_next++ + +tim=($(date '+%s %Y-%m-%d %T %Y')) + +have_fuse=0 +[[ $NO_FUSE != 1 && -r /usr/include/fuse.h || -r /usr/local/include/fuse.h ]] \ + && have_fuse=1 + +#--- + +if [[ $M32 = 1 ]] +then + force_m32=1 + libdir=lib + have_fuse=0 + xflags="-m32" + defines=-DFORCE_M32=1 +else + force_m32=0 + libdir=lib64 + xflags= + defines= +fi + +[[ -r /usr/include/bits/fcntl.h ]] \ + && grep -qw fallocate /usr/include/bits/fcntl.h \ + && defines="$defines -DHAVE_FALLOCATE=1" + +[[ -r /usr/include/fcntl.h ]] \ + && grep -qw posix_fallocate /usr/include/fcntl.h \ + && defines="$defines -DHAVE_POSIX_FALLOCATE=1" + +gcc $xflags system.c -o system.tmp && ./system.tmp >Makefile.setup +rm -f system.tmp +SYSTEM=$(awk '$1=="SYSTEM" {print $3}' Makefile.setup) +#echo "SYSTEM=|$SYSTEM|" >&2 + +libpng="-lpng -lz" +case "$SYSTEM" in + mac) + [[ -s /usr/local/lib/libpng.a ]] && libpng="/usr/local/lib/libpng.a -lz" + ;; + + i386) + [[ -s /usr/lib/libpng.a ]] && libpng="/usr/lib/libpng.a -lz" + ;; + + x86_64) + [[ -s /usr/lib64/libpng.a ]] && libpng="/usr/lib64/libpng.a -lz" + ;; +esac + +#----- have_pcre + +have_pcre=0 +pcre_a= +[[ -r /usr/include/pcre.h || -r /usr/local/include/pcre.h ]] && have_pcre=1 + +if (( STATIC && have_pcre )) +then + have_pcre=0 + for lib in /usr/local/$libdir /usr/$libdir /$libdir + do + if [[ -s $lib/libpcre.a ]] + then + have_pcre=1 + pcre_a=$lib/libpcre.a + break; + fi + done +fi +have_pcre=0 + +#-------------------------------------------------- + +INSTALL_PATH=/usr/local + +if [[ -d $INSTALL_PATH/bin ]] +then + HAVE_INSTBIN=1 + INSTBIN=$INSTALL_PATH/bin +else + HAVE_INSTBIN=0 + INSTBIN=/tmp +fi + +if [[ -d $INSTALL_PATH/bin32 ]] +then + HAVE_INSTBIN_32=1 + INSTBIN_32=$INSTALL_PATH/bin32 +else + HAVE_INSTBIN_32=0 + INSTBIN_32=/tmp +fi + +if [[ -d $INSTALL_PATH/bin64 ]] +then + HAVE_INSTBIN_64=1 + INSTBIN_64=$INSTALL_PATH/bin64 +elif [[ -d $INSTALL_PATH/bin-x86_64 ]] +then + HAVE_INSTBIN_64=1 + INSTBIN_64=$INSTALL_PATH/bin-x86_64 +else + HAVE_INSTBIN_64=0 + INSTBIN_64=/tmp +fi + +HAVE_WORK=0 +[[ -d ./work ]] && HAVE_WORK=1 + +HAVE_WORK_SRC=0 +[[ -d ./work/src ]] && HAVE_WORK_SRC=1 + +[[ $NOWIIMM = 1 || $NO_WIIMM = 1 ]] && HAVE_WORK=0 HAVE_WORK_SRC=0 + +HAVE_XSRC=0 +[[ -h xsrc ]] && rm xsrc +if [[ -d xsrc ]] +then + HAVE_XSRC=1 + cat <<- __EOT__ >xsrc/xversion.tmp + #ifndef SZS_X_VERSION_H + #define SZS_X_VERSION_H 1 + + #define XSRC_BASE_VERSION "$1" + #define XSRC_VERSION_NUM "$2" + #define XSRC_VERSION_INT $3 + + #endif // SZS_X_VERSION_H + __EOT__ + diff -N xsrc/xversion.tmp xsrc/xversion.h >/dev/null \ + || mv xsrc/xversion.tmp xsrc/xversion.h +elif [[ ! -a xsrc && -d ../wiimms-szs-tools/xsrc ]] +then + ln -s ../wiimms-szs-tools/xsrc ./xsrc + HAVE_XSRC=1 +fi + +#-------------------------------------------------- + +cat <<- ---EOT--- >>Makefile.setup + + REVISION := $revision + REVISION_NUM := $revision_num + REVISION_NEXT := $revision_next + BINTIME := ${tim[0]} + DATE := ${tim[1]} + TIME := ${tim[2]} + YEAR := ${tim[3]} + + FORCE_M32 := $force_m32 + HAVE_FUSE := $have_fuse + STATIC := $STATIC + XFLAGS += $xflags + DEFINES1 := $defines -DDEBUG_ASSERT=1 + LIBPNG := $libpng + + HAVE_PCRE := $have_pcre + PCRE_A := $pcre_a + + HAVE_INSTBIN := $HAVE_INSTBIN + HAVE_INSTBIN_32 := $HAVE_INSTBIN_32 + HAVE_INSTBIN_64 := $HAVE_INSTBIN_64 + + INSTALL_PATH := $INSTALL_PATH + INSTBIN := $INSTBIN + INSTBIN_32 := $INSTBIN_32 + INSTBIN_64 := $INSTBIN_64 + + HAVE_WORK := $HAVE_WORK + HAVE_WORK_SRC := $HAVE_WORK_SRC + HAVE_XSRC := $HAVE_XSRC + + ---EOT--- + diff --git a/project/setup/INSTALL.txt b/project/setup/INSTALL.txt new file mode 100644 index 0000000..f405b77 --- /dev/null +++ b/project/setup/INSTALL.txt @@ -0,0 +1,50 @@ + + ##################################################################### + ## _______ _______ _______ ## + ## | ___ |____ | ___ | ## + ## | | |_| / /| | |_| ## + ## | |_____ / / | |_____ ## + ## |_____ | / / |_____ | ## + ## _ | | / / _ | | ## + ## | |___| |/ /____| |___| | ## + ## |_______|_______|_______| ## + ## ## + ## Wiimms SZS Tools ## + ## https://szs.wiimm.de/ ## + ## ## + ##################################################################### + ## ## + ## This file is part of the SZS project. ## + ## Visit https://szs.wiimm.de/ for project details and sources. ## + ## ## + ## Copyright (c) 2011-2013 by Dirk Clemens <wiimm@wiimm.de> ## + ## ## + ##################################################################### + + + +How to install Wiimms SZS Tools +=============================== + + Windows: + -------- + + Start: windows-install.exe + After the very first installation of the tools, a reboot is needed. + + + Mac, Linux, Unix: + ----------------- + + First open a console terminal, an admin terminal is the best. + + Then change to the directory, where you have unpacked the distribution. + Therefore use the command: cd DIRECTORY + ... where 'DIRECTORY' is the directory path. + + Call: ./install.sh + + If the script is not started as 'root', the script call itself with 'sudo'. + Depending on your 'sudo' settings, 'sudo' asks you for the root passwort. + To avoid the sudo handling, start the script with: ./install.sh --no-sudo + diff --git a/project/setup/cygwin-copy.sh b/project/setup/cygwin-copy.sh new file mode 100755 index 0000000..3ce6c46 --- /dev/null +++ b/project/setup/cygwin-copy.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash + + ##################################################################### + ## _______ _______ _______ ## + ## | ___ |____ | ___ | ## + ## | | |_| / /| | |_| ## + ## | |_____ / / | |_____ ## + ## |_____ | / / |_____ | ## + ## _ | | / / _ | | ## + ## | |___| |/ /____| |___| | ## + ## |_______|_______|_______| ## + ## ## + ## Wiimms SZS Tools ## + ## http://szs.wiimm.de/ ## + ## ## + ##################################################################### + ## ## + ## This file is part of the SZS project. ## + ## Visit http://szs.wiimm.de/ for project details and sources. ## + ## ## + ## Copyright (c) 2011-2019 by Dirk Clemens <wiimm@wiimm.de> ## + ## ## + ##################################################################### + +#------------------------------------------------------------------------------ +# setup + +CYGWIN_DIR="@@CYGWIN-DIR@@" +CYGWIN_TOOLS="@@CYGWIN-TOOLS@@" +BIN_FILES="@@BIN-FILES@@" +DISTRIB_PATH="@@DISTRIB-PATH@@" + +BIN_PATH="$DISTRIB_PATH/bin" +mkdir -p "$BIN_PATH" || exit 1 + +#------------------------------------------------------------------------------ +# copy cygwin tools + +for tool in $CYGWIN_TOOLS +do + cp --preserve=time "$CYGWIN_DIR/$tool.exe" "$BIN_PATH" || exit 1 +done + +#------------------------------------------------------------------------------ +# copy wit tools + +for tool in $BIN_FILES +do + if [[ -s ./$tool.exe ]] + then + CYGWIN_TOOLS="$CYGWIN_TOOLS $tool" + ln -f ./$tool.exe "$BIN_PATH" || exit 1 + fi +done + +#------------------------------------------------------------------------------ +# copy needed cygwin dlls + +for tool in $CYGWIN_TOOLS +do + ldd "$BIN_PATH/$tool.exe" | grep -F "=> $CYGWIN_DIR/" | awk '{print $1}' +done | sort | uniq | while read dll +do + cp --preserve=time "$CYGWIN_DIR/$dll" "$BIN_PATH" || exit 1 +done + +#------------------------------------------------------------------------------ +# done + +exit 0 + diff --git a/project/setup/install.sh b/project/setup/install.sh new file mode 100755 index 0000000..d39e8f9 --- /dev/null +++ b/project/setup/install.sh @@ -0,0 +1,92 @@ +#!/usr/bin/env bash + + ##################################################################### + ## _______ _______ _______ ## + ## | ___ |____ | ___ | ## + ## | | |_| / /| | |_| ## + ## | |_____ / / | |_____ ## + ## |_____ | / / |_____ | ## + ## _ | | / / _ | | ## + ## | |___| |/ /____| |___| | ## + ## |_______|_______|_______| ## + ## ## + ## Wiimms SZS Tools ## + ## http://szs.wiimm.de/ ## + ## ## + ##################################################################### + ## ## + ## This file is part of the SZS project. ## + ## Visit http://szs.wiimm.de/ for project details and sources. ## + ## ## + ## Copyright (c) 2011-2019 by Dirk Clemens <wiimm@wiimm.de> ## + ## ## + ##################################################################### + +#------------------------------------------------------------------------------ +# sudo? + +try_sudo=1 +if [[ $1 = --no-sudo ]] +then + try_sudo=0 + shift +else + uid="$(id -u 2>/dev/null)" || try_sudo=0 + [[ $uid = 0 ]] && try_sudo=0 +fi + +if ((try_sudo)) +then + echo "*** need root privileges to install => try sudo ***" + sudo "$0" --no-sudo "$@" + exit $? +fi + +#------------------------------------------------------------------------------ +# settings + +BASE_PATH="@@INSTALL-PATH@@" +BIN_PATH="$BASE_PATH/bin" +SHARE_PATH="$BASE_PATH/share/szs" + +BIN_FILES="@@BIN-FILES@@" +SHARE_FILES="@@SHARE-FILES@@" + +INST_FLAGS="-p" + +#------------------------------------------------------------------------------ +# make? + +make=0 +if [[ $1 = --make ]] +then + # it's called from make + make=1 + shift +fi + +#------------------------------------------------------------------------------ +echo "*** install binaries to $BIN_PATH" + +for f in $BIN_FILES +do + [[ -f bin/$f ]] || continue + mkdir -p "$BIN_PATH" + install $INST_FLAGS "bin/$f" "$BIN_PATH/$f" +done + +#------------------------------------------------------------------------------ +echo "*** install share files to $SHARE_PATH" + +mkdir -p "$SHARE_PATH/auto-add/effect" +chmod 775 "$SHARE_PATH/auto-add" "$SHARE_PATH/auto-add/effect" + +for f in $SHARE_FILES +do + install $INST_FLAGS -m 644 share/$f "$SHARE_PATH/$f" +done + +#------------------------------------------------------------------------------ + +exit 0 + diff --git a/project/setup/sendto-install.bat b/project/setup/sendto-install.bat new file mode 100644 index 0000000..c718ea6 --- /dev/null +++ b/project/setup/sendto-install.bat @@ -0,0 +1,2 @@ +@echo off +.\windows-install.exe --script sendto-install.sh diff --git a/project/setup/sendto-install.sh b/project/setup/sendto-install.sh new file mode 100644 index 0000000..abbdf72 --- /dev/null +++ b/project/setup/sendto-install.sh @@ -0,0 +1,80 @@ +#!/usr/bin/env bash + + ##################################################################### + ## _______ _______ _______ ## + ## | ___ |____ | ___ | ## + ## | | |_| / /| | |_| ## + ## | |_____ / / | |_____ ## + ## |_____ | / / |_____ | ## + ## _ | | / / _ | | ## + ## | |___| |/ /____| |___| | ## + ## |_______|_______|_______| ## + ## ## + ## Wiimms SZS Tools ## + ## http://szs.wiimm.de/ ## + ## ## + ##################################################################### + ## ## + ## This file is part of the SZS project. ## + ## Visit http://szs.wiimm.de/ for project details and sources. ## + ## ## + ## Copyright (c) 2011-2019 by Dirk Clemens <wiimm@wiimm.de> ## + ## ## + ##################################################################### + +#------------------------------------------------------------------------------ +# simple cygwin check + +if [[ $1 != --cygwin ]] +then + echo "Option --cygwin not set => exit" >&2 + exit 1 +fi + +#------------------------------------------------------------------------------ +# pre definitions + +WIN_INSTALL_PATH="Wiimm/SZS" + +#------------------------------------------------------------------------------ +echo "* setup" + +export PATH=".:$PATH" +mkdir -p /tmp + +#--------------- + +SENDTO_SRC=./windows-sendto +if [[ ! -d $SENDTO_SRC ]] +then + SENDTO_SRC="$WIN_INSTALL_PATH/windows-sendto" + if [[ ! -d $SENDTO_SRC ]] + then + echo "Can't find SendTo source => abort" >&2 + exit 1 + fi +fi + +#--------------- + +key="/user/Software/Microsoft/Windows/CurrentVersion/Explorer/Shell Folders/SendTo" +if ! WIN_SENDTO_PATH="$(regtool get "$key")" || [[ $WIN_SENDTO_PATH = "" ]] +then + echo "Can't determine Windows program path => abort" >&2 + exit 1 +fi +CYGWIN_SENDTO_PATH="${WIN_SENDTO_PATH//\\//}" + + +#------------------------------------------------------------------------------ +echo "* install SendTo scripts" +echo " - SendTo source: $SENDTO_SRC" +echo " - SendTo folder: $WIN_SENDTO_PATH" +echo " - ->: $CYGWIN_SENDTO_PATH" + +cp -p "$SENDTO_SRC"/* "$CYGWIN_SENDTO_PATH/" + +#------------------------------------------------------------------------------ + +exit 0 + diff --git a/project/setup/sendto-uninstall.bat b/project/setup/sendto-uninstall.bat new file mode 100644 index 0000000..b41f217 --- /dev/null +++ b/project/setup/sendto-uninstall.bat @@ -0,0 +1,2 @@ +@echo off +.\windows-install.exe --script sendto-uninstall.sh diff --git a/project/setup/sendto-uninstall.sh b/project/setup/sendto-uninstall.sh new file mode 100644 index 0000000..093daea --- /dev/null +++ b/project/setup/sendto-uninstall.sh @@ -0,0 +1,83 @@ +#!/usr/bin/env bash + + ##################################################################### + ## _______ _______ _______ ## + ## | ___ |____ | ___ | ## + ## | | |_| / /| | |_| ## + ## | |_____ / / | |_____ ## + ## |_____ | / / |_____ | ## + ## _ | | / / _ | | ## + ## | |___| |/ /____| |___| | ## + ## |_______|_______|_______| ## + ## ## + ## Wiimms SZS Tools ## + ## http://szs.wiimm.de/ ## + ## ## + ##################################################################### + ## ## + ## This file is part of the SZS project. ## + ## Visit http://szs.wiimm.de/ for project details and sources. ## + ## ## + ## Copyright (c) 2011-2019 by Dirk Clemens <wiimm@wiimm.de> ## + ## ## + ##################################################################### + +#------------------------------------------------------------------------------ +# simple cygwin check + +if [[ $1 != --cygwin ]] +then + echo "Option --cygwin not set => exit" >&2 + exit 1 +fi + +#------------------------------------------------------------------------------ +# pre definitions + +WIN_INSTALL_PATH="Wiimm/SZS" + +#------------------------------------------------------------------------------ +echo "* setup" + +export PATH=".:$PATH" + +#--------------- + +SENDTO_SRC=./windows-sendto +if [[ ! -d $SENDTO_SRC ]] +then + SENDTO_SRC="$WIN_INSTALL_PATH/windows-sendto" + if [[ ! -d $SENDTO_SRC ]] + then + echo "Can't find SendTo source => abort" >&2 + exit 1 + fi +fi + +#--------------- + +key="/user/Software/Microsoft/Windows/CurrentVersion/Explorer/Shell Folders/SendTo" +if ! WIN_SENDTO_PATH="$(regtool get "$key")" || [[ $WIN_SENDTO_PATH = "" ]] +then + echo "Can't determine Windows program path => abort" >&2 + exit 1 +fi +CYGWIN_SENDTO_PATH="${WIN_SENDTO_PATH//\\//}" + +#------------------------------------------------------------------------------ +echo "* uninstall SendTo scripts" +echo " - SendTo folder: $WIN_SENDTO_PATH" +echo " - ->: $CYGWIN_SENDTO_PATH" + +for f in "$SENDTO_SRC"/* +do + [[ -f $f ]] || continue; + f="${f##*/}" + echo "remove $f" + rm -f "$CYGWIN_SENDTO_PATH/$f" +done + +#------------------------------------------------------------------------------ + +exit 0 + diff --git a/project/setup/szs.def b/project/setup/szs.def new file mode 100644 index 0000000..d4f177e --- /dev/null +++ b/project/setup/szs.def @@ -0,0 +1,47 @@ + +//---------------------------------" +// This file is generated by make." +// Any changes will be lost!" +//---------------------------------" + +#gdef szs$ = @map + +#gdef szs$['TOOLSET_SHORT'] = "@@TOOLSET-SHORT@@" +#gdef szs$['TOOLSET_LONG'] = "@@TOOLSET-LONG@@" +#gdef szs$['WSZST_SHORT'] = "@@WSZST-SHORT@@" +#gdef szs$['WSZST_LONG'] = "@@WSZST-LONG@@" +#gdef szs$['WBMGT_SHORT'] = "@@WBMGT-SHORT@@" +#gdef szs$['WBMGT_LONG'] = "@@WBMGT-LONG@@" +#gdef szs$['WCTCT_SHORT'] = "@@WCTCT-SHORT@@" +#gdef szs$['WCTCT_LONG'] = "@@WCTCT-LONG@@" +#gdef szs$['WIMGT_SHORT'] = "@@WIMGT-SHORT@@" +#gdef szs$['WIMGT_LONG'] = "@@WIMGT-LONG@@" +#gdef szs$['WKCLT_SHORT'] = "@@WKCLT-SHORT@@" +#gdef szs$['WKCLT_LONG'] = "@@WKCLT-LONG@@" +#gdef szs$['WKMPT_SHORT'] = "@@WKMPT-SHORT@@" +#gdef szs$['WKMPT_LONG'] = "@@WKMPT-LONG@@" +#gdef szs$['WLECT_SHORT'] = "@@WLECT-SHORT@@" +#gdef szs$['WLECT_LONG'] = "@@WLECT-LONG@@" +#gdef szs$['WMDLT_SHORT'] = "@@WMDLT-SHORT@@" +#gdef szs$['WMDLT_LONG'] = "@@WMDLT-LONG@@" +#gdef szs$['WPATT_SHORT'] = "@@WPATT-SHORT@@" +#gdef szs$['WPATT_LONG'] = "@@WPATT-LONG@@" +#gdef szs$['WSTRT_SHORT'] = "@@WSTRT-SHORT@@" +#gdef szs$['WSTRT_LONG'] = "@@WSTRT-LONG@@" + +#gdef szs$['AUTHOR'] = "@@AUTHOR@@" + +#gdef szs$['VERSION'] = "@@VERSION@@" +#gdef szs$['VERSION_NUM'] = "@@VERSION-NUM@@" +#gdef szs$['BETA_VERSION'] = "@@BETA-VERSION@@" +#gdef szs$['BETA_SUFFIX'] = "@@BETA-SUFFIX@@" + +#gdef szs$['REVISION'] = "@@REV@@" +#gdef szs$['REVISION_NUM'] = @@REV-NUM@@ +#gdef szs$['REVISION_NEXT'] = @@REV-NEXT@@ + +#gdef szs$['BINTIME'] = @@BINTIME@@ +#gdef szs$['DATE'] = "@@DATE@@" +#gdef szs$['TIME'] = "@@TIME@@" +#gdef szs$['DATETIME'] = "@@DATE@@ @@TIME@@" + diff --git a/project/setup/version.h b/project/setup/version.h new file mode 100644 index 0000000..61a799e --- /dev/null +++ b/project/setup/version.h @@ -0,0 +1,59 @@ + +//---------------------------------" +// This file is generated by make." +// Any changes will be lost!" +//---------------------------------" + +#define TOOLSET_SHORT "@@TOOLSET-SHORT@@" +#define TOOLSET_LONG "@@TOOLSET-LONG@@" +#define WSZST_SHORT "@@WSZST-SHORT@@" +#define WSZST_LONG "@@WSZST-LONG@@" +#define WBMGT_SHORT "@@WBMGT-SHORT@@" +#define WBMGT_LONG "@@WBMGT-LONG@@" +#define WCTCT_SHORT "@@WCTCT-SHORT@@" +#define WCTCT_LONG "@@WCTCT-LONG@@" +#define WIMGT_SHORT "@@WIMGT-SHORT@@" +#define WIMGT_LONG "@@WIMGT-LONG@@" +#define WKCLT_SHORT "@@WKCLT-SHORT@@" +#define WKCLT_LONG "@@WKCLT-LONG@@" +#define WKMPT_SHORT "@@WKMPT-SHORT@@" +#define WKMPT_LONG "@@WKMPT-LONG@@" +#define WLECT_SHORT "@@WLECT-SHORT@@" +#define WLECT_LONG "@@WLECT-LONG@@" +#define WMDLT_SHORT "@@WMDLT-SHORT@@" +#define WMDLT_LONG "@@WMDLT-LONG@@" +#define WPATT_SHORT "@@WPATT-SHORT@@" +#define WPATT_LONG "@@WPATT-LONG@@" +#define WSTRT_SHORT "@@WSTRT-SHORT@@" +#define WSTRT_LONG "@@WSTRT-LONG@@" + +#define AUTHOR "@@AUTHOR@@" + +#define BASE_VERSION "@@VERSION@@" +#define VERSION_NUM "@@VERSION-NUM@@" +#define VERSION_INT @@VERSION-INT@@ +#define BETA_VERSION @@BETA-VERSION@@ + +#if HAVE_WIIMM_EXT + #define VERSION "@@VERSION@@.w" +#else + #define VERSION "@@VERSION@@" +#endif + +#define REVISION "@@REV@@" +#define REVISION_NUM @@REV-NUM@@ +#define REVISION_NEXT @@REV-NEXT@@ + +#define BINTIME @@BINTIME@@ +#define DATE "@@DATE@@" +#define TIME "@@TIME@@" +#define DATETIME "@@DATE@@ @@TIME@@" +#define YEAR @@YEAR@@ + +#define URI_REPOS "@@URI-REPOS@@/" +#define URI_VIEWVC "@@URI-VIEWVC@@/" +#define URI_HOME "@@URI-HOME@@" +#define URI_DOWNLOAD "@@URI-DOWNLOAD@@" + +#define HAVE_XSRC @@HAVE-XSRC@@ + diff --git a/project/setup/windows-install.exe b/project/setup/windows-install.exe Binary files differnew file mode 100644 index 0000000..a7add8b --- /dev/null +++ b/project/setup/windows-install.exe diff --git a/project/setup/windows-install.sh b/project/setup/windows-install.sh new file mode 100755 index 0000000..4dbd1bf --- /dev/null +++ b/project/setup/windows-install.sh @@ -0,0 +1,128 @@ +#!/usr/bin/env bash + + ##################################################################### + ## _______ _______ _______ ## + ## | ___ |____ | ___ | ## + ## | | |_| / /| | |_| ## + ## | |_____ / / | |_____ ## + ## |_____ | / / |_____ | ## + ## _ | | / / _ | | ## + ## | |___| |/ /____| |___| | ## + ## |_______|_______|_______| ## + ## ## + ## Wiimms SZS Tools ## + ## http://szs.wiimm.de/ ## + ## ## + ##################################################################### + ## ## + ## This file is part of the SZS project. ## + ## Visit http://szs.wiimm.de/ for project details and sources. ## + ## ## + ## Copyright (c) 2011-2019 by Dirk Clemens <wiimm@wiimm.de> ## + ## ## + ##################################################################### + +#------------------------------------------------------------------------------ +# simple cygwin check + +if [[ $1 != --cygwin ]] +then + echo "Option --cygwin not set => exit" >&2 + exit 1 +fi + +#------------------------------------------------------------------------------ +# pre definitions + +BIN_FILES="wszst wbmgt wimgt wkclt wkmpt wstrt " +SHARE_FILES="" +WIN_INSTALL_PATH="Wiimm/SZS" + +#------------------------------------------------------------------------------ +# setup + +echo "* setup" + +export PATH=".:$PATH" +mkdir -p /tmp + +key="/machine/SOFTWARE/Microsoft/Windows/CurrentVersion/ProgramFilesDir" +if ! WIN_PROG_PATH="$(regtool get "$key")" || [[ $WIN_PROG_PATH = "" ]] +then + echo "Can't determine Windows program path => abort" >&2 + exit 1 +fi +#CYGWIN_PROG_PATH="$( realpath "$WIN_PROG_PATH" )" +CYGWIN_PROG_PATH="${WIN_PROG_PATH//\\//}" + +WDEST="$WIN_PROG_PATH\\${WIN_INSTALL_PATH//\//\\}" +CDEST="$CYGWIN_PROG_PATH/$WIN_INSTALL_PATH" + +#------------------------------------------------------------------------------ +# install files + +# mkdir before testing the directory +mkdir -p "$CDEST" "$CDEST/auto-add/effect" +chmod 666 "$CDEST/auto-add" "$CDEST/auto-add/effect" + +if [[ $(stat -c%d-%i "$PWD") != "$(stat -c%d-%i "$CDEST")" ]] +then + echo "* install files to $WDEST" + cp --preserve=time *.bat *.dll *.exe *.sh "$CDEST" +fi + +#------------------------------------------------------------------------------ +# define application pathes + +for tool in $BIN_FILES +do + [[ -s "$CDEST/$tool.exe" ]] || continue + echo "* define application path for '$tool.exe'" + key="/machine/SOFTWARE/Microsoft/Windows/CurrentVersion/App Paths/$tool.exe" + regtool add "$key" + regtool set -s "$key/" "${WDEST}\\${tool}.exe" + regtool set -s "$key/Path" "${WDEST}\\" +done + +#------------------------------------------------------------------------------ +# add WIT path to environment 'Path' + +echo "* add SZS path to environment 'Path'" + +function set_path() +{ + local key="$1" + + local p= + local count=0 + local new_path= + + # split at ';' & substitute ' ' temporary to ';' to be space save + for p in $( regtool --quiet get "$key" | tr '; ' '\n;' ) + do + p="${p//;/ }" + #echo " -> |$p|" + if [[ "$p" == "$WDEST" ]] + then + ((count++)) || new_path="$new_path;$p" + #echo "$count $WDEST" + elif [[ $p != "" ]] + then + new_path="$new_path;$p" + fi + done + + if [[ $new_path != "" ]] + then + ((count)) || new_path="$new_path;$WDEST" + #echo "count=$count" + #echo "new_path=${new_path:1}" + regtool set -e "$key" "${new_path:1}" + fi +} + +set_path '/machine/SYSTEM/CurrentControlSet/Control/Session Manager/Environment/Path' +set_path '/user/Environment/Path' + +#------------------------------------------------------------------------------ + diff --git a/project/setup/windows-sendto/adjust-minimap.bat b/project/setup/windows-sendto/adjust-minimap.bat new file mode 100644 index 0000000..2878b30 --- /dev/null +++ b/project/setup/windows-sendto/adjust-minimap.bat @@ -0,0 +1,3 @@ +@echo off
+wszst normalize -v --minimap --number %1
+pause
diff --git a/project/setup/windows-sendto/clean-KCL-of-SZS.bat b/project/setup/windows-sendto/clean-KCL-of-SZS.bat new file mode 100644 index 0000000..2764cbc --- /dev/null +++ b/project/setup/windows-sendto/clean-KCL-of-SZS.bat @@ -0,0 +1,3 @@ +@echo off
+wszst normalize -v --kcl drop,new,log --number %1
+pause
diff --git a/project/setup/windows-sendto/convert-to-SZS.bat b/project/setup/windows-sendto/convert-to-SZS.bat new file mode 100644 index 0000000..718c1df --- /dev/null +++ b/project/setup/windows-sendto/convert-to-SZS.bat @@ -0,0 +1,3 @@ +@echo off
+wszst compress --szs --number %1
+pause
diff --git a/project/setup/windows-sendto/convert-to-WBZ.bat b/project/setup/windows-sendto/convert-to-WBZ.bat new file mode 100644 index 0000000..1069a32 --- /dev/null +++ b/project/setup/windows-sendto/convert-to-WBZ.bat @@ -0,0 +1,3 @@ +@echo off
+wszst compress --wbz --number %1
+pause
diff --git a/project/setup/windows-sendto/create-autoadd-library.bat b/project/setup/windows-sendto/create-autoadd-library.bat new file mode 100644 index 0000000..3d2ffb5 --- /dev/null +++ b/project/setup/windows-sendto/create-autoadd-library.bat @@ -0,0 +1,3 @@ +@echo off
+wszst autoadd %1
+pause
diff --git a/project/setup/windows-sendto/normalize-SZS.bat b/project/setup/windows-sendto/normalize-SZS.bat new file mode 100644 index 0000000..63aacab --- /dev/null +++ b/project/setup/windows-sendto/normalize-SZS.bat @@ -0,0 +1,3 @@ +@echo off
+wszst normalize -v --szs --number %1
+pause
diff --git a/project/setup/windows-uninstall.bat b/project/setup/windows-uninstall.bat new file mode 100644 index 0000000..664d123 --- /dev/null +++ b/project/setup/windows-uninstall.bat @@ -0,0 +1,2 @@ +@echo off
+.\windows-install.exe --script windows-uninstall.sh
diff --git a/project/setup/windows-uninstall.sh b/project/setup/windows-uninstall.sh new file mode 100644 index 0000000..4a19c33 --- /dev/null +++ b/project/setup/windows-uninstall.sh @@ -0,0 +1,103 @@ +#!/usr/bin/env bash + + ##################################################################### + ## _______ _______ _______ ## + ## | ___ |____ | ___ | ## + ## | | |_| / /| | |_| ## + ## | |_____ / / | |_____ ## + ## |_____ | / / |_____ | ## + ## _ | | / / _ | | ## + ## | |___| |/ /____| |___| | ## + ## |_______|_______|_______| ## + ## ## + ## Wiimms SZS Tools ## + ## http://szs.wiimm.de/ ## + ## ## + ##################################################################### + ## ## + ## This file is part of the SZS project. ## + ## Visit http://szs.wiimm.de/ for project details and sources. ## + ## ## + ## Copyright (c) 2011-2019 by Dirk Clemens <wiimm@wiimm.de> ## + ## ## + ##################################################################### + +#------------------------------------------------------------------------------ +# simple cygwin check + +if [[ $1 != --cygwin ]] +then + echo "Option --cygwin not set => exit" >&2 + exit 1 +fi + +#------------------------------------------------------------------------------ +# pre definitions + +BIN_FILES="wszst wbmgt wimgt wkclt wkmpt wstrt " +SHARE_FILES="" +WIN_INSTALL_PATH="Wiimm/SZS" + +#------------------------------------------------------------------------------ +# setup + +echo "* setup" + +export PATH=".:$PATH" + +key="/machine/SOFTWARE/Microsoft/Windows/CurrentVersion/ProgramFilesDir" +if ! WIN_PROG_PATH="$(regtool get "$key")" || [[ $WIN_PROG_PATH = "" ]] +then + echo "Can't determine Windows program path => abort" >&2 + exit 1 +fi +#CYGWIN_PROG_PATH="$( realpath "$WIN_PROG_PATH" )" +CYGWIN_PROG_PATH="${WIN_PROG_PATH//\\//}" + +WDEST="$WIN_PROG_PATH\\${WIN_INSTALL_PATH//\//\\}" +CDEST="$CYGWIN_PROG_PATH/$WIN_INSTALL_PATH" + +#------------------------------------------------------------------------------ +# remove application pathes + +for tool in $BIN_FILES +do + key="/machine/SOFTWARE/Microsoft/Windows/CurrentVersion/App Paths/$tool.exe" + if regtool check "$key" >/dev/null 2>&1 + then + echo "* remove application path for '$tool.exe'" + regtool unset "$key/" "${WDEST}\\${tool}.exe" + regtool unset "$key/Path" "${WDEST}\\" + regtool remove "$key" + fi +done + +#------------------------------------------------------------------------------ +# add WIT path to environment 'Path' + +echo "* add SZS path to environment 'Path'" + +function set_path() +{ + local key="$1" + + local p= + local count=0 + local new_path= + + # split at ';' & substitute ' ' temporary to ';' to be space save + for p in $( regtool --quiet get "$key" | tr '; ' '\n;' ) + do + p="${p//;/ }" + #echo " -> |$p|" + [[ "$p" = "$WDEST" ]] || new_path="$new_path;$p" + done + + [[ $new_path = "" ]] || regtool set -e "$key" "${new_path:1}" +} + +set_path '/machine/SYSTEM/CurrentControlSet/Control/Session Manager/Environment/Path' +set_path '/user/Environment/Path' + +#------------------------------------------------------------------------------ + |
