Files
Sourcetrail/script/deploy_windows.sh
T
malte_langkabel 3b7baba24b build: merge Coati app and Trial to single executable
* removed trial target
* updated deploy scripts to exclude trial
* cleanup CMakeLists
* removed Eigen dependencies
* split parser lib into lib_cxx and lib_java
* added ProjectFactory and ProjectFactoryModules
* removed old installer projects
* updated wix installer
  * updated readme for wix setup
  * updated to use obfuscated exe
  * added qt.conf
  * added indexing dialog images
  * added jars
  * added coatidb files of sample projects
  * added source code of javaparser sample
  * removed auto-refresh image
  * intermediate files of windows installer are created in build folder
  * preselected desktop shortcut
  * build bat is executed from deploy_windows script
2016-09-16 12:45:00 +02:00

175 lines
4.3 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# FLAGS
REBUILD=true
OBFUSCATE=true
# USEFUL VARIABLES
ABORT="\033[31mAbort:\033[00m"
SUCCESS="\033[32mSuccess:\033[00m"
INFO="\033[33mInfo:\033[00m"
ORIGINAL_PATH_TO_SCRIPT="${0}"
CLEANED_PATH_TO_SCRIPT="${ORIGINAL_PATH_TO_SCRIPT//\\//}"
BASE_DIR=`dirname "$CLEANED_PATH_TO_SCRIPT"`
cd $BASE_DIR/..
if [ $REBUILD = false ]; then
echo -e "$INFO REBUILD flag is set to false. Do you want to proceed?"
read -p "Press [Enter] key to continue"
fi
if [ $OBFUSCATE = false ]; then
echo -e "$INFO OBFUSCATE flag is set to false. Do you want to proceed?"
read -p "Press [Enter] key to continue"
fi
echo -e "$INFO Did you set the correct version number for the installers?"
read -p "Press [Enter] key to continue"
echo -e "$INFO Did you set the correct version number for the Visual Studio plugin?"
read -p "Press [Enter] key to continue"
echo -e "$INFO Is the Visual Studio plugin up to date?"
read -p "Press [Enter] key to continue"
# SETTING THE DEPLOY FLAG
rm -rf src/lib_gui/platform_includes/deploy.h
echo "#define DEPLOY" >src/lib_gui/platform_includes/deploy.h
### TODO: RUN CMAKE!
### TODO: add HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\MSBuild\EnableOutOfProcBuild
# CLEANING THE PROJECT
if [ $REBUILD = true ]; then
echo -e "$INFO cleaning the project"
"D:/programme/Microsoft Visual Studio14/Common7/IDE/devenv.com" build/Coati.sln //clean Release
fi
# BUILDING THE EXECUTABLE
echo -e "$INFO building the executable (app)"
"D:/programme/Microsoft Visual Studio14/Common7/IDE/devenv.com" build/Coati.sln //build Release //project build/Coati.vcxproj
# CREATING TRAIL DATABASES´
echo -e "$INFO creating databases"
rm bin/app/data/projects/tictactoe/tictactoe.coatidb
rm bin/app/data/projects/tutorial/tutorial.coatidb
rm bin/app/data/projects/javaparser/javaparser.coatidb
rm -rf temp
mkdir -p temp
cd temp
echo -e "$INFO saving license key"
../bin/app/Release/Coati.exe -z ../script/license.txt
echo -e "$INFO creating database for tictactie"
../bin/app/Release/Coati.exe -p ../bin/app/data/projects/tictactoe/tictactoe.coatiproject -d
echo -e "$INFO creating database for tutorial"
../bin/app/Release/Coati.exe -p ../bin/app/data/projects/tutorial/tutorial.coatiproject -d
echo -e "$INFO creating database for javaparser"
../bin/app/Release/Coati.exe -p ../bin/app/data/projects/javaparser/javaparser.coatiproject -d
cd ..
rm -rf temp
# OBFUSCATING THE EXECUTABLE
if [ $OBFUSCATE = true ]; then
echo -e "$INFO obfuscating the executables"
rm bin/app/Release/Coati_obfuscated.exe
upx --brute -o bin/app/Release/Coati_obfuscated.exe bin/app/Release/Coati.exe
else
cp bin/app/Release/Coati.exe bin/app/Release/Coati_obfuscated.exe
fi
# BUILDING THE INSTALLER
cd deployment/windows/wixSetup
build.bat
cd ../../..
# CREATING PACKAGE FOLDER
VERSION_STRING=$(git describe --long)
VERSION_STRING="${VERSION_STRING//-/_}"
VERSION_STRING="${VERSION_STRING//./_}"
VERSION_STRING="${VERSION_STRING%_*}"
APP_PACKAGE_NAME=Coati_${VERSION_STRING}
APP_PACKAGE_DIR=release/$APP_PACKAGE_NAME
echo -e "$INFO creating package folder"
rm -rf $APP_PACKAGE_DIR
mkdir -p $APP_PACKAGE_DIR
cp -u -r deployment/windows/wixSetup/bin/Coati.msi $APP_PACKAGE_DIR/
cp -u -r deployment/windows/wixSetup/bin/setup.exe $APP_PACKAGE_DIR/
mkdir -p $APP_PACKAGE_DIR/plugins/atom/
cp -u -r ide_plugins/atom/* $APP_PACKAGE_DIR/plugins/atom/
mkdir -p $APP_PACKAGE_DIR/plugins/eclipse/
cp -u -r ide_plugins/eclipse/* $APP_PACKAGE_DIR/plugins/eclipse/
mkdir -p $APP_PACKAGE_DIR/plugins/emacs/
cp -u -r ide_plugins/emacs/* $APP_PACKAGE_DIR/plugins/emacs/
mkdir -p $APP_PACKAGE_DIR/plugins/idea/
cp -u -r ide_plugins/idea/* $APP_PACKAGE_DIR/plugins/idea/
mkdir -p $APP_PACKAGE_DIR/plugins/sublime_text/
cp -u -r ide_plugins/sublime_text/* $APP_PACKAGE_DIR/plugins/sublime_text/
mkdir -p $APP_PACKAGE_DIR/plugins/vim/
cp -u -r ide_plugins/vim/* $APP_PACKAGE_DIR/plugins/vim/
mkdir -p $APP_PACKAGE_DIR/plugins/visual_studio/
cp -u -r ide_plugins/vs/coati_plugin_vs.vsix $APP_PACKAGE_DIR/plugins/visual_studio/
# PACKAGING COATI
echo -e "$INFO packaging coati"
cd ./release/
winrar a -afzip ${APP_PACKAGE_NAME}_Windows.zip $APP_PACKAGE_NAME
cd ../
# CLEANING UP
echo -e "$INFO Cleaning"
rm -rf $APP_PACKAGE_DIR
# UNSETTING THE DEPLOY FLAG
rm -rf src/lib_gui/platform_includes/deploy.h
echo "// #define DEPLOY" >src/lib_gui/platform_includes/deploy.h
echo -e "$SUCCESS packaging complete!"