build: windows deploy

* implemented a new deploy script for windows
* created a new setup project for the Coati Trail
This commit is contained in:
malte_langkabel
2016-02-24 10:52:24 +01:00
parent 64ffafffa8
commit 4dabe31776
45 changed files with 7259 additions and 943 deletions
+187
View File
@@ -0,0 +1,187 @@
# FLAGS
REBUILD=false
OBFUSCATE=false
# 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/..
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 plugins?"
read -p "Press [Enter] key to continue"
echo -e "$INFO Are the Visual Studio plugins 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
# 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 EXECUTABLES
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
echo -e "$INFO building the executable (trail)"
"D:/programme/Microsoft Visual Studio14/Common7/IDE/devenv.com" build/Coati.sln //build Release //project build/Coati_trial.vcxproj
# CREATING TRAIL DATABASES´
echo -e "$INFO creating databases for trail"
rm bin/app/data/projects/tictactoe/tictactoe.coatidb
rm bin/app/data/projects/tutorial/tutorial.coatidb
rm -rf temp
mkdir -p temp
cd temp
../bin/app/Release/Coati.exe -p ../bin/app/data/projects/tictactoe/tictactoe.coatiproject
echo -e "$INFO Please wait until Coati created the database for tictactoe."
read -p "Press [Enter] key to continue"
../bin/app/Release/Coati.exe -p ../bin/app/data/projects/tutorial/tutorial.coatiproject
echo -e "$INFO Please wait until Coati created the database for tutorial."
read -p "Press [Enter] key to continue"
cd ..
rm -rf temp
# OBFUSCATING THE EXECUTABLES
if [ $OBFUSCATE = true ]; then
echo -e "$INFO obfuscating the executables"
rm bin/app/Release/Coati_obfuscated.exe
rm bin/app/Release/Coati_trial_obfuscated.exe
upx --brute -o bin/app/Release/Coati_obfuscated.exe bin/app/Release/Coati.exe
upx --brute -o bin/app/Release/Coati_trial_obfuscated.exe bin/app/Release/Coati_trial.exe
else
cp bin/app/Release/Coati.exe bin/app/Release/Coati_obfuscated.exe
cp bin/app/Release/Coati_trial.exe bin/app/Release/Coati_trial_obfuscated.exe
fi
# BUILDING THE INSTALLERS
echo -e "$INFO building the installer (app)"
"D:/programme/Microsoft Visual Studio 12/Common7/IDE/devenv.com" deployment/windows/CoatiAppSetup/CoatiAppSetup.sln //build Release //project deployment/windows/CoatiAppSetup/CoatiSetup/CoatiSetup.vdproj
echo -e "$INFO building the installer (trail)"
"D:/programme/Microsoft Visual Studio 12/Common7/IDE/devenv.com" deployment/windows/CoatiTrialSetup/CoatiTrialSetup.sln //build Release //project deployment/windows/CoatiTrialSetup/CoatiSetup/CoatiSetup.vdproj
# EDIT THE INSTALLERS
echo -e "$INFO Please edit the msi files of the installers"
read -p "Press [Enter] key to continue"
# CREATING PACKAGE FOLDERS (APP)
VERSION_STRING=$(git describe)
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 folders for app"
rm -rf $APP_PACKAGE_DIR
mkdir -p $APP_PACKAGE_DIR
cp -u -r deployment/windows/CoatiAppSetup/CoatiSetup/Release/Coati.msi $APP_PACKAGE_DIR/
cp -u -r deployment/windows/CoatiAppSetup/CoatiSetup/Release/setup.exe $APP_PACKAGE_DIR/
mkdir -p $APP_PACKAGE_DIR/plugins/visual_studio/
cp -u -r ide_plugins/vs/coati_plugin_vs_2012.vsix $APP_PACKAGE_DIR/plugins/visual_studio/
cp -u -r ide_plugins/vs/coati_plugin_vs_2013.vsix $APP_PACKAGE_DIR/plugins/visual_studio/
cp -u -r ide_plugins/vs/coati_plugin_vs_2015.vsix $APP_PACKAGE_DIR/plugins/visual_studio/
mkdir -p $APP_PACKAGE_DIR/plugins/sublime_text/
cp -u -r ide_plugins/sublime_text/* $APP_PACKAGE_DIR/plugins/sublime_text/
# PACKAGING COATI (APP)
echo -e "$INFO packaging coati app"
cd ./release/
winrar a -afzip ${APP_PACKAGE_NAME}_Windows.zip $APP_PACKAGE_NAME
cd ../
# CLEANING UP (APP)
echo -e "$INFO Cleaning up app"
rm -rf $APP_PACKAGE_DIR
# CREATING PACKAGE FOLDERS (TRIAL)
TRIAL_PACKAGE_NAME=Coati_Trail_${VERSION_STRING}
TRIAL_PACKAGE_DIR=release/$TRIAL_PACKAGE_NAME
echo -e "$INFO creating package folders for trail"
rm -rf $TRIAL_PACKAGE_DIR
mkdir -p $TRIAL_PACKAGE_DIR
cp -u -r deployment/windows/CoatiTrialSetup/CoatiSetup/Release/CoatiTrial.msi $TRIAL_PACKAGE_DIR/
cp -u -r deployment/windows/CoatiTrialSetup/CoatiSetup/Release/setup.exe $TRIAL_PACKAGE_DIR/
mkdir -p $TRIAL_PACKAGE_DIR/plugins/visual_studio/
cp -u -r ide_plugins/vs/coati_plugin_vs_2012.vsix $TRIAL_PACKAGE_DIR/plugins/visual_studio/
cp -u -r ide_plugins/vs/coati_plugin_vs_2013.vsix $TRIAL_PACKAGE_DIR/plugins/visual_studio/
cp -u -r ide_plugins/vs/coati_plugin_vs_2015.vsix $TRIAL_PACKAGE_DIR/plugins/visual_studio/
mkdir -p $TRIAL_PACKAGE_DIR/plugins/sublime_text/
cp -u -r ide_plugins/sublime_text/* $TRIAL_PACKAGE_DIR/plugins/sublime_text/
# PACKAGING COATI (TRIAL)
echo -e "$INFO packaging coati trail"
cd ./release/
winrar a -afzip ${TRIAL_PACKAGE_NAME}_Windows.zip $TRIAL_PACKAGE_NAME
cd ../
# CLEANING UP (TRIAL)
echo -e "$INFO Cleaning up trail"
rm -rf $TRIAL_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!"
-99
View File
@@ -1,99 +0,0 @@
#!/bin/bash
ABORT="\033[31mAbort:\033[00m"
SUCCESS="\033[32mSuccess:\033[00m"
INFO="\033[33mInfo:\033[00m"
read -r -p "Is your current release build up to date? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
;;
*)
echo -e $ABORT "Aborting the creation of a release package."
exit 1
;;
esac
read -r -p "Did you update the manual pdf? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
;;
*)
echo -e $ABORT "Aborting the creation of a release package."
exit 1
;;
esac
ORIGINAL_PATH_TO_SCRIPT="${0}"
CLEANED_PATH_TO_SCRIPT="${ORIGINAL_PATH_TO_SCRIPT//\\//}"
BASE_DIR=`dirname "$CLEANED_PATH_TO_SCRIPT"`
cd $BASE_DIR/..
VERSION_STRING=$(git describe)
VERSION_STRING="${VERSION_STRING//-/_}"
VERSION_STRING="${VERSION_STRING//./_}"
VERSION_STRING="${VERSION_STRING%_*}"
PACKAGE_NAME=Coati_${VERSION_STRING}
echo -e $INFO Creating Package with Name: $PACKAGE_NAME
PACKAGE_DIR=release/$PACKAGE_NAME
echo -e $INFO Creating Folders
rm -rf $PACKAGE_DIR
mkdir -p $PACKAGE_DIR
mkdir -p $PACKAGE_DIR/data/color_schemes/
cp -u -r bin/app/data/color_schemes/* $PACKAGE_DIR/data/color_schemes/
mkdir -p $PACKAGE_DIR/data/fonts/
cp -u -r bin/app/data/fonts/* $PACKAGE_DIR/data/fonts/
mkdir -p $PACKAGE_DIR/data/gui/
cp -u -r bin/app/data/gui/* $PACKAGE_DIR/data/gui/
mkdir -p $PACKAGE_DIR/data/log/
mkdir -p $PACKAGE_DIR/data/projects/tutorial/src/
cp -u -r bin/app/data/projects/tutorial/src/* $PACKAGE_DIR/data/projects/tutorial/src/
cp -u -r bin/app/data/projects/tutorial/tutorial.xml $PACKAGE_DIR/data/projects/tutorial/
mkdir -p $PACKAGE_DIR/data/projects/tictactoe/src/
cp -u -r bin/app/data/projects/tictactoe/src/* $PACKAGE_DIR/data/projects/tictactoe/src/
cp -u -r bin/app/data/projects/tictactoe/tictactoe.xml $PACKAGE_DIR/data/projects/tictactoe/
cp -u -r bin/app/data/ApplicationSettings_for_package.xml $PACKAGE_DIR/data/ApplicationSettings.xml
cp -u -r bin/app/data/window_settings.ini $PACKAGE_DIR/data/
mkdir -p $PACKAGE_DIR/plugins/visual_studio/
cp -u -r ide_plugins/vs/coati_plugin_vs_2012.vsix $PACKAGE_DIR/plugins/visual_studio/
cp -u -r ide_plugins/vs/coati_plugin_vs_2013.vsix $PACKAGE_DIR/plugins/visual_studio/
cp -u -r ide_plugins/vs/coati_plugin_vs_2015.vsix $PACKAGE_DIR/plugins/visual_studio/
mkdir -p $PACKAGE_DIR/plugins/sublime_text/
cp -u -r ide_plugins/sublime_text/* $PACKAGE_DIR/plugins/sublime_text/
cp -u -r web/coati_manual.pdf $PACKAGE_DIR/
cp -u -r bin/app/Release/Coati.exe $PACKAGE_DIR/
cp -u -r setup/dynamic_libraries/windows/app/Release/* $PACKAGE_DIR/
read -r -p "Do you want to obfuscate the executable? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
echo -e $INFO Obfuscating Executable
upx --brute $PACKAGE_DIR/Coati.exe
;;
*)
echo -e $INFO Skipping Obfuscation
;;
esac
echo -e $INFO Packaging Coati
cd ./release/
winrar a -afzip ${PACKAGE_NAME}_Windows.zip $PACKAGE_NAME
cd ../
echo -e $INFO Cleaning up
rm -rf $PACKAGE_DIR
echo -e $SUCCESS Packaging Complete!