From: minkee.lee Date: Wed, 20 Aug 2014 13:55:25 +0000 (+0900) Subject: Build: Applied launch4j to generate emulator-manager.exe X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb824b72aead0f959bb30462bbb96c308e887810;p=sdk%2Femulator%2Femulator-manager.git Build: Applied launch4j to generate emulator-manager.exe - Existing emulator-manager.exe has some problem with malware, so I changed to use Launch4j to generate emulator-manager.exe. Launch4j runs on DIBS. If you perform a local build, you can skip Launch4j by setting environment variable 'EM_EXE_GEN' as 'false'. Change-Id: Ia3c2b6ccb333eac32e09159362d28c19cc72aec6 Signed-off-by: minkee.lee --- diff --git a/common-project/supplement/em-wrapper-config.xml b/common-project/supplement/em-wrapper-config.xml new file mode 100644 index 0000000..2ea1c43 --- /dev/null +++ b/common-project/supplement/em-wrapper-config.xml @@ -0,0 +1,30 @@ + + + true + gui + emulator-manager.jar + ..\..\emulator-manager.exe + + + + normal + http://java.com/download + + false + + ..\resource\res\em.ico + + org.tizen.emulator.manager.EmulatorManager + swt.jar + jsch-0.1.50.jar + protobuf.jar + + + + false + 1.6.0 + + preferJre + 64/32 + + diff --git a/common-project/supplement/genExe.sh b/common-project/supplement/genExe.sh new file mode 100755 index 0000000..385a8a8 --- /dev/null +++ b/common-project/supplement/genExe.sh @@ -0,0 +1,22 @@ +#!/bin/bash +LAUNCH4J_RUN=0 +LAUNCH4J_NOT_FOUND=1 +SKIP_EXE=2 + +if [ "$EM_EXE_GEN" = "false" ] ; then + echo "Skip generating emulator-manager.exe..." + exit $SKIP_EXE +fi + +if [ "`which launch4jc 2>/dev/null`" ] ; then + echo "Launch4j found. Make emulator-manager.exe ..." + launch4jc $1 + exit $LAUNCH4J_RUN +else + echo "Launch4j not found. Build will be stop..." + echo " -- Please install launch4j and add to path." + echo " -- Or, if you want to skip generating EXE, set 'EM_EXE_GEN' as 'false'" + echo " -- ex) $ export EM_EXE_GEN=false" + echo "And try build again." + exit $LAUNCH4J_NOT_FOUND +fi diff --git a/package/build.windows b/package/build.windows index 36dc1af..6d0ef68 100755 --- a/package/build.windows +++ b/package/build.windows @@ -35,28 +35,53 @@ build() #$ANT_PATH/ant -buildfile plugin-project/mobile-plugin/build.xml -Dclasspath.dibs=${ROOTDIR}/tools/emulator/bin -Dem.dir=${SRCDIR}/common-project make-jar-dibs #$ANT_PATH/ant -buildfile plugin-project/ivi-plugin/build.xml -Dclasspath.dibs=${ROOTDIR}/tools/emulator/bin -Dem.dir=${SRCDIR}/common-project make-jar-dibs - echo 'id ICON "common-project/resource/res/em.ico"' > icon.rc - windres icon.rc -O coff -o icon.res - gcc $SRCDIR/common-project/supplement/emulator-manager.c icon.res -o $SRCDIR/emulator-manager.exe -mwindows - rm icon.rc icon.res - - # Add signing to emulator-manager.exe - java -jar $SIGNTOOL_JAR $SRCDIR/emulator-manager.exe $SRCDIR/emulator-manager.exe emulator-manager.exe - if [ ! -f "$SRCDIR/emulator-manager.exe" ]; then - echo "Codesigning fail" - exit 1 - fi - - cd $SRCDIR - /C/sign/signtool.exe verify "//pa" "emulator-manager.exe" - CODESIGN_RET=$? - echo $CODESIGN_RET - if [ "$CODESIGN_RET" = "0" ]; then - echo "The signature is vaild" - else - echo "The signature is invalid : return value = $CODESIGN_RET" - exit 1 - fi + #echo 'id ICON "common-project/resource/res/em.ico"' > icon.rc + #windres icon.rc -O coff -o icon.res + #gcc $SRCDIR/common-project/supplement/emulator-manager.c icon.res -o $SRCDIR/emulator-manager.exe -mwindows + #rm icon.rc icon.res + + # make emulator-manager.exe with Launch4j + LAUNCH4J_RUN=0 + LAUNCH4J_NOT_FOUND=1 + SKIP_EXE=2 + common-project/supplement/genExe.sh common-project/supplement/em-wrapper-config.xml + RET=$? + if [ "$RET" = "$LAUNCH4J_NOT_FOUND" ]; then + echo "Launch4j not found. Exit." + exit 1 + fi + + if [ "$RET" = "$SKIP_EXE" ]; then + echo "Skip add signing to emulator-manager.exe ..." + fi + + if [ "$RET" = "$LAUNCH4J_RUN" ]; then + if [ ! -f "emulator-manager.exe" ]; then + echo "Generating emulator-manager.exe FAILED.." + exit 1 + else + echo "Generating emulator-manager.exe SUCCESS." + # Add signing to emulator-manager.exe + java -jar $SIGNTOOL_JAR $SRCDIR/emulator-manager.exe $SRCDIR/emulator-manager.exe emulator-manager.exe + if [ ! -f "$SRCDIR/emulator-manager.exe" ]; then + echo "Codesigning fail" + exit 1 + fi + + cd $SRCDIR + /C/sign/signtool.exe verify "//pa" "emulator-manager.exe" + CODESIGN_RET=$? + echo $CODESIGN_RET + if [ "$CODESIGN_RET" = "0" ]; then + echo "The signature is vaild" + else + echo "The signature is invalid : return value = $CODESIGN_RET" + exit 1 + fi + fi + fi + + # if [ "$SIGNTOOL_PATH" != "" ] && [ -f "$SIGNTOOL_PATH" ] # then # if [ "$SIGNFILE_PATH" != "" ] && [ -f "$SIGNFILE_PATH" ]