From 3787787404751485cc9f14a890faecfed042801e Mon Sep 17 00:00:00 2001 From: osnwt Date: Fri, 28 Jan 2011 18:18:08 +0000 Subject: [PATCH] Windows installer and build scripts: few minor changes (listed below), no code change. - Fixed unescaped backslashes in openpilotgcs.pro, translations.pro, glc_lib.pro (don't like warnings). - Fixed comments in Windows installer batch file. - Changed Windows uninstaller section names for better readability. - Changed Windows installer executable properties (makes sense if you use SubWCRev). - temporary disabled Windows installer Spanish language until someone helps with translation (no changes for GCS itself). - small beautification of winx86.pro. - some changes in the top Makefile.cmd (more changeable parameters for batch build) git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2609 ebee16cc-31ac-478f-84a7-5cbb03baadba --- Makefile.cmd | 60 ++++++++++++------- ground/openpilotgcs/openpilotgcs.pro | 2 +- .../packaging/winx86/Makefile.cmd | 2 +- .../packaging/winx86/openpilotgcs.nsi | 6 +- .../packaging/winx86/openpilotgcs.tpl | 2 +- .../winx86/translations/languages.nsh | 6 +- .../winx86/translations/strings_de.nsh | 2 +- .../winx86/translations/strings_en.nsh | 2 +- .../winx86/translations/strings_es.nsh | 2 +- .../winx86/translations/strings_ru.nsh | 2 +- .../winx86/translations/strings_zh_CN.nsh | 2 +- .../openpilotgcs/packaging/winx86/winx86.pro | 9 ++- .../translations/translations.pro | 2 +- .../openpilotgcs/src/libs/glc_lib/glc_lib.pro | 4 +- 14 files changed, 62 insertions(+), 41 deletions(-) diff --git a/Makefile.cmd b/Makefile.cmd index 302b9642d..e24fca324 100644 --- a/Makefile.cmd +++ b/Makefile.cmd @@ -14,10 +14,9 @@ echo - clean: cleans all flight targets including bootloaders and firmware echo - help: this help echo: echo Environment variables: -echo - TARGETS_FW - list of target (default is all flight targets) echo - TARGETS_BL - list of target (default is all flight bootloader targets) -echo - TARGET_FW_SUBDIR - subdirectory of build/ to build targets (default is .) -echo - TARGET_BL_SUBDIR - subdirectory of build/ to build bootloaders (default is bootloaders) +echo - TARGETS_FW - list of target (default is all flight targets) +echo - UAVOBJGENERATOR - path and filename override for UAVObjGenerator.exe echo: echo Example usage (from a batch file with .cmd extension): echo set PATH=D:\Work\OpenPilot\Apps\CodeSourcery\bin\;%%PATH%% @@ -34,53 +33,72 @@ rem Settings and definitions rem ------------------------------------------------------------------- rem Set desired targets and paths -if "%TARGETS_FW%" == "" set TARGETS_FW=ahrs openpilot pipxtreme coptercontrol -if "%TARGETS_BL%" == "" set TARGETS_BL=ahrs openpilot pipxtreme -if "%TARGET_FW_SUBDIR%" == "" set TARGET_FW_SUBDIR=. +if "%TARGETS_BL%" == "" set TARGETS_BL=ahrs openpilot pipxtreme coptercontrol +if "%TARGETS_FW%" == "" set TARGETS_FW=%TARGETS_BL% if "%TARGET_BL_SUBDIR%" == "" set TARGET_BL_SUBDIR=bootloaders +if "%TARGET_FW_SUBDIR%" == "" set TARGET_FW_SUBDIR=. rem Set toolset paths (if you don't have them added permanently) rem set PATH=D:\Work\OpenPilot\Apps\CodeSourcery\bin\;%PATH% + set MAKE=cs-make rem Set some project path variables -rem for /F %%D in ('cd') do set CURDIR=%%D -for %%D in (%0) do set CURDIR=%%~dD%%~pD +for %%D in (%0) do set CURDIR=%%~dpD set ROOT_DIR=%CURDIR% set BUILD_DIR=%ROOT_DIR%\build set UAVOBJ_XML_DIR=%ROOT_DIR%\shared\uavobjectdefinition set UAVOBJ_OUT_DIR=%BUILD_DIR%\uavobject-synthetics -rem Find the UAVObjGenerator -for %%G in (debug release) do ( - if exist %BUILD_DIR%\ground\uavobjgenerator\%%G\uavobjgenerator.exe ( - set UAVOBJGENERATOR="%BUILD_DIR%\ground\uavobjgenerator\%%G\uavobjgenerator.exe" - goto UAVObjGeneratorFound - ) -) -echo UAVObjGenerator was not found, please build it first -goto Abort -:UAVObjGeneratorFound - rem ------------------------------------------------------------------- rem Proceed with target rem ------------------------------------------------------------------- set TARGET=%1 +if '%TARGET%' == 'clean' goto UAVObjectsDone + +rem ------------------------------------------------------------------- +rem Searching for UAVObjGenerator executable +rem ------------------------------------------------------------------- + +set UAVOBJGENERATOR_FILENAME=uavobjgenerator.exe + +rem If environment variable is set then expand it to full path and use +for %%G in (%UAVOBJGENERATOR%) do set UAVOBJGENERATOR=%%~fG +if exist "%UAVOBJGENERATOR%" goto UAVObjGeneratorFound + +rem Searching in builds +for %%G in (debug release) do ( + if exist %BUILD_DIR%\ground\uavobjgenerator\%%G\%UAVOBJGENERATOR_FILENAME% ( + set UAVOBJGENERATOR="%BUILD_DIR%\ground\uavobjgenerator\%%G\%UAVOBJGENERATOR_FILENAME%" + goto UAVObjGeneratorFound + ) +) + +rem Searching in PATH +for %%G in (%UAVOBJGENERATOR_FILENAME%) do set UAVOBJGENERATOR=%%~$PATH:G +if exist %UAVOBJGENERATOR% goto UAVObjGeneratorFound + +rem Report error +for %%G in (%ROOT_DIR%/ground/ground.pro) do set GROUND_PRO=%%~fG +echo UAVObjGenerator was not found, please build it first using %GROUND_PRO% +goto Abort + +:UAVObjGeneratorFound +echo UAVObjGenerator found: %UAVOBJGENERATOR% rem ------------------------------------------------------------------- rem UAVObjects for flight build rem ------------------------------------------------------------------- -if '%TARGET%' == 'clean' goto UAVObjectsDone mkdir %UAVOBJ_OUT_DIR% >NUL 2>&1 pushd %UAVOBJ_OUT_DIR% %UAVOBJGENERATOR% -flight %UAVOBJ_XML_DIR% %ROOT_DIR% if errorlevel 1 goto Abort2 popd -:UAVObjectsDone +:UAVObjectsDone rem ------------------------------------------------------------------- rem Bootloaders build rem ------------------------------------------------------------------- diff --git a/ground/openpilotgcs/openpilotgcs.pro b/ground/openpilotgcs/openpilotgcs.pro index ba947f666..5c2611a11 100644 --- a/ground/openpilotgcs/openpilotgcs.pro +++ b/ground/openpilotgcs/openpilotgcs.pro @@ -1,5 +1,5 @@ #version check qt -contains(QT_VERSION, ^4\.[0-5]\..*) { +contains(QT_VERSION, ^4\\.[0-5]\\..*) { message("Cannot build OpenPilot GCS with Qt version $${QT_VERSION}.") error("Cannot build OpenPilot GCS with Qt version $${QT_VERSION}. Use at least Qt 4.6!") } diff --git a/ground/openpilotgcs/packaging/winx86/Makefile.cmd b/ground/openpilotgcs/packaging/winx86/Makefile.cmd index 981cb190d..5127caa79 100644 --- a/ground/openpilotgcs/packaging/winx86/Makefile.cmd +++ b/ground/openpilotgcs/packaging/winx86/Makefile.cmd @@ -8,7 +8,7 @@ rem This script requires Unicode NSIS 2.46 or higher: rem http://www.scratchpaper.com/ rem rem Optional SVN utility to get currently used SVN revision is SubWCRev.exe, -rem it installed by TortoiseSVN or available separately: +rem it is a part of TortoiseSVN package or is available separately: rem http://sourceforge.net/projects/tortoisesvn/files/Tools/1.6.7/SubWCRev-1.6.7.18415.msi/download rem diff --git a/ground/openpilotgcs/packaging/winx86/openpilotgcs.nsi b/ground/openpilotgcs/packaging/winx86/openpilotgcs.nsi index a5f1e4ed7..bcd39f81f 100644 --- a/ground/openpilotgcs/packaging/winx86/openpilotgcs.nsi +++ b/ground/openpilotgcs/packaging/winx86/openpilotgcs.nsi @@ -233,7 +233,7 @@ FunctionEnd ;-------------------------------- ; Uninstaller sections -Section "un.Program" UnSecProgram +Section "un.OpenPilot GCS" UnSecProgram ; Remove installed files and/or directories RMDir /r /rebootok "$INSTDIR\bin" RMDir /r /rebootok "$INSTDIR\lib" @@ -253,12 +253,12 @@ Section "un.Program" UnSecProgram RMDir /rebootok "$SMPROGRAMS\OpenPilot" SectionEnd -Section "un.Cache" UnSecCache +Section "un.Maps cache" UnSecCache ; Remove maps cache RMDir /r /rebootok "$PROFILE\OpenPilot" SectionEnd -Section /o "un.Config" UnSecConfig +Section /o "un.Configuration" UnSecConfig ; Remove configuration RMDir /r /rebootok "$APPDATA\OpenPilot" SectionEnd diff --git a/ground/openpilotgcs/packaging/winx86/openpilotgcs.tpl b/ground/openpilotgcs/packaging/winx86/openpilotgcs.tpl index 2788681a5..14c4383e4 100644 --- a/ground/openpilotgcs/packaging/winx86/openpilotgcs.tpl +++ b/ground/openpilotgcs/packaging/winx86/openpilotgcs.tpl @@ -9,4 +9,4 @@ ; Installer version info !define PRODUCT_VERSION "0.0.0.$WCREV$" !define FILE_VERSION "0.0.0.$WCREV$" -!define BUILD_DESCRIPTION "Last committed revision $WCREV$ ($WCDATE$) using$WCMIXED? mixed:$ SVN revision range $WCRANGE$$WCMODS? (locally modified):$. Built from $WCURL$ on $WCNOW$." +!define BUILD_DESCRIPTION "Last committed revision $WCREV$ ($WCDATE$) using$WCMIXED? mixed:$ SVN revision range $WCRANGE$$WCMODS? (locally modified):$. Built from $WCURL$ ($WCNOW$)." diff --git a/ground/openpilotgcs/packaging/winx86/translations/languages.nsh b/ground/openpilotgcs/packaging/winx86/translations/languages.nsh index 6888a8469..c984195a6 100644 --- a/ground/openpilotgcs/packaging/winx86/translations/languages.nsh +++ b/ground/openpilotgcs/packaging/winx86/translations/languages.nsh @@ -27,7 +27,7 @@ !insertmacro MUI_LANGUAGE "French" !insertmacro MUI_LANGUAGE "German" !insertmacro MUI_LANGUAGE "Russian" - !insertmacro MUI_LANGUAGE "Spanish" +; !insertmacro MUI_LANGUAGE "Spanish" !insertmacro MUI_LANGUAGE "TradChinese" ;-------------------------------- @@ -37,7 +37,7 @@ LicenseLangString LicenseFile ${LANG_FRENCH} "licenses\GPLv3_fr.rtf" LicenseLangString LicenseFile ${LANG_GERMAN} "licenses\GPLv3_de.rtf" LicenseLangString LicenseFile ${LANG_RUSSIAN} "licenses\GPLv3_ru.rtf" - LicenseLangString LicenseFile ${LANG_SPANISH} "licenses\GPLv3_es.rtf" +; LicenseLangString LicenseFile ${LANG_SPANISH} "licenses\GPLv3_es.rtf" LicenseLangString LicenseFile ${LANG_TRADCHINESE} "licenses\GPLv3_zh_CN.rtf" ;-------------------------------- @@ -47,5 +47,5 @@ !include "translations\strings_fr.nsh" !include "translations\strings_de.nsh" !include "translations\strings_ru.nsh" - !include "translations\strings_es.nsh" +; !include "translations\strings_es.nsh" !include "translations\strings_zh_CN.nsh" diff --git a/ground/openpilotgcs/packaging/winx86/translations/strings_de.nsh b/ground/openpilotgcs/packaging/winx86/translations/strings_de.nsh index ee7fe2c5e..3d0e16b0c 100644 --- a/ground/openpilotgcs/packaging/winx86/translations/strings_de.nsh +++ b/ground/openpilotgcs/packaging/winx86/translations/strings_de.nsh @@ -27,7 +27,7 @@ LangString DESC_InSecCore ${LANG_GERMAN} "GCS Kernkomponenten (Programm und Bibliotheken)." LangString DESC_InSecPlugins ${LANG_GERMAN} "GCS Plugins (Der Großteil der GCS Funktionalität)." - LangString DESC_InSecResources ${LANG_GERMAN} "GCS Resourcen (Diagramme, Zifferblätter, Kartenicons, 3d-Modelle, 'pfd')." + LangString DESC_InSecResources ${LANG_GERMAN} "GCS Resourcen (Diagramme, Zifferblätter, Kartenicons, 3d-Modelle, PFD)." LangString DESC_InSecSounds ${LANG_GERMAN} "GCS Sounddateien (benötigt für akustische Ereignisbenachrichtigungen)." LangString DESC_InSecLocalization ${LANG_GERMAN} "GCS Lokalisation (für unterstützte Sprachen)." LangString DESC_InSecShortcuts ${LANG_GERMAN} "Installiere Verknüpfungen unter Startmenü->Anwendungen." diff --git a/ground/openpilotgcs/packaging/winx86/translations/strings_en.nsh b/ground/openpilotgcs/packaging/winx86/translations/strings_en.nsh index 293a27fe7..224e018b7 100644 --- a/ground/openpilotgcs/packaging/winx86/translations/strings_en.nsh +++ b/ground/openpilotgcs/packaging/winx86/translations/strings_en.nsh @@ -27,7 +27,7 @@ LangString DESC_InSecCore ${LANG_ENGLISH} "Core GCS components (executable and libraries)." LangString DESC_InSecPlugins ${LANG_ENGLISH} "GCS plugins (provide most of GCS functionality)." - LangString DESC_InSecResources ${LANG_ENGLISH} "GCS resources (diagrams, dials, mapicons, 3d-models, 'pfd')." + LangString DESC_InSecResources ${LANG_ENGLISH} "GCS resources (diagrams, dials, mapicons, 3d-models, PFD)." LangString DESC_InSecSounds ${LANG_ENGLISH} "GCS sound files (used for audible event notifications)." LangString DESC_InSecLocalization ${LANG_ENGLISH} "GCS localization (for supported languages)." LangString DESC_InSecShortcuts ${LANG_ENGLISH} "Install application start menu shortcuts." diff --git a/ground/openpilotgcs/packaging/winx86/translations/strings_es.nsh b/ground/openpilotgcs/packaging/winx86/translations/strings_es.nsh index 54d1ab617..8c0c8b07d 100644 --- a/ground/openpilotgcs/packaging/winx86/translations/strings_es.nsh +++ b/ground/openpilotgcs/packaging/winx86/translations/strings_es.nsh @@ -27,7 +27,7 @@ LangString DESC_InSecCore ${LANG_SPANISH} "TRANSLATE THIS: Core GCS components (executable and libraries)." LangString DESC_InSecPlugins ${LANG_SPANISH} "TRANSLATE THIS: GCS plugins (provide most of GCS functionality)." - LangString DESC_InSecResources ${LANG_SPANISH} "TRANSLATE THIS: GCS resources (diagrams, dials, mapicons, 3d-models, 'pfd')." + LangString DESC_InSecResources ${LANG_SPANISH} "TRANSLATE THIS: GCS resources (diagrams, dials, mapicons, 3d-models, PFD)." LangString DESC_InSecSounds ${LANG_SPANISH} "TRANSLATE THIS: GCS sound files (used for audible event notifications)." LangString DESC_InSecLocalization ${LANG_SPANISH} "TRANSLATE THIS: GCS localization (for supported languages)." LangString DESC_InSecShortcuts ${LANG_SPANISH} "TRANSLATE THIS: Install application start menu shortcuts." diff --git a/ground/openpilotgcs/packaging/winx86/translations/strings_ru.nsh b/ground/openpilotgcs/packaging/winx86/translations/strings_ru.nsh index 6d6f7c89d..c6bc6e557 100644 --- a/ground/openpilotgcs/packaging/winx86/translations/strings_ru.nsh +++ b/ground/openpilotgcs/packaging/winx86/translations/strings_ru.nsh @@ -27,7 +27,7 @@ LangString DESC_InSecCore ${LANG_RUSSIAN} "Основные компоненты GCS (исполняемый файл и библиотеки)." LangString DESC_InSecPlugins ${LANG_RUSSIAN} "Плагины GCS (обеспечивают большую часть функций GCS)." - LangString DESC_InSecResources ${LANG_RUSSIAN} "Ресурсы GCS (диаграммы, приборы, пиктограммы, 3d-модели, 'pfd')." + LangString DESC_InSecResources ${LANG_RUSSIAN} "Ресурсы GCS (диаграммы, приборы, пиктограммы, 3d-модели, PFD)." LangString DESC_InSecSounds ${LANG_RUSSIAN} "Звуковые файлы (используются для звуковых уведомлений о событиях)." LangString DESC_InSecLocalization ${LANG_RUSSIAN} "Файлы языковой поддержки (для поддерживаемых языков)." LangString DESC_InSecShortcuts ${LANG_RUSSIAN} "Установка ярлыков для приложения." diff --git a/ground/openpilotgcs/packaging/winx86/translations/strings_zh_CN.nsh b/ground/openpilotgcs/packaging/winx86/translations/strings_zh_CN.nsh index 98459c543..6cf4b9b12 100644 --- a/ground/openpilotgcs/packaging/winx86/translations/strings_zh_CN.nsh +++ b/ground/openpilotgcs/packaging/winx86/translations/strings_zh_CN.nsh @@ -27,7 +27,7 @@ LangString DESC_InSecCore ${LANG_TRADCHINESE} "地面站核心组件 (可执行文件和库文件)." LangString DESC_InSecPlugins ${LANG_TRADCHINESE} "地面站插件(提供地面站大部分功能)." - LangString DESC_InSecResources ${LANG_TRADCHINESE} "地面站资源库(图表,地图,模型,'pfd'(主要飞行数据图))." + LangString DESC_InSecResources ${LANG_TRADCHINESE} "地面站资源库(图表,地图,模型,PFD(主要飞行数据图))." LangString DESC_InSecSounds ${LANG_TRADCHINESE} "地面站音频文件(用于对于特定事件的提醒)." LangString DESC_InSecLocalization ${LANG_TRADCHINESE} "地面站本土化(适用于它所支持的语言)." LangString DESC_InSecShortcuts ${LANG_TRADCHINESE} "安装开始菜单的快捷方式." diff --git a/ground/openpilotgcs/packaging/winx86/winx86.pro b/ground/openpilotgcs/packaging/winx86/winx86.pro index 3e626d3ed..077b37ba7 100644 --- a/ground/openpilotgcs/packaging/winx86/winx86.pro +++ b/ground/openpilotgcs/packaging/winx86/winx86.pro @@ -19,15 +19,18 @@ equals(copydata, 1):win32:CONFIG(release, debug|release) { # http://sourceforge.net/projects/tortoisesvn/files/Tools/1.6.7/SubWCRev-1.6.7.18415.msi/download # Default location is TortoiseSVN bin folder. + # FIXME: it should try to find in the PATH first, and use hardcoded reference last SUBWCREV_EXE = $$targetPath(\"$$(ProgramFiles)/TortoiseSVN/bin/SubWCRev.exe\") exists($$SUBWCREV_EXE) { message("SubWCRev found: $${SUBWCREV_EXE}") - svninfo.commands += $$SUBWCREV_EXE $$targetPath($$GCS_SOURCE_TREE) + svninfo.commands += @echo Executing $${SUBWCREV_EXE} $$SVN_INFO_TEMPLATE $$SVN_INFO_MAKEFILE $$addNewline() + svninfo.commands += @$$SUBWCREV_EXE $$targetPath($$GCS_SOURCE_TREE) svninfo.commands += $$targetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/$$SVN_INFO_TEMPLATE) svninfo.commands += $$targetPath($$GCS_BUILD_TREE/$$WINX86_PATH/$$SVN_INFO_MAKEFILE) svninfo.commands += $$addNewline() - svninfo.commands += $$SUBWCREV_EXE $$targetPath($$GCS_SOURCE_TREE) + svninfo.commands += @echo Executing $${SUBWCREV_EXE} $$NSIS_TEMPLATE $$NSIS_HEADER $$addNewline() + svninfo.commands += @$$SUBWCREV_EXE $$targetPath($$GCS_SOURCE_TREE) svninfo.commands += $$targetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/$$NSIS_TEMPLATE) svninfo.commands += $$targetPath($$GCS_BUILD_TREE/$$WINX86_PATH/$$NSIS_HEADER) svninfo.commands += $$addNewline() @@ -51,7 +54,7 @@ equals(copydata, 1):win32:CONFIG(release, debug|release) { QMAKE_EXTRA_TARGETS += force # Create installer build target - this WILL NOT run during build, run it by hand - message("Run \"make installer\" to build Windows installer (Unicode NSIS 2.46+ required)") + message("Run \"make installer\" in $$GCS_BUILD_TREE/$$WINX86_PATH to build Windows installer (Unicode NSIS 2.46+ required)") nsis.target = installer nsis.depends = svninfo nsis.commands += @$$targetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/Makefile.cmd) diff --git a/ground/openpilotgcs/share/openpilotgcs/translations/translations.pro b/ground/openpilotgcs/share/openpilotgcs/translations/translations.pro index 71b950cff..a9fa6e963 100644 --- a/ground/openpilotgcs/share/openpilotgcs/translations/translations.pro +++ b/ground/openpilotgcs/share/openpilotgcs/translations/translations.pro @@ -16,7 +16,7 @@ TRANSLATIONS = $$prependAll(LANGUAGES, $$PWD/openpilotgcs_,.ts) MIME_TR_H = $$PWD/mime_tr.h -contains(QT_VERSION, ^4\.[0-5]\..*) { +contains(QT_VERSION, ^4\\.[0-5]\\..*) { ts.commands = @echo This Qt version is too old for the ts target. Need Qt 4.6+. } else { for(dir, $$list($$files($$GCS_SOURCE_TREE/src/plugins/*))):MIMETYPES_FILES += $$files($$dir/*.mimetypes.xml) diff --git a/ground/openpilotgcs/src/libs/glc_lib/glc_lib.pro b/ground/openpilotgcs/src/libs/glc_lib/glc_lib.pro index ae7785812..b41841175 100644 --- a/ground/openpilotgcs/src/libs/glc_lib/glc_lib.pro +++ b/ground/openpilotgcs/src/libs/glc_lib/glc_lib.pro @@ -417,8 +417,8 @@ unix { # Windows Install configuration win32 { # Location of HEADERS and library - LIB_DIR = C:\GLC_lib\lib - INCLUDE_DIR = C:\GLC_lib\include + LIB_DIR = C:/GLC_lib/lib + INCLUDE_DIR = C:/GLC_lib/include include.path = $${INCLUDE_DIR} include_lib3ds.path = $${INCLUDE_DIR}/3rdparty/lib3ds include_glext.path = $${INCLUDE_DIR}/3rdparty/glext