Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cellframe/prod_build_cellframe-dashboard
1 result
Show changes
Showing
with 47 additions and 560 deletions
HOST_ARCH_VERSIONS="amd64"
PACKAGE_PATH=/home/gitlab-runner/production-docker/builds/winexecs
BRAND="Cellframe-Dashboard"
; ***************************************************************
; * Authors:
; * Konstantin Papizh <papizh.konstantin@demlabs.net>
; * DeM Labs Inc. https://demlabs.net
; * Cellframe Project https://gitlab.demlabs.net/cellframe
; * Copyright (c) 2020
; * All rights reserved.
; ***************************************************************
!define MULTIUSER_EXECUTIONLEVEL Admin
;!include "MultiUser.nsh"
!include "MUI2.nsh"
!include "x64.nsh"
Unicode true
!include "Nsis.defines.nsh"
!include "modifyConfig.nsh"
!define MUI_ICON "icon_win32.ico"
!define MUI_UNICON "icon_win32.ico"
!define NODE_NAME "cellframe-node"
!define EXE_NAME "${APP_NAME}.exe"
!define PUBLISHER "Cellframe Network"
!define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
!define MUI_COMPONENTSPAGE_TEXT_TOP ""
var FLAG_CHAIN_DB_CLEAR
Name "${APP_NAME}"
OutFile "${APP_NAME} ${APP_VER}.exe"
BrandingText "${APP_NAME} by ${PUBLISHER}"
!define MUI_FINISHPAGE_NOAUTOCLOSE
Var CommonDocuments
Var ConfigPath
VIAddVersionKey "ProductName" "${APP_NAME}"
VIAddVersionKey "CompanyName" "${PUBLISHER}"
VIAddVersionKey "LegalCopyright" "${PUBLISHER} 2022"
VIAddVersionKey "FileDescription" "Cellframe Dashboard Application"
VIAddVersionKey "FileVersion" "${APP_VER}"
VIAddVersionKey "ProductVersion" "${APP_VER}"
VIProductVersion "${APP_VERSION}"
Function .onInit
${If} ${RunningX64}
${EnableX64FSRedirection}
SetRegView 64
${else}
MessageBox MB_OK "${APP_NAME} supports x64 architectures only"
Abort
${EndIf}
ReadRegStr $CommonDocuments HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common Documents"
StrCpy $ConfigPath "$CommonDocuments\${NODE_NAME}"
FunctionEnd
Function UninstPrev
ReadRegStr $R0 HKLM "${UNINSTALL_PATH}" "UninstallString"
${If} $R0 == ""
Goto Fin
${EndIf}
DetailPrint "Uninstall older version"
ExecWait '"$R0" /S'
Fin:
FunctionEnd
Function clearDBandChains
StrCpy $FLAG_CHAIN_DB_CLEAR "true"
${If} $FLAG_CHAIN_DB_CLEAR == "true"
RMDir /r "$ConfigPath\var\lib\network"
RMDir /r "$ConfigPath\var\lib\global_db"
${EndIf}
FunctionEnd
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Russian"
LangString MsgBoxText ${LANG_ENGLISH} "Update network configurations?"
LangString MsgBoxText ${LANG_RUSSIAN} "Update network configurations?"
!macro varPaths
IfFileExists "$ConfigPath\var\log" yesLog 0
CreateDirectory "$ConfigPath\var\log"
yesLog:
IfFileExists "$ConfigPath\var\lib\global_db" yesDb 0
CreateDirectory "$ConfigPath\var\lib\global_db"
yesDb:
IfFileExists "$ConfigPath\var\lib\wallet" yesWallet 0
CreateDirectory "$ConfigPath\var\lib\wallet"
yesWallet:
IfFileExists "$ConfigPath\var\lib\ca" yesCa 0
CreateDirectory "$ConfigPath\var\lib\ca"
yesCa:
IfFileExists "$ConfigPath\log" yesDashLog 0
CreateDirectory "$CommonDocuments\${APP_NAME}\log"
yesDashLog:
IfFileExists "$ConfigPath\data" yesDashData 0
CreateDirectory "$CommonDocuments\${APP_NAME}\data"
yesDashData:
IfFileExists "$ConfigPath\etc\network" 0 end
MessageBox MB_YESNO $(MsgBoxText) IDYES true IDNO false
true:
RMDir /r "$ConfigPath\etc\network"
Delete "$ConfigPath\etc\${NODE_NAME}.cfg"
RMDir /r "$ConfigPath\var\lib\global_db\gdb-cdb"
false:
end:
!macroend
!macro killAll
nsExec::ExecToLog /OEM 'taskkill /f /im ${EXE_NAME}'
nsExec::ExecToLog /OEM 'taskkill /f /im ${APP_NAME}Service.exe' ;Legacy
nsExec::ExecToLog /OEM 'taskkill /f /im ${NODE_NAME}.exe'
${DisableX64FSRedirection}
nsExec::ExecToLog /OEM 'schtasks /Delete /TN "${APP_NAME}Service" /F' ;Legacy
nsExec::ExecToLog /OEM 'schtasks /Delete /TN "${NODE_NAME}" /F'
${EnableX64FSRedirection}
nsExec::ExecToLog /OEM 'sc stop ${APP_NAME}Service'
!macroend
InstallDir "$PROGRAMFILES64\${APP_NAME}"
!define PRODUCT_NAME "${APP_NAME}"
!define PRODUCT_VERSION "${APP_VER}"
!define PRODUCT_FULLNAME "${APP_NAME} ${APP_VER}"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_FULLNAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_UNINSTALL_EXE "uninstall.exe"
Section -UninstallPrevious
Call UninstPrev
SectionEnd
Section "${APP_NAME}" CORE
SectionIn RO
SetOutPath "$INSTDIR"
!insertmacro killAll
File "${APP_NAME}.exe"
File "${APP_NAME}Service.exe"
File "${NODE_NAME}.exe"
File "${NODE_NAME}-cli.exe"
File "${NODE_NAME}-tool.exe"
Call clearDBandChains
!insertmacro varPaths
InitPluginsDir
SetOutPath "$PLUGINSDIR"
File /r "dist\*"
;SetOutPath "$ConfigPath"
CopyFiles "$PLUGINSDIR\etc" "$ConfigPath"
CopyFiles "$PLUGINSDIR\share" "$ConfigPath"
Rename "$ConfigPath\etc\${NODE_NAME}.cfg.tpl" "$ConfigPath\etc\${NODE_NAME}.cfg"
StrCpy $net1 "Backbone"
StrCpy $net2 "mileena"
StrCpy $net3 "subzero"
StrCpy $net4 "kelvpn-minkowski"
;Delete "$ConfigPath\etc\network\$net1.cfg"
Rename "$ConfigPath\etc\network\$net1.cfg.tpl" "$ConfigPath\etc\network\$net1.cfg"
;Delete "$ConfigPath\etc\network\$net2.cfg"
Rename "$ConfigPath\etc\network\$net2.cfg.tpl" "$ConfigPath\etc\network\$net2.cfg"
Rename "$ConfigPath\etc\network\$net3.cfg.tpl" "$ConfigPath\etc\network\$net3.cfg"
Rename "$ConfigPath\etc\network\$net4.cfg.tpl" "$ConfigPath\etc\network\$net4.cfg"
!insertmacro modifyConfigFiles
WriteRegStr HKLM "${UNINSTALL_PATH}" "DisplayName" "${APP_NAME} ${APP_VER}"
WriteRegStr HKLM "${UNINSTALL_PATH}" "UninstallString" "$INSTDIR\Uninstall.exe"
WriteRegStr HKLM "${UNINSTALL_PATH}" "DisplayVersion" "${APP_VERSION}"
WriteRegStr HKLM "${UNINSTALL_PATH}" "Publisher" "${PUBLISHER}"
WriteRegStr HKLM "${UNINSTALL_PATH}" "DisplayIcon" "$INSTDIR\${EXE_NAME}"
WriteRegStr HKCU "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\${NODE_NAME}.exe" "RUNASADMIN"
;WriteRegStr HKCU "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\${APP_NAME}Service.exe" "RUNASADMIN"
WriteUninstaller "$INSTDIR\Uninstall.exe"
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${EXE_NAME}"
StrCpy $0 "'$INSTDIR\${NODE_NAME}.exe'"
${DisableX64FSRedirection}
nsExec::ExecToLog /OEM 'schtasks /Create /F /RL highest /SC onlogon /TR "$0" /TN "${NODE_NAME}"'
${EnableX64FSRedirection}
;nsExec::ExecToLog /OEM 'schtasks /Create /F /RL highest /SC onlogon /TR "$INSTDIR\${APP_NAME}Service.exe" /TN "${APP_NAME}Service"'
;CreateShortCut "$DESKTOP\${APP_NAME}Service.lnk" "$INSTDIR\${APP_NAME}Service.exe"
SectionEnd
Section -startNode
Exec '"$INSTDIR\${NODE_NAME}.exe"'
;Exec '"$INSTDIR\${APP_NAME}Service.exe"'
nsExec::ExecToLog /OEM '"$INSTDIR\${APP_NAME}Service.exe" install'
nsExec::ExecToLog /OEM 'sc start ${APP_NAME}Service'
SectionEnd
Section "Uninstall"
SetRegView 64
!insertmacro killAll
nsExec::ExecToLog /OEM 'sc delete ${APP_NAME}Service'
Delete "$INSTDIR\${APP_NAME}.exe"
Delete "$INSTDIR\${APP_NAME}Service.exe"
Delete "$INSTDIR\${NODE_NAME}.exe"
Delete "$INSTDIR\${NODE_NAME}-tool.exe"
Delete "$INSTDIR\${NODE_NAME}-cli.exe"
DeleteRegKey HKLM "${UNINSTALL_PATH}"
DeleteRegKey HKCU "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\$INSTDIR\${NODE_NAME}.exe"
DeleteRegKey HKCU "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\$INSTDIR\${APP_NAME}Service.exe"
Delete "$INSTDIR\Uninstall.exe"
Delete "$DESKTOP\${APP_NAME}.lnk"
;Delete "$DESKTOP\${APP_NAME}Service.lnk"
;RMDir "$INSTDIR"
SectionEnd
#!/bin/bash
WORKDIR="resources/cellframe/cellframe-dashboard"
shift 3
SCRIPTDIR="prod_build/windows/scripts"
for var in $@; do
export ${var//\"/} #export variables without quotes
done
pwd
#cd $WORKDIR
$SCRIPTDIR/compile_and_pack.sh || { echo "[ERR] $PLATFORM compile_and_pack failed"; exit 12; } # && \
# $SCRIPTDIR/test.sh || { echo "[ERR] $PLATFORM test failed"; exit 13; } && \
# $SCRIPTDIR/install_test.sh || { echo "[ERR] $PLATFORM install_test failed"; exit 14; } && \
# $SCRIPTDIR/cleanup.sh || { echo "[ERR] $PLATFORM cleanup failed"; exit 15; }
#cd $wd
#!/bin/bash
WINDOWS_TOOLCHAIN=$WINDOWS_TOOLCHAIN_PATH/usr/bin
WINDOWS_CROSS_QT=$WINDOWS_TOOLCHAIN_PATH/usr/x86_64-w64-mingw32.static/qt5/bin
export PATH=$WINDOWS_TOOLCHAIN:$PATH
. prod_build/general/conf/version_info
. prod_build/general/pre-build.sh
. prod_build/general/conf/publish
error_explainer() {
case "$1" in
"0" ) echo "";;
"1" ) echo "Error in pre-config happened. Please, review logs";;
"2" ) echo "Error in compilation happened. Please, review logs";;
* ) echo "Unhandled error $1 happened. Please, review logs";;
esac
}
cleanup() {
make distclean
rm -r build_win32
if [ "$1" == "--static" ]; then
export $QT_SELECT="default" #Returning back the shared library link
fi
}
error=0
#2DO: add trap command to clean the sources on exit.
mkdir -p build_win32/dist/share/
sed -i 's/#nsis_build/nsis_build/g' CellFrameDashboardGUI/CellFrameDashboardGUI.pro
sed -i 's/#nsis_build/nsis_build/g' CellFrameDashboardService/CellFrameDashboardService.pro
sed -i 's/compile.bat/compile.sh/g' CellFrameDashboardGUI/CellFrameDashboardGUI.pro
sed -i 's/makensis.exe/makensis/g' CellFrameDashboardGUI/CellFrameDashboardGUI.pro
trap cleanup SIGINT
$WINDOWS_CROSS_QT/qmake && make -j$(nproc) && mkdir build &&
[ -v BRAND ] && echo "Brand = $BRAND" || { echo "No brand defined"; BRAND="Cellframe-Dashboard"; } && \
VERSION=$(extract_version_number) && echo "Version = $VERSION" && \
mv ./build_win32/"$BRAND ${VERSION}.exe" ./build/"${BRAND}-${VERSION}.exe" || error=$?
cleanup
error_explainer $error
exit $error #2DO: Learn how to sign up the package.
#!/bin/bash
echo "Deploying to $PACKAGE_PATH"
echo $wd
CELLFRAME_REPO_KEY="~/.ssh/demlabs_publish"
CELLFRAME_FILESERVER_CREDS="admin@pub.cellframe.net"
CELLFRAME_FILESERVER_PATH="~/web/pub.cellframe.net/public_html/windows"
pwd
cd build
PKGFILES=$(ls . | grep .exe)
[[ -v CI_COMMIT_REF_NAME ]] && [[ $CI_COMMIT_REF_NAME != "master" ]] && SUBDIR="${CI_COMMIT_REF_NAME}" || SUBDIR=""
#echo "We have $DISTR_CODENAME there"
#echo "On path $REPO_DIR_SRC we have exe files."
for pkgfile in $PKGFILES; do
pkgname=$(echo $pkgfile | sed 's/.exe$//')
pkgname_public=$(echo $pkgname | cut -d '-' -f1-4,7-) #cutting away Debian-9.12
pkgname_weblink="$(echo $pkgname | cut -d '-' -f2,8 )-latest" #leaving only necessary entries
mv $pkgfile $wd/$PACKAGE_PATH/$pkgname.exe || { echo "[ERR] Something went wrong in publishing the package. Now aborting."; exit -4; }
CODENAME=$(echo $pkgname | rev | cut -d '-' -f1 | rev)
cp -r ../prod_build/general/essentials/weblink-latest ../prod_build/general/essentials/$pkgname_weblink
sed -i "/document/s/cellframe.*deb/$pkgname_public.exe/" ../prod_build/general/essentials/$pkgname_weblink/index.html
echo "REF_NAME is $CI_COMMIT_REF_NAME"
ssh -i $CELLFRAME_REPO_KEY "$CELLFRAME_FILESERVER_CREDS" "mkdir -p $CELLFRAME_FILESERVER_PATH/$SUBDIR"
scp -i $CELLFRAME_REPO_KEY $wd/$PACKAGE_PATH/$pkgname.exe "$CELLFRAME_FILESERVER_CREDS:$CELLFRAME_FILESERVER_PATH/$SUBDIR/$pkgname_public.exe"
scp -r -i $CELLFRAME_REPO_KEY ../prod_build/general/essentials/$pkgname_weblink "$CELLFRAME_FILESERVER_CREDS:$CELLFRAME_FILESERVER_PATH/$SUBDIR/"
rm -r ../prod_build/general/essentials/$pkgname_weblink
done
# export -n "UPDVER"
cd ..
exit 0
Var /GLOBAL net1
Var /GLOBAL net2
Var /GLOBAL net3
Var /GLOBAL net4
Function AdvReplaceInFile
Exch $0
Exch
Exch $1
Exch
Exch 2
Exch $2
Exch 2
Exch 3
Exch $3
Exch 3
Exch 4
Exch $4
Exch 4
Push $5
Push $6
Push $7
Push $8
Push $9
Push $R0
Push $R1
Push $R2
Push $R3
Push $R4
Push $R5
Push $R6
GetFullPathName $R1 $0\..
GetTempFileName $R6 $R1
FileOpen $R1 $0 r
FileOpen $R0 $R6 w
StrLen $R3 $4
StrCpy $R4 -1
StrCpy $R5 -1
loop_read:
ClearErrors
FileRead $R1 $R2
IfErrors exit
StrCpy $5 0
StrCpy $7 $R2
loop_filter:
IntOp $5 $5 - 1
StrCpy $6 $7 $R3 $5
StrCmp $6 "" file_write2
StrCmp $6 $4 0 loop_filter
StrCpy $8 $7 $5
IntOp $6 $5 + $R3
StrCpy $9 $7 "" $6
StrLen $6 $7
StrCpy $7 $8$3$9
StrCmp -$6 $5 0 loop_filter
IntOp $R4 $R4 + 1
StrCmp $2 all file_write1
StrCmp $R4 $2 0 file_write2
IntOp $R4 $R4 - 1
IntOp $R5 $R5 + 1
StrCmp $1 all file_write1
StrCmp $R5 $1 0 file_write1
IntOp $R5 $R5 - 1
Goto file_write2
file_write1:
FileWrite $R0 $7
Goto loop_read
file_write2:
FileWrite $R0 $7
Goto loop_read
exit:
FileClose $R0
FileClose $R1
SetDetailsPrint none
Delete $0
Rename $R6 $0
Delete $R6
SetDetailsPrint both
Pop $R6
Pop $R5
Pop $R4
Pop $R3
Pop $R2
Pop $R1
Pop $R0
Pop $9
Pop $8
Pop $7
Pop $6
Pop $5
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0
FunctionEnd
!macro modifyConfigEntry Parameter Value Filename
push `${Parameter}`
push `${Value}`
push all
push all
push `${Filename}`
Call AdvReplaceInFile
!macroend
Function modifyChainConfigsIter
Exch $R0
Exch
Exch $R1
Exch
Exch 2
Exch $R2
Exch 2
Push $R3
Push $R4
Push $R5
ClearErrors
FindFirst $R3 $R4 "$R0\$R1"
Loop:
IfErrors Done
!insertmacro modifyConfigEntry "/opt/cellframe-node" "$R2" "$R0\$R4"
!insertmacro modifyConfigEntry "/" "\" "$R0\$R4"
FindNext $R3 $R4
Goto Loop
Done:
FindClose $R3
Pop $R5
Pop $R4
Pop $R3
Pop $R2
Pop $R1
Pop $R0
FunctionEnd
!macro modifyChainConfigs Token Mask Path
Push `${Token}`
Push `${Mask}`
Push `${Path}`
Call modifyChainConfigsIter
!macroend
Function modifyNetworksIter
Exch $R0
Exch
Exch $R1
Exch
Exch 2
Exch $R2
Exch 2
Push $R3
Push $R4
Push $R5
StrCpy $0 $R0
StrCpy $1 $R2
ClearErrors
FindFirst $R3 $R4 "$R0\*.*"
Loop:
IfErrors Done
StrCmp $R4 "." +5
StrCmp $R4 ".." +4
${If} ${FileExists} "$0\$R4\*.*"
DetailPrint "Files in: $0\$R4"
!insertmacro modifyChainConfigs "$1" "$R1" "$0\$R4"
${EndIf}
FindNext $R3 $R4
Goto Loop
Done:
FindClose $R3
Pop $R5
Pop $R4
Pop $R3
Pop $R2
Pop $R1
Pop $R0
FunctionEnd
!macro modifyNetworks Token Mask Path
Push `${Token}`
Push `${Mask}`
Push `${Path}`
Call modifyNetworksIter
!macroend
!macro modifyConfigFiles
!insertmacro modifyConfigEntry "{DEBUG_MODE}" "false" "$ConfigPath\etc\${NODE_NAME}.cfg"
!insertmacro modifyConfigEntry "{DEBUG_STREAM_HEADERS}" "false" "$ConfigPath\etc\${NODE_NAME}.cfg"
!insertmacro modifyConfigEntry "{AUTO_ONLINE}" "true" "$ConfigPath\etc\${NODE_NAME}.cfg"
!insertmacro modifyConfigEntry "{SERVER_ENABLED}" "true" "$ConfigPath\etc\${NODE_NAME}.cfg"
!insertmacro modifyConfigEntry "{SERVER_ADDR}" "0.0.0.0" "$ConfigPath\etc\${NODE_NAME}.cfg"
!insertmacro modifyConfigEntry "{SERVER_PORT}" "8079" "$ConfigPath\etc\${NODE_NAME}.cfg"
!insertmacro modifyConfigEntry "{NOTIFY_SRV_ADDR}" "127.0.0.1" "$ConfigPath\etc\${NODE_NAME}.cfg"
!insertmacro modifyConfigEntry "{NOTIFY_SRV_PORT}" "8080" "$ConfigPath\etc\${NODE_NAME}.cfg"
!insertmacro modifyConfigEntry "{NODE_TYPE}" "master" "$ConfigPath\etc\network\core-t.cfg.tpl"
!insertmacro modifyConfigEntry "{NODE_TYPE}" "master" "$ConfigPath\etc\network\$net1.cfg"
!insertmacro modifyConfigEntry "{NODE_TYPE}" "master" "$ConfigPath\etc\network\$net2.cfg"
!insertmacro modifyConfigEntry "{NODE_TYPE}" "master" "$ConfigPath\etc\network\$net3.cfg"
!insertmacro modifyConfigEntry "{NODE_TYPE}" "master" "$ConfigPath\etc\network\$net4.cfg"
!insertmacro modifyConfigEntry "listen_unix_socket_path" "#listen_unix_socket_path" "$ConfigPath\etc\${NODE_NAME}.cfg"
!insertmacro modifyConfigEntry "#listen_port_tcp=12345" "listen_port_tcp=12345" "$ConfigPath\etc\${NODE_NAME}.cfg"
!insertmacro modifyConfigEntry "{PREFIX}" "$ConfigPath" "$ConfigPath\etc\${NODE_NAME}.cfg"
!insertmacro modifyConfigEntry "pid_path=" "#pid_path=" "$ConfigPath\etc\${NODE_NAME}.cfg"
!insertmacro modifyConfigEntry "/" "\" "$ConfigPath\etc\${NODE_NAME}.cfg"
!insertmacro modifyNetworks "$ConfigPath" "*.cfg" "$ConfigPath\etc\network"
!macroend
#!/bin/bash
#echo "Stub for post-build actions"
echo "Entering post-build deployment and cleanup"
platform=$1
SCRIPTDIR="prod_build/$platform/scripts"
$SCRIPTDIR/deploy.sh || { echo "[ERR] $platform deploy error" && exit 20; }
#$SCRIPTDIR/deploy.sh || { echo "[ERR] $platform deploy error" && $SCRIPTDIR/cleanup.sh && exit 20; } && \
#$SCRIPTDIR/cleanup.sh || { echo "[ERR] $platform cleanup error" && exit 21; }
...@@ -92,7 +92,7 @@ echo "Pack [${BUILD_TYPE}] binaries for [$BUILD_TARGET] from [${DIST_DIR}] to [$ ...@@ -92,7 +92,7 @@ echo "Pack [${BUILD_TYPE}] binaries for [$BUILD_TARGET] from [${DIST_DIR}] to [$
. ${HERE}/packaging/${BUILD_TARGET}.sh . ${HERE}/packaging/${BUILD_TARGET}.sh
PACK ${DIST_DIR} ${BUILD_DIR} ${OUT_DIR} PACK ${DIST_DIR} ${BUILD_DIR} ${OUT_DIR} ${BUILD_TYPE}
...@@ -33,28 +33,27 @@ PACK() ...@@ -33,28 +33,27 @@ PACK()
DIST_DIR=$1 DIST_DIR=$1
BUILD_DIR=$2 BUILD_DIR=$2
OUT_DIR=$3 OUT_DIR=$3
BUILD_TYPE=$4
ARCH=$(dpkg --print-architecture) ARCH=$(dpkg --print-architecture)
source "${HERE}/../version.mk" source "${HERE}/../version.mk"
PACKAGE_NAME="cellframe-dashboard_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}_${ARCH}.deb"
if [ "${BUILD_TYPE}" = "rwd" ]; then
PACKAGE_NAME="cellframe-dashboard_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-rwd_${ARCH}.deb"
else
PACKAGE_NAME="cellframe-dashboard_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}_${ARCH}.deb"
fi
mkdir -p ${DIST_DIR}/DEBIAN mkdir -p ${DIST_DIR}/DEBIAN
#dashboard pkg configs #dashboard pkg configs
cp ${HERE}/../os/debian/control ${DIST_DIR}/DEBIAN cp ${HERE}/../os/debian/control ${DIST_DIR}/DEBIAN
cp ${HERE}/../os/debian/preinst ${DIST_DIR}/DEBIAN
cp ${HERE}/../os/debian/postinst ${DIST_DIR}/DEBIAN cp ${HERE}/../os/debian/postinst ${DIST_DIR}/DEBIAN
cp ${HERE}/../os/debian/postrm ${DIST_DIR}/DEBIAN cp ${HERE}/../os/debian/postrm ${DIST_DIR}/DEBIAN
#merge with node pkg config
cat ${HERE}/../cellframe-node/os/debian/postinst >> ${DIST_DIR}/DEBIAN/postinst
cat ${HERE}/../cellframe-node/os/debian/postrm >> ${DIST_DIR}/DEBIAN/postrm
#copy templates & debconf from node
cp ${HERE}/../cellframe-node/os/debian/config ${DIST_DIR}/DEBIAN/config
cp ${HERE}/../cellframe-node/os/debian/templates ${DIST_DIR}/DEBIAN/templates
FILL_VERSION ${DIST_DIR}/DEBIAN/control FILL_VERSION ${DIST_DIR}/DEBIAN/control
dpkg-deb --build ${DIST_DIR} ${OUT_DIR}/$PACKAGE_NAME dpkg-deb --build ${DIST_DIR} ${OUT_DIR}/$PACKAGE_NAME
} }
\ No newline at end of file
...@@ -72,11 +72,6 @@ PACK() ...@@ -72,11 +72,6 @@ PACK()
cp -r ${DIST_DIR}/${BRAND}Service.app/Contents/MacOS/* ${BRAND_OSX_BUNDLE_DIR}/Contents/MacOS/ cp -r ${DIST_DIR}/${BRAND}Service.app/Contents/MacOS/* ${BRAND_OSX_BUNDLE_DIR}/Contents/MacOS/
cp -r ${DIST_DIR}/${BRAND}Service.app/Contents/Resources/* ${BRAND_OSX_BUNDLE_DIR}/Contents/Resources/ cp -r ${DIST_DIR}/${BRAND}Service.app/Contents/Resources/* ${BRAND_OSX_BUNDLE_DIR}/Contents/Resources/
#copy node binaries and resources
cp -r ${DIST_DIR}/Cellframe.app/Contents/MacOS/* ${BRAND_OSX_BUNDLE_DIR}/Contents/MacOS/
cp -r ${DIST_DIR}/Cellframe.app/Contents/Resources/* ${BRAND_OSX_BUNDLE_DIR}/Contents/Resources/
#copy pkginstall #copy pkginstall
cp ${DIST_DIR}/PKGINSTALL/* ${PACKAGE_DIR} cp ${DIST_DIR}/PKGINSTALL/* ${PACKAGE_DIR}
......
...@@ -9,6 +9,31 @@ else ...@@ -9,6 +9,31 @@ else
HERE=`dirname ${CMD}` HERE=`dirname ${CMD}`
fi fi
EXE_SIGN_POSSIBLE=1
if [ -z "$WIN_CERT_PATH" ]
then
echo "No WIN_CERT_PATH provided. EXE will NOT be signed"
EXE_SIGN_POSSIBLE=0
fi
if [ -z "$WIN_KEY_PATH" ]
then
echo "No WIN_KEY_PATH provided. EXE will NOT be signed"
EXE_SIGN_POSSIBLE=0
fi
if [ -z "$WIN_NAME" ]
then
echo "No WIN_NAME provided. EXE will NOT be signed"
EXE_SIGN_POSSIBLE=0
fi
if [ -z "$WIN_URL" ]
then
echo "No WIN_URL provided. EXE will NOT be signed"
EXE_SIGN_POSSIBLE=0
fi
PACK() PACK()
{ {
...@@ -18,7 +43,18 @@ PACK() ...@@ -18,7 +43,18 @@ PACK()
ARCH=$(dpkg --print-architecture) ARCH=$(dpkg --print-architecture)
source "${HERE}/../version.mk" source "${HERE}/../version.mk"
PACKAGE_NAME="cellframe-dashboard_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}_amd64.exe" PACKAGE_NAME="cellframe-dashboard_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}_amd64.exe"
PACKAGE_NAME_SIGNED="cellframe-dashboard_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}_amd64-signed.exe"
makensis ${DIST_DIR}/build.nsi makensis ${DIST_DIR}/build.nsi
mv ${DIST_DIR}/*installer.exe ${OUT_DIR}/${PACKAGE_NAME} mv ${DIST_DIR}/*installer.exe ${OUT_DIR}/${PACKAGE_NAME}
if [ "$EXE_SIGN_POSSIBLE" -eq "1" ]; then
echo "Signig $PACKAGE_NAME to $PACKAGE_NAME_SIGNED"
cd ${OUT_DIR}
osslsigncode sign -certs "${WIN_CERT_PATH}" -key "${WIN_KEY_PATH}" -n "${WIN_NAME}" -i "${WIN_URL}" -in "./${PACKAGE_NAME}" -out ./${PACKAGE_NAME_SIGNED}
rm ${PACKAGE_NAME}
fi
} }
...@@ -17,7 +17,7 @@ containsElement () { ...@@ -17,7 +17,7 @@ containsElement () {
TARGETS=(linux windows osx) TARGETS=(linux windows osx)
BUILD_TYPES=(release debug) BUILD_TYPES=(release debug rwd)
VALIDATE_TARGET() VALIDATE_TARGET()
{ {
......