diff --git a/CMakeLists.txt b/CMakeLists.txt
index a475b9f7..f15a4822 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,7 +34,7 @@ if (WIN32)
elseif (APPLE)
set(PLATFORM_INCLUDE "includesMac.h")
else ()
- set(PLATFORM_INCLUDE "includesDefault.h")
+ set(PLATFORM_INCLUDE "includesLinux.h")
endif ()
# Settings ---------------------------------------------------------------------
@@ -332,7 +332,6 @@ endif ()
add_subdirectory(src/app)
-
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
diff --git a/bin/app/data/gui/installer/EULA.txt b/bin/app/data/gui/installer/EULA.txt
new file mode 100644
index 00000000..599a6f92
--- /dev/null
+++ b/bin/app/data/gui/installer/EULA.txt
@@ -0,0 +1,72 @@
+Coati
+Software License Agreement
+Effective 1.1.2016
+
+BY INSTALLING OR USING THIS SOFTWARE, YOU ARE BECOMING A PARTY TO, AND ARE CONSENTING TO BE BOUND BY, THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS AGREEMENT, DO NOT INSTALL OR USE THIS SOFTWARE.
+
+DEFINITIONS
+"Software" means:
+·0 A major version of Coati in executable form. The major version is defined by the leading number of the version string (e.g. the major version of Coati 1.x.x.x is version 1);
+·1 documentation for that major version of Coati;
+·2 minor updates included in software maintenance which are indicated by an increase in the numbers that follow the major version number (e.g. the update from Coati 1.0.0.0 to Coati 1.0.1.4).
+"Licensor" means:
+·3 Coati Software OG, having a place of business at Schlossallee 7/1, 5412 Puch/Hallein, Austria.
+"Licensee" means:
+·4 the individual evaluating the trial version of the Software;
+·5 the company, corporation, or organization that purchased a License(s) for the Software;
+·6 the individual who purchased a License for the Software.
+"Activation Key" means:
+·7 the name of the Licensee, the kind of license, the major version of the software that is licensed, and a hashcode; the combination of these values allows the Licensee to activate a genuine copy of the Software.
+"Authorized User" means:
+·8 the individual evaluating the Software during a trial;
+·9 an employee or independent contractor who might at any time use the Software, of the company, corporation, or organization that purchased a License(s) for the Software; an entity has one Authorized User for each License purchased;
+·10 the individual who purchased a License for the Software; the individual is the only Authorized User.
+
+GRANT
+·11 Subject to the terms of this Agreement, the Licensor hereby grants the Licensee a non-transferable, non-exclusive, non-sub-licensable, limited license that allows:
+·12 the Licensee to distribute (an) Activation Key(s) to Authorized User(s);
+·13 Authorized User(s) to install the licensed version of the Software on computer PCs where potential use of the Software is restricted exclusively to Authorized User(s);
+·14 Authorized User(s) to use the Software on computer PCs, in virtual machines, in combination with multiple IDEs, and in combination with multiple instances of an IDE;
+·15 Authorized User(s) to use the trial version of the software in order to examine the provided example projects;
+·16 Licensee to make a copy of the Software for archival purposes provided the copy contains all of the proprietary notices of the Software.
+·17 In case the Licensee of the software is a company, corporation, or organization the Licensor has the right to mention this usage of the Software on its own website.
+
+RESTRICTIONS
+Licensee will not, and will have no right to:
+·18 use the trial version of the software in order to examine project other than the provided examples;
+·19 use a private/academic license of the software for any commercial purposes;
+·20 distribute, use, or transfer an Activation Key(s) that has been superseded by an Activation Key(s) provided with software maintenance;
+·21 modify, translate, reverse engineer, decompile, disassemble (except to the extent applicable laws specifically prohibit such restriction), create derivative works based on, or otherwise attempt to discover the source code or underlying ideas or algorithms of the Software;
+·22 sell, rent, lease, distribute, or otherwise transfer rights to the Software without prior written consent from Licensor;
+·23 remove any proprietary notices or labels from the Software.
+
+TITLE AND COPYRIGHT
+Title, ownership rights, intellectual property rights, and copyright to the Software, and any copies or portions thereof, shall remain in Licensor. The Software is protected by European copyright directives, Austrian copyright laws as well as United States copyright laws and international treaty provisions.
+
+DISCLAIMER OF WARRANTY
+THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND. LICENSOR HEREBY DISCLAIMS ALL EXPRESS OR IMPLIED WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS AGREEMENT. SOME U.S. STATES DO NOT ALLOW EXCLUSIONS OF AN IMPLIED WARRANTY, SO THIS DISCLAIMER MAY NOT APPLY TO LICENSEE. LICENSEE MAY HAVE OTHER LEGAL RIGHTS THAT VARY FROM STATE TO STATE OR BY JURISDICTION.
+
+LIMITATION OF LIABILITY
+LICENSEE ASSUMES THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE. LICENSOR ASSUMES NO LIABILITY FOR THE COST OF ANY SERVICE OR REPAIR IF THE SOFTWARE IS DEFECTIVE. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, TORT, CONTRACT, STRICT LIABILITY, OR OTHERWISE, SHALL LICENSOR, OR ITS LICENSORS, SUPPLIERS OR RESELLERS, BE LIABLE TO LICENSEE OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES. IN NO EVENT WILL LICENSOR BE LIABLE FOR ANY DAMAGES IN EXCESS OF THE MONEY PAID FOR THE SOFTWARE, EVEN IF LICENSOR SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. FURTHERMORE, SOME U.S. STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION AND EXCLUSION MAY NOT APPLY TO LICENSEE.
+
+TERMINATION
+The license granted herein shall be perpetual. If Licensee fails to comply with any of the terms of this Agreement, this Agreement and the rights granted herein will terminate immediately. Licensor may, at its sole discretion and at any time, terminate this Agreement. On termination, Licensee must cease using and destroy all copies of the Software.
+
+EXPORT CONTROLS
+Licensee shall comply with all export laws, restrictions and regulations of the United States, the Directive 2009/428/EC of the European Parliament and of the Council and the Austrian Außenwirtschaftsgesetz 2011, BGBl I No. 26/2011. Licensee shall not export, re-export or otherwise transfer the Software to any country for which the United States or the European Union or Austria maintains an embargo, or to any person or entity on the U.S. Department of Treasury List of Specially Designated Nationals or the U.S. Department of Commerce Denied Persons List or Entity List. Licensee represents and warrants that licensee is not located in, under the control of, or a national or resident of any restricted country or on any such list.
+
+THIRD PARTY CREDITS
+Portions of the Software utilize or include third party software and other copyrighted materials. Credits, licensing terms, and disclaimers for such materials are contained in the installation directory for the Software, and are accessible via the “Licenses” dialog for the Software. Licensee agrees that use of such copyrighted materials is governed by their respective terms.
+
+ENTIRE AGREEMENT
+This Agreement represents the complete agreement concerning this license between the parties and supersedes all prior agreements and representations between them. It may be amended only in writing executed by both parties. Coati Software OG reserves the exclusive right to periodically update this EULA at its discretion at any time, with reasonable notice to you by posting the new EULA at the following URL: http://www.coati.io/. Any action arising out of or relating to this Agreement may be brought exclusively in Salzburg, Austria, and Coati Software OG and you irrevocably consent to the jurisdiction of such courts and venue in Salzburg, Austria.
+
+CONTACT
+If you have questions regarding this agreement, contact:
+Coati Software OG
+Schlossallee 7/1
+5412 Puch/Hallein
+Austria
+support@coati.io
+
+
diff --git a/cmake/LinuxPackage.cmake b/cmake/LinuxPackage.cmake
index e4daf62c..a308c6c5 100644
--- a/cmake/LinuxPackage.cmake
+++ b/cmake/LinuxPackage.cmake
@@ -3,72 +3,144 @@
# WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
# )
-# INSTALL(CODE "
-# execute_process(
-# COMMAND upx --best ${CMAKE_SOURCE_DIR}/bin/app/Release/Coati)"
-# )
+#INSTALL(CODE
+ #"execute_process(COMMAND \"${APP_PROJECT_NAME}
+ #-d ${CMAKE_SOURCE_DIR}/bin/app/data/projects/tictactoe/tictactoe.coatiproject\")"
+#)
-INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/bin/app/data
- DESTINATION .
- PATTERN "log/*" EXCLUDE
- PATTERN "projects/ignored" EXCLUDE
- PATTERN "data/src" EXCLUDE
- PATTERN "*.sqlite" EXCLUDE
- PATTERN "ApplicationSettings.xml" EXCLUDE
- PATTERN "ApplicationSettings_for_package.xml" EXCLUDE
- PATTERN "ProjectSettings_template.xml" EXCLUDE
- PATTERN "ApplicationSettings_template.xml" EXCLUDE
+#INSTALL(CODE
+ #"execute_process(COMMAND ${APP_PROJECT_NAME}
+ #-d ${CMAKE_SOURCE_DIR}/bin/app/data/projects/tutorial/tutorial.coatiproject)"
+#)
+
+function(AddSharedToComponent componentName)
+ INSTALL(DIRECTORY
+ ${CMAKE_SOURCE_DIR}/bin/app/data
+ DESTINATION .
+ COMPONENT ${componentName}
+ PATTERN "log/*" EXCLUDE
+ PATTERN "projects/ignored" EXCLUDE
+ PATTERN "data/src" EXCLUDE
+ PATTERN "data/gui/installer" EXCLUDE
+ PATTERN "data/install" EXCLUDE
+ PATTERN "ApplicationSettings.xml" EXCLUDE
+ PATTERN "ApplicationSettings_for_package.xml" EXCLUDE
+ PATTERN "ProjectSettings_template.xml" EXCLUDE
+ PATTERN "ApplicationSettings_template.xml" EXCLUDE
+ )
+
+ INSTALL(FILES ${CMAKE_SOURCE_DIR}/bin/app/user/ApplicationSettings_for_package.xml
+ DESTINATION user
+ COMPONENT ${componentName}
+ RENAME ApplicationSettings.xml
+ )
+
+ INSTALL(FILES
+ ${CMAKE_SOURCE_DIR}/bin/app/data/gui/installer/EULA.txt
+ COMPONENT ${componentName}
+ DESTINATION .
+ )
+
+ INSTALL(FILES
+ #Qt libs
+ # FIXME need a better solution for that
+ ${EXTERNAL_BUILD}/qt/lib/libQt5Gui.so.5
+ ${EXTERNAL_BUILD}/qt/lib/libQt5Gui.so.5.5
+ ${EXTERNAL_BUILD}/qt/lib/libQt5Gui.so.5.5.1
+ ${EXTERNAL_BUILD}/qt/lib/libQt5Core.so.5
+ ${EXTERNAL_BUILD}/qt/lib/libQt5Core.so.5.5
+ ${EXTERNAL_BUILD}/qt/lib/libQt5Core.so.5.5.1
+ ${EXTERNAL_BUILD}/qt/lib/libQt5Network.so.5
+ ${EXTERNAL_BUILD}/qt/lib/libQt5Network.so.5.5
+ ${EXTERNAL_BUILD}/qt/lib/libQt5Network.so.5.5.1
+ ${EXTERNAL_BUILD}/qt/lib/libQt5XcbQpa.so.5
+ ${EXTERNAL_BUILD}/qt/lib/libQt5XcbQpa.so.5.5
+ ${EXTERNAL_BUILD}/qt/lib/libQt5XcbQpa.so.5.5.1
+ ${EXTERNAL_BUILD}/qt/lib/libQt5Widgets.so.5
+ ${EXTERNAL_BUILD}/qt/lib/libQt5Widgets.so.5.5
+ ${EXTERNAL_BUILD}/qt/lib/libQt5Widgets.so.5.5.1
+ ${EXTERNAL_BUILD}/qt/lib/libQt5DBus.so.5
+ ${EXTERNAL_BUILD}/qt/lib/libQt5DBus.so.5.5
+ ${EXTERNAL_BUILD}/qt/lib/libQt5DBus.so.5.5.1
+
+ #C++
+ ${LIBSTDCPP}
+ DESTINATION lib
+ COMPONENT ${componentName}
+ )
+
+ INSTALL(FILES
+ ${EXTERNAL_BUILD}/qt/plugins/platforms/libqxcb.so
+ DESTINATION platforms
+ COMPONENT ${componentName}
+ )
+
+ INSTALL(DIRECTORY
+ ${CMAKE_SOURCE_DIR}/bin/app/data/projects
+ DESTINATION user
+ COMPONENT ${componentName}
+ )
+
+ INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/bin/app/user
+ DESTINATION .
+ COMPONENT ${componentName}
+ PATTERN "ApplicationSettings.xml" EXCLUDE
+ PATTERN "ApplicationSettings_for_package.xml" EXCLUDE
+ PATTERN "ProjectSettings_template.xml" EXCLUDE
+ PATTERN "ApplicationSettings_template.xml" EXCLUDE
+ PATTERN "window_settings.ini_for_package" EXCLUDE
+ )
+endfunction(AddSharedToComponent)
+
+execute_process(
+ COMMAND clang -print-file-name=libstdc++.so
+ OUTPUT_VARIABLE LIBSTDCPP
+ OUTPUT_STRIP_TRAILING_WHITESPACE
)
+# Add shared files to full and trial version
+AddSharedToComponent(FULLVERSION)
+AddSharedToComponent(TRIALVERSION)
-INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/ide_plugins/vs
+INSTALL(DIRECTORY
+ ${CMAKE_SOURCE_DIR}/ide_plugins/sublime_text
DESTINATION plugin
- PATTERN "vs2012" EXCLUDE
-)
-
-INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/ide_plugins/sublime_text
- DESTINATION plugin
-)
-
-
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/bin/app/data/ApplicationSettings_for_package.xml
- DESTINATION data
- RENAME ApplicationSettings.xml
-)
-
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/setup/Linux/coati.desktop
- DESTINATION .
-)
-
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/bin/app/data/gui/icon/logo_1024_1024.png
- DESTINATION .
- RENAME coati.png
-)
-
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/web/coati_manual.pdf
- DESTINATION .
-)
-
-INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/setup/Linux/lib
- DESTINATION .
+ COMPONENT FULLVERSION
)
INSTALL(FILES
- ${CMAKE_SOURCE_DIR}/setup/Linux/libqxcb.so
- DESTINATION platforms
+ ${CMAKE_SOURCE_DIR}/setup/Linux/coati.desktop
+ ${CMAKE_SOURCE_DIR}/setup/Linux/application-x-coati.xml
+ DESTINATION setup
+ COMPONENT FULLVERSION
)
+
+INSTALL(PROGRAMS
+ ${CMAKE_SOURCE_DIR}/setup/Linux/install.sh
+ ${CMAKE_SOURCE_DIR}/setup/Linux/deinstall.sh
+ ${CMAKE_SOURCE_DIR}/setup/Linux/removeConfigs.sh
+ ${CMAKE_SOURCE_DIR}/setup/Linux/Coati_trial.sh
+ DESTINATION .
+ COMPONENT TRIALVERSION
+)
+
INSTALL(PROGRAMS
${CMAKE_SOURCE_DIR}/setup/Linux/Coati.sh
DESTINATION .
+ COMPONENT FULLVERSION
)
-# INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/setup/Linux/coati
-# DESTINATION bin/
-# )
-# add the automatically determined parts of the RPATH
-# which point to directories outside the build tree to the install RPATH
-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-INSTALL(TARGETS ${APP_PROJECT_NAME}
- DESTINATION .
+INSTALL(PROGRAMS
+ ${CMAKE_SOURCE_DIR}/bin/app/Release/Coati_upx
+ DESTINATION .
+ COMPONENT FULLVERSION
+ RENAME Coati
+)
+
+INSTALL(PROGRAMS
+ ${CMAKE_SOURCE_DIR}/bin/app/Release/Coati_trial_upx
+ DESTINATION .
+ COMPONENT TRIALVERSION
+ RENAME Coati_trial
)
# SET(CPACK_GENERATOR "DEB;TGZ")
@@ -78,16 +150,17 @@ SET(CPACK_ARCHIVE_COMPONENT_INSTALL "ON")
string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" VERSION_MAJOR "${GIT_VERSION_NUMBER}")
string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" VERSION_MINOR "${GIT_VERSION_NUMBER}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" VERSION_PATCH "${GIT_VERSION_NUMBER}")
-set(VERSION_NUMBER "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
+set(VERSION_NUMBER "${VERSION_MAJOR}_${VERSION_MINOR}_${VERSION_PATCH}")
SET(CPACK_PACKAGE_NAME "Coati")
SET(CPACK_PACKAGING_INSTALL_PREFIX "")
+SET(CPACK_PACKAGING_INSTALL_DIRECTORY "Coati")
SET(CPACK_PACKAGE_VERSION ${VERSION_NUMBER})
SET(CPACK_PACKAGE_VENDOR "Coati Software")
-# SET(CPACK_PACKAGE_VERSION ${GIT_VERSION_NUMBER})
-SET(CPACK_PACKAGE_EXECUTABLES "Coati")
+SET(CPACK_INSTALL_SCRIPT "${CMAKE_SOURCE_DIR}/cmake/pre_install_linux.cmake")
+SET(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR}")
+#SET(CPACK_PACKAGE_EXECUTABLES "Coati")
SET(CPACK_STRIP_FILES "coati/Coati")
SET(CPACK_PACKAGE_CONTACT "astallinger@coati.io")
-MESSAGE(STATUS "${CMAKE_SYSTEM}")
INCLUDE(CPack)
diff --git a/cmake/pre_install_linux.cmake b/cmake/pre_install_linux.cmake
new file mode 100644
index 00000000..aeb02126
--- /dev/null
+++ b/cmake/pre_install_linux.cmake
@@ -0,0 +1,11 @@
+
+# upx
+execute_process(
+ COMMAND upx --brute ${CMAKE_CURRENT_LIST_DIR}/../bin/app/Release/Coati -o ${CMAKE_CURRENT_LIST_DIR}/../bin/app/Release/Coati_upx
+)
+
+execute_process(
+ COMMAND upx --brute ${CMAKE_CURRENT_LIST_DIR}/../bin/app/Release/Coati_trial -o
+ ${CMAKE_CURRENT_LIST_DIR}/../bin/app/Release/Coati_trial_upx
+)
+
diff --git a/script/build.sh b/script/build.sh
index 2f376d6f..8a64b809 100755
--- a/script/build.sh
+++ b/script/build.sh
@@ -12,38 +12,38 @@ then
if [ "$2" = "test" ]
then
#echo "release test"
- ninja -C build/Release Coati_test && cd bin/test && Release/Coati_test
+ cmake --build build/Release --target Coati_test && cd bin/test && Release/Coati_test
elif [ "$2" = "trial" ]
then
- ninja -C build/Release Coati_trial && cd bin/app && Release/Coati_trial
+ cmake --build build/Release --target Coati_trial && cd bin/app && Release/Coati_trial
elif [ "$2" = "keygen" ]
then
#echo "release keygen"
- ninja -C build/Release Coati_license_generator && cd bin/license_generator && Release/Coati_license_generator
+ cmake --build build/Release --target Coati_license_generator && cd bin/license_generator && Release/Coati_license_generator
else
#echo "release app"
- ninja -C build/Release Coati && cd bin/app && Release/Coati
+ cmake --build build/Release --target Coati && cd bin/app && Release/Coati
fi
elif [ "$1" = "debug" ] || [ "$1" = "d" ]
then
if [ "$2" = "test" ]
then
#echo "debug test"
- ninja -C build/Debug Coati_test && cd bin/test && Debug/Coati_test
+ cmake --build build/Debug --target Coati_test && cd bin/test && Debug/Coati_test
elif [ "$2" = "trial" ]
then
- ninja -C build/Debug Coati_trial && cd bin/app && Debug/Coati_trial
+ cmake --build build/Debug --target Coati_trial && cd bin/app && Debug/Coati_trial
elif [ "$2" = "keygen" ]
then
#echo "debug keygen"
- ninja -C build/Debug Coati_license_generator && cd bin/license_generator && Debug/Coati_license_generator_d
+ cmake --build build/Debug --target Coati_license_generator && cd bin/license_generator && Debug/Coati_license_generator_d
else
#echo "debug app"
- ninja -C build/Debug Coati && cd bin/app && Debug/Coati
+ cmake --build build/Debug --target Coati && cd bin/app && Debug/Coati
fi
elif [ "$1" = "package" ] || [ "$1" = "p" ]
then
- ninja package -C build/Release Coati
+ cmake --build build/Release --target package
mkdir -p distr && cp build/Release/Coati*.tar.gz distr #&& cp build/Release/Coati*.deb distr
echo "Packages copied into the distr folder"
else
diff --git a/script/buildonly.sh b/script/buildonly.sh
new file mode 100755
index 00000000..bcd7217f
--- /dev/null
+++ b/script/buildonly.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# Determine path to script
+MY_PATH=`dirname "$0"`
+
+cd $MY_PATH/..
+
+# Build target
+
+if [ "$1" = "release" ] || [ "$1" = "r" ]
+then
+ if [ "$2" = "test" ]
+ then
+ #echo "release test"
+ cmake --build build/Release --target Coati_test
+ elif [ "$2" = "trial" ]
+ then
+ cmake --build build/Release --target Coati_trial
+ elif [ "$2" = "keygen" ]
+ then
+ #echo "release keygen"
+ cmake --build build/Release --target Coati_license_generator
+ else
+ #echo "release app"
+ cmake --build build/Release --target Coati
+ fi
+elif [ "$1" = "debug" ] || [ "$1" = "d" ]
+then
+ if [ "$2" = "test" ]
+ then
+ #echo "debug test"
+ cmake --build build/Debug --target Coati_test
+ elif [ "$2" = "trial" ]
+ then
+ cmake --build build/Debug --target Coati_trial
+ elif [ "$2" = "keygen" ]
+ then
+ #echo "debug keygen"
+ cmake --build build/Debug --target Coati_license_generator
+ else
+ #echo "debug app"
+ cmake --build build/Debug --target Coati
+ fi
+elif [ "$1" = "package" ] || [ "$1" = "p" ]
+then
+ cmake --build build/Release --target package
+ mkdir -p distr && cp build/Release/Coati*.tar.gz distr #&& cp build/Release/Coati*.deb distr
+ echo "Packages copied into the distr folder"
+else
+ echo "no arguments: first argument 'release' or 'debug', second argument 'test' for tests"
+fi
diff --git a/setup/Linux/Coati.sh b/setup/Linux/Coati.sh
index f0c15fd2..d2ed7b9a 100755
--- a/setup/Linux/Coati.sh
+++ b/setup/Linux/Coati.sh
@@ -1,11 +1,24 @@
#!/bin/sh
-COATI_PATH=`dirname "$0"`
+# get the current directory
+SOURCE="${0}"
+while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
+ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+ SOURCE="$(readlink "$SOURCE")"
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
+done
+COATI_PATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+
+#setup data folder
+echo $COATI_PATH
if [ ! -d "${HOME}/.config/coati" ]; then
# Control will enter here if $DIRECTORY doesn't exist.
- cp -r $COATI_PATH/coati/data ${HOME}/.config/coati
+ mkdir ${HOME}/.config/coati
+ cp $COATI_PATH/user/* ${HOME}/.config/coati/
echo "First start of Coati from this user, copy default configfiles to ~/.config/coati"
fi
-export LD_LIBRARY_PATH=$COATI_PATH/coati/lib
-cd ~/.config/coati && exec $COATI_PAT/coati/Coati
+export LD_LIBRARY_PATH="$COATI_PATH/lib:LD_LIBRARY_PATH"
+export QT_XKB_CONFIG_ROOT="/usr/share/X11/xkb:$QT_XKB_CONFIG_ROOT"
+export QT_QPA_FONTDIR="$COATI_PATH/data/fonts:$QT_QPA_FONTDIR"
+exec $COATI_PATH/Coati
diff --git a/setup/Linux/Coati_trial.sh b/setup/Linux/Coati_trial.sh
new file mode 100755
index 00000000..5b793f90
--- /dev/null
+++ b/setup/Linux/Coati_trial.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# get the current directory
+SOURCE="${0}"
+while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
+ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+ SOURCE="$(readlink "$SOURCE")"
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
+done
+COATI_PATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+
+#setup data folder
+echo $COATI_PATH
+if [ ! -d "${HOME}/.config/coatitrial" ]; then
+ # Control will enter here if $DIRECTORY doesn't exist.
+ mkdir ${HOME}/.config/coatitrial
+ cp $COATI_PATH/user/* ${HOME}/.config/coatitrial/
+ echo "First start of Coati from this user, copy default configfiles to ~/.config/coati"
+fi
+
+export LD_LIBRARY_PATH="$COATI_PATH/lib:LD_LIBRARY_PATH"
+export QT_XKB_CONFIG_ROOT="/usr/share/X11/xkb:$QT_XKB_CONFIG_ROOT"
+export QT_QPA_FONTDIR="$COATI_PATH/data/fonts:$QT_QPA_FONTDIR"
+exec $COATI_PATH/Coati_trial
+
diff --git a/setup/Linux/RunCoati.sh b/setup/Linux/RunCoati.sh
deleted file mode 100755
index 2fca0b22..00000000
--- a/setup/Linux/RunCoati.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-export LD_LIBRARY_PATH=$PWD/lib
-exec ./Coati
diff --git a/setup/Linux/application-x-coati.xml b/setup/Linux/application-x-coati.xml
new file mode 100644
index 00000000..791b5b43
--- /dev/null
+++ b/setup/Linux/application-x-coati.xml
@@ -0,0 +1,14 @@
+
+
+
+ Coati Project File
+
+
+
+
+
+ Coati Database
+
+
+
+
diff --git a/setup/Linux/coati.desktop b/setup/Linux/coati.desktop
index e017b71f..2d3cf7f5 100644
--- a/setup/Linux/coati.desktop
+++ b/setup/Linux/coati.desktop
@@ -3,7 +3,7 @@ Name=Coati
GenericName=Coati
X-GNOME-FullName=Coati
Comment=Code Explorer
-Exec=/usr/local/bin/coati
+Exec=/usr/bin/coati
Icon=coati
Terminal=true
Type=Application
diff --git a/setup/Linux/deinstall.sh b/setup/Linux/deinstall.sh
new file mode 100755
index 00000000..34478e43
--- /dev/null
+++ b/setup/Linux/deinstall.sh
@@ -0,0 +1,18 @@
+
+MY_PATH=`dirname "$0"`
+MY_PATH=../$MY_PATH
+
+echo "Remove coati form system"
+printf 'enter [y/n] '
+read ans
+case ${ans:=y} in [yY]*) ;; *) exit ;; esac
+
+echo "Run this script as root"
+
+rm /usr/bin/Coati
+rm /usr/share/mime/packages/application-x-coatiproject
+rm /usr/share/applications/coati.desktop
+rm /usr/share/icons/coati.png
+rm /usr/share/icons/project-coati.png
+update-mime/database /usr/share/mime
+
diff --git a/setup/Linux/install.sh b/setup/Linux/install.sh
index 2508037f..c40ed9d0 100755
--- a/setup/Linux/install.sh
+++ b/setup/Linux/install.sh
@@ -1 +1,19 @@
-sudo ln -s ./Coati /bin/Coati
+
+MY_PATH=`dirname "$0"`
+MY_PATH=../$MY_PATH
+
+cat EULA.txt
+echo "Agree to the EULA"
+printf 'enter [y/n] '
+read ans
+case ${ans:=y} in [yY]*) ;; *) exit ;; esac
+
+echo "Run this script as root"
+
+ln -s $MY_PATH/Coati.sh /usr/bin/Coati
+cp $MY_PATH/setup/application-x-coatiproject /usr/share/mime/packages
+cp $MY_PATH/setup/coati.desktop /usr/share/applications/
+cp $MY_PATH/data/gui/icon/logo_1024_1024.png /usr/share/icon/coati.png
+cp $MY_PATH/data/gui/icon/project_256_256.png /usr/share/icons/project-coati.png
+update-mime-database /usr/share/mime
+
diff --git a/setup/Linux/libqxcb.so b/setup/Linux/libqxcb.so
deleted file mode 100755
index 8af7d7de..00000000
Binary files a/setup/Linux/libqxcb.so and /dev/null differ
diff --git a/setup/Linux/removeConfigs.sh b/setup/Linux/removeConfigs.sh
new file mode 100755
index 00000000..538878ca
--- /dev/null
+++ b/setup/Linux/removeConfigs.sh
@@ -0,0 +1,10 @@
+
+MY_PATH=`dirname "$0"`
+
+echo "Are you sure to delete your coait configs"
+printf 'enter [y/n] '
+read ans
+case ${ans:=y} in [yY]*) ;; *) exit ;; esac
+
+rm -rf ~/.config/coati
+
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 54ebe450..fef45828 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -41,6 +41,10 @@ int main(int argc, char *argv[])
Version version = Version::fromString(GIT_VERSION_NUMBER);
QApplication::setApplicationVersion(version.toDisplayString().c_str());
+ if(AppPath::getAppPath().empty())
+ {
+ AppPath::setAppPath(QCoreApplication::applicationDirPath().toStdString());
+ }
setup(argc, argv);
QtApplication qtApp(argc, argv);
@@ -55,11 +59,6 @@ int main(int argc, char *argv[])
QtViewFactory viewFactory;
QtNetworkFactory networkFactory;
- if(AppPath::getAppPath().empty())
- {
- AppPath::setAppPath(QCoreApplication::applicationDirPath().toStdString());
- }
-
LicenseChecker checker;
std::shared_ptr app = Application::create(version, &viewFactory, &networkFactory);
diff --git a/src/lib/utility/file/FileSystem.cpp b/src/lib/utility/file/FileSystem.cpp
index 59199580..77592881 100644
--- a/src/lib/utility/file/FileSystem.cpp
+++ b/src/lib/utility/file/FileSystem.cpp
@@ -164,6 +164,16 @@ void FileSystem::createDirectory(const FilePath& path)
boost::filesystem::create_directories(path.str());
}
+bool FileSystem::copy_directory(const FilePath& from, const FilePath& to)
+{
+ if(!from.exists() || to.exists())
+ {
+ return false;
+ }
+ boost::filesystem::copy_directory(boost::filesystem::path(from.str()),boost::filesystem::path(to.str()));
+ return true;
+}
+
std::vector FileSystem::getSubDirectories(const FilePath &path)
{
std::vector v;
diff --git a/src/lib/utility/file/FileSystem.h b/src/lib/utility/file/FileSystem.h
index e416d8b3..c6656ab4 100644
--- a/src/lib/utility/file/FileSystem.h
+++ b/src/lib/utility/file/FileSystem.h
@@ -30,6 +30,8 @@ public:
static std::string fileName(const std::string& path);
static std::string absoluteFilePath(const std::string& path);
+ static bool copy_directory(const FilePath& from, const FilePath& to);
+
static std::string extension(const std::string& path);
static std::string filePathWithoutExtension(const std::string& path);
static bool hasExtension(const std::string& filepath, const std::vector& extensions);
diff --git a/src/lib/utility/solution/SolutionParserVisualStudio.cpp b/src/lib/utility/solution/SolutionParserVisualStudio.cpp
index 0f3dd782..71ee46c0 100644
--- a/src/lib/utility/solution/SolutionParserVisualStudio.cpp
+++ b/src/lib/utility/solution/SolutionParserVisualStudio.cpp
@@ -407,7 +407,6 @@ TiXmlElement* SolutionParserVisualStudio::getFirstTagByName(TiXmlElement* root,
{
if (element == NULL)
{
- int foo = 0;
}
std::string value = element->Value();
@@ -432,7 +431,6 @@ TiXmlElement* SolutionParserVisualStudio::getFirstTagByName(TiXmlElement* root,
{
if (element == NULL)
{
- int foo = 0;
}
while (element->Parent()->ToElement() != NULL && element->Parent()->NextSiblingElement() == NULL)
@@ -441,7 +439,6 @@ TiXmlElement* SolutionParserVisualStudio::getFirstTagByName(TiXmlElement* root,
if (newElement == NULL)
{
- int foo = 0;
}
element = newElement;
@@ -487,7 +484,6 @@ std::vector SolutionParserVisualStudio::getAllTagsByName(TiXmlEle
{
if (element == NULL)
{
- int foo = 0;
}
while (element->Parent()->ToElement() != NULL && element->Parent()->NextSiblingElement() == NULL)
@@ -496,7 +492,6 @@ std::vector SolutionParserVisualStudio::getAllTagsByName(TiXmlEle
if (newElement == NULL)
{
- int foo = 0;
}
element = newElement;
@@ -523,7 +518,6 @@ TiXmlElement* SolutionParserVisualStudio::getFirstTagByNameWithAttribute(TiXmlEl
{
if (element == NULL)
{
- int foo = 0;
}
std::string value = element->Value();
@@ -700,4 +694,4 @@ std::vector SolutionParserVisualStudio::makePathsCanonical(const st
}
return canonicalPaths;
-}
\ No newline at end of file
+}
diff --git a/src/lib_gui/CMakeLists.txt b/src/lib_gui/CMakeLists.txt
index 3dba4b6d..c699b8f8 100644
--- a/src/lib_gui/CMakeLists.txt
+++ b/src/lib_gui/CMakeLists.txt
@@ -2,7 +2,7 @@ add_files(
LIB_GUI_FILES
platform_includes/deploy.h
- platform_includes/includesDefault.h
+ platform_includes/includesLinux.h
platform_includes/includesMac.h
platform_includes/includesWindows.h
diff --git a/src/lib_gui/platform_includes/includesDefault.h b/src/lib_gui/platform_includes/includesDefault.h
deleted file mode 100644
index 26dce417..00000000
--- a/src/lib_gui/platform_includes/includesDefault.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef INCLUDES_DEFAULT_H
-#define INCLUDES_DEFAULT_H
-
-#include "utility/UserPaths.h"
-
-void setup(int argc, char *argv[])
-{
- std::string userdir(std::getenv("HOME"));
- userdir.append("/.config/coati/");
- UserPaths::setUserDataPath(userdir);
-}
-
-#endif // INCLUDES_DEFAULT_H
\ No newline at end of file
diff --git a/src/lib_gui/platform_includes/includesLinux.h b/src/lib_gui/platform_includes/includesLinux.h
new file mode 100644
index 00000000..45db9064
--- /dev/null
+++ b/src/lib_gui/platform_includes/includesLinux.h
@@ -0,0 +1,31 @@
+#ifndef INCLUDES_DEFAULT_H
+#define INCLUDES_DEFAULT_H
+
+#include "utility/AppPath.h"
+#include "utility/UserPaths.h"
+#include "utility/file/FilePath.h"
+#include "utility/file/FileSystem.h"
+#include "isTrial.h"
+
+void setup(int argc, char *argv[])
+{
+ std::string userdir(std::getenv("HOME"));
+ if(isTrial())
+ {
+ userdir.append("/.config/coatitrial/");
+ }
+ else
+ {
+ userdir.append("/.config/coati/");
+ }
+ UserPaths::setUserDataPath(userdir);
+ FilePath userDataPath(userdir);
+ //copy default user folder to .config/coati if it does not exist
+ if (!userDataPath.exists())
+ {
+ FilePath from(AppPath::getAppPath() + "user");
+ FileSystem::copy_directory(from, userDataPath);
+ }
+}
+
+#endif // INCLUDES_DEFAULT_H
diff --git a/src/license_generator/main.cpp b/src/license_generator/main.cpp
index dc649376..ab596e70 100644
--- a/src/license_generator/main.cpp
+++ b/src/license_generator/main.cpp
@@ -63,7 +63,6 @@ bool process_command_line(int argc, char** argv)
if(vm.count("generate"))
{
- bool fail = false;
if(!vm.count("version"))
{
std::cout << "Version of Coati is needed to generate a License" << std::endl;