diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index 48665720f..aa5583d3f 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT( companion9x ) +PROJECT( companion ) SET( C9X_VERSION_MAJOR "1" ) SET( C9X_VERSION_MINOR "51" ) @@ -109,7 +109,7 @@ add_custom_command( DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp ) -SET( companion9x_SRCS +SET( companion_SRCS eeprominterface.cpp hexinterface.cpp flashinterface.cpp @@ -168,7 +168,7 @@ SET( companion9x_SRCS qcustomplot.cpp ) -SET( companion9x_MOC_HDRS +SET( companion_MOC_HDRS avroutputdialog.h preferencesdialog.h burnconfigdialog.h @@ -201,7 +201,7 @@ SET( companion9x_MOC_HDRS qcustomplot.h ) -SET( companion9x_UIS +SET( companion_UIS mdichild.ui avroutputdialog.ui comparedialog.ui @@ -225,25 +225,25 @@ SET( companion9x_UIS ) IF ( SDL_FOUND ) - SET( companion9x_SRCS - ${companion9x_SRCS} + SET( companion_SRCS + ${companion_SRCS} joystick.cpp joystickdialog.cpp ) - SET( companion9x_MOC_HDRS - ${companion9x_MOC_HDRS} + SET( companion_MOC_HDRS + ${companion_MOC_HDRS} joystick.h joystickdialog.h ) - SET( companion9x_UIS - ${companion9x_UIS} + SET( companion_UIS + ${companion_UIS} joystickdialog.ui ) ENDIF( ) -SET( companion9x_RCS +SET( companion_RCS companion9x.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc ) @@ -286,7 +286,7 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/firmwares/opentx/stamp-opentx.h.in ${ SET( PATCH_FLAGS "--binary" ) IF( WIN32 ) - SET( companion9x_SRCS ${companion9x_SRCS} icon.rc ) + SET( companion_SRCS ${companion_SRCS} icon.rc ) IF ( NOT MSVC ) SET(CMAKE_EXE_LINKER_FLAGS -mwindows) ENDIF( ) @@ -298,28 +298,28 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} ) SET( LANGUAGES he pt ru de fr it sv cs ) FOREACH( language ${LANGUAGES} ) - SET( companion9x_TS ${companion9x_TS} translations/companion9x_${language}.ts ) + SET( companion_TS ${companion_TS} translations/companion_${language}.ts ) ENDFOREACH( language ) -QT4_WRAP_UI( companion9x_SRCS ${companion9x_UIS} ) -QT4_WRAP_CPP( companion9x_SRCS ${companion9x_MOC_HDRS} ) -QT4_ADD_TRANSLATION( companion9x_QM ${companion9x_TS} ) -QT4_ADD_RESOURCES( companion9x_SRCS ${companion9x_RCS} ) +QT4_WRAP_UI( companion_SRCS ${companion_UIS} ) +QT4_WRAP_CPP( companion_SRCS ${companion_MOC_HDRS} ) +QT4_ADD_TRANSLATION( companion_QM ${companion_TS} ) +QT4_ADD_RESOURCES( companion_SRCS ${companion_RCS} ) ADD_DEFINITIONS( -DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}" ) IF( APPLE ) - ADD_EXECUTABLE( ${PROJECT_NAME} MACOSX_BUNDLE ${companion9x_SRCS} ${companion9x_QM} ) + ADD_EXECUTABLE( ${PROJECT_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_QM} ) ELSE( ) - ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${companion9x_SRCS} ${companion9x_QM} ) + ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${companion_SRCS} ${companion_QM} ) ENDIF( ) TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} ) IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") INSTALL( TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ) - INSTALL( FILES companion9x.desktop DESTINATION share/applications ) - INSTALL( FILES companion9x.png DESTINATION share/icons ) + INSTALL( FILES companion.desktop DESTINATION share/applications ) + INSTALL( FILES companion.png DESTINATION share/icons ) INSTALL( FILES ../targets/linux/45-taranis.rules DESTINATION /etc/udev/rules.d/ ) # Linux specific code SET(OperatingSystem "Linux") @@ -329,13 +329,13 @@ ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") IF( WIN32 ) IF( MSVC ) - SET( NSI_IN_FILE companion9x-vs.nsi.in ) + SET( NSI_IN_FILE companion-vs.nsi.in ) ELSE( ) - SET( NSI_IN_FILE companion9x-msys.nsi.in ) + SET( NSI_IN_FILE companion-msys.nsi.in ) ENDIF( ) SET( SYSDIR "$ENV{windir}/system32" ) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion9x.nsi @ONLY) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion.nsi @ONLY) FIND_PROGRAM(NSIS_EXE makensis.exe PATHS "C:/Program Files/NSIS" @@ -343,14 +343,14 @@ IF( WIN32 ) "C:/Programs/NSIS" ) - ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companion9xInstall.exe - COMMAND "${NSIS_EXE}" ARGS companion9x.nsi - DEPENDS ${PROJECT_NAME} ${PROJECT_BINARY_DIR}/companion9x.nsi + ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companionInstall.exe + COMMAND "${NSIS_EXE}" ARGS companion.nsi + DEPENDS ${PROJECT_NAME} ${PROJECT_BINARY_DIR}/companion.nsi COMMENT "Windows NSIS Installer") ADD_CUSTOM_TARGET( installer - DEPENDS ${PROJECT_BINARY_DIR}/companion9xInstall.exe - SOURCES ${PROJECT_BINARY_DIR}/companion9x.nsi) + DEPENDS ${PROJECT_BINARY_DIR}/companionInstall.exe + SOURCES ${PROJECT_BINARY_DIR}/companion.nsi) ENDIF( ) IF( APPLE ) @@ -362,35 +362,35 @@ IF( APPLE ) ENDIF() ADD_CUSTOM_TARGET( addframeworks ALL - COMMAND mkdir -p companion9x.app/Contents/Frameworks - COMMAND mkdir -p companion9x.app/Contents/Resources - COMMAND mkdir -p companion9x.app/Contents/translations - COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion9x.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files - COMMAND rsync ${PROJECT_SOURCE_DIR}/../macbuild/lib* companion9x.app/Contents/Frameworks - #COMMAND rsync ${PROJECT_SOURCE_DIR}/../macbuild/libcrypto.1.0.0.dylib companion9x.app/Contents/Frameworks - COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../macbuild/qt_menu.nib companion9x.app/Contents/Resources/ - COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion9x.app/Contents/translations - COMMAND ${QT_BINARY_DIR}/macdeployqt companion9x.app + COMMAND mkdir -p companion.app/Contents/Frameworks + COMMAND mkdir -p companion.app/Contents/Resources + COMMAND mkdir -p companion.app/Contents/translations + COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files + COMMAND rsync ${PROJECT_SOURCE_DIR}/../macbuild/lib* companion.app/Contents/Frameworks + #COMMAND rsync ${PROJECT_SOURCE_DIR}/../macbuild/libcrypto.1.0.0.dylib companion.app/Contents/Frameworks + COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../macbuild/qt_menu.nib companion.app/Contents/Resources/ + COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations + COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app WORKING_DIRECTORY ${WORK_DIR} DEPENDS ${PROJECT_NAME} ) ADD_CUSTOM_TARGET( makedmg - COMMAND ${QT_BINARY_DIR}/macdeployqt companion9x.app -dmg -no-plugins + COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins WORKING_DIRECTORY ${WORK_DIR} DEPENDS addframeworks ) ENDIF( ) ADD_CUSTOM_TARGET( stamp - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion9x.stamp + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion.stamp DEPENDS ${CMAKE_BINARY_DIR}/version.h ) ADD_CUSTOM_TARGET( translations WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - COMMAND lupdate-qt4 ${CMAKE_SOURCE_DIR} -ts ${companion9x_TS} ) + COMMAND lupdate-qt4 ${CMAKE_SOURCE_DIR} -ts ${companion_TS} ) -SET(CPACK_PACKAGE_NAME "COMPANION9X") +SET(CPACK_PACKAGE_NAME "COMPANION") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware") string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME_LOWERCASE) find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems") diff --git a/companion/src/companion9x.desktop b/companion/src/companion.desktop similarity index 100% rename from companion/src/companion9x.desktop rename to companion/src/companion.desktop diff --git a/companion/src/companion9x.png b/companion/src/companion.png similarity index 100% rename from companion/src/companion9x.png rename to companion/src/companion.png diff --git a/companion/src/main.cpp b/companion/src/main.cpp index d97592c08..06ae8167f 100644 --- a/companion/src/main.cpp +++ b/companion/src/main.cpp @@ -89,13 +89,13 @@ int main(int argc, char *argv[]) QString locale = settings.value("locale",QLocale::system().name()).toString(); bool showSplash = settings.value("show_splash", true).toBool(); - QTranslator companion9xTranslator; - companion9xTranslator.load(":/companion9x_" + locale); + QTranslator companionTranslator; + companionTranslator.load(":/companion_" + locale); QTranslator qtTranslator; qtTranslator.load((QString)"qt_" + locale.left(2), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); // qDebug() << locale; // qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - app.installTranslator(&companion9xTranslator); + app.installTranslator(&companionTranslator); app.installTranslator(&qtTranslator); QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); diff --git a/companion/src/translations.qrc.in b/companion/src/translations.qrc.in index d01dd945f..434cbd225 100644 --- a/companion/src/translations.qrc.in +++ b/companion/src/translations.qrc.in @@ -1,12 +1,12 @@ - companion9x_fr.qm - companion9x_de.qm - companion9x_he.qm - companion9x_it.qm - companion9x_pt.qm - companion9x_ru.qm - companion9x_sv.qm - companion9x_cs.qm + companion_fr.qm + companion_de.qm + companion_he.qm + companion_it.qm + companion_pt.qm + companion_ru.qm + companion_sv.qm + companion_cs.qm diff --git a/companion/src/translations/companion9x_cs.ts b/companion/src/translations/companion_cs.ts similarity index 100% rename from companion/src/translations/companion9x_cs.ts rename to companion/src/translations/companion_cs.ts diff --git a/companion/src/translations/companion9x_de.ts b/companion/src/translations/companion_de.ts similarity index 100% rename from companion/src/translations/companion9x_de.ts rename to companion/src/translations/companion_de.ts diff --git a/companion/src/translations/companion9x_fr.ts b/companion/src/translations/companion_fr.ts similarity index 100% rename from companion/src/translations/companion9x_fr.ts rename to companion/src/translations/companion_fr.ts diff --git a/companion/src/translations/companion9x_he.ts b/companion/src/translations/companion_he.ts similarity index 100% rename from companion/src/translations/companion9x_he.ts rename to companion/src/translations/companion_he.ts diff --git a/companion/src/translations/companion9x_it.ts b/companion/src/translations/companion_it.ts similarity index 100% rename from companion/src/translations/companion9x_it.ts rename to companion/src/translations/companion_it.ts diff --git a/companion/src/translations/companion9x_pt.ts b/companion/src/translations/companion_pt.ts similarity index 100% rename from companion/src/translations/companion9x_pt.ts rename to companion/src/translations/companion_pt.ts diff --git a/companion/src/translations/companion9x_ru.ts b/companion/src/translations/companion_ru.ts similarity index 100% rename from companion/src/translations/companion9x_ru.ts rename to companion/src/translations/companion_ru.ts diff --git a/companion/src/translations/companion9x_sv.ts b/companion/src/translations/companion_sv.ts similarity index 100% rename from companion/src/translations/companion9x_sv.ts rename to companion/src/translations/companion_sv.ts diff --git a/companion/targets/windows/companion9x-msys.nsi.in b/companion/targets/windows/companion-msys.nsi.in similarity index 80% rename from companion/targets/windows/companion9x-msys.nsi.in rename to companion/targets/windows/companion-msys.nsi.in index ed7bf33fb..3b38bb303 100644 --- a/companion/targets/windows/companion9x-msys.nsi.in +++ b/companion/targets/windows/companion-msys.nsi.in @@ -1,186 +1,186 @@ -;NSIS Modern User Interface -;Start Menu Folder Selection Example Script -;Written by Joost Verburg - -;-------------------------------- -;Include Modern UI - - !include "MUI2.nsh" - !include "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\FileAssociation.nsh" - -;-------------------------------- -;General - - ;Name and file - Name "companion9x" - OutFile "companion9xInstall_v@C9X_VERSION@.exe" - - ;Default installation folder - InstallDir "$PROGRAMFILES\companion9x" - - ;Get installation folder from registry if available - InstallDirRegKey HKCU "Software\companion9x" "" - - ;Compressor options - SetCompressor /FINAL /SOLID lzma - SetCompressorDictSize 64 - - ;Request application privileges for Windows Vista - RequestExecutionLevel admin - -;-------------------------------- -;Variables - - Var StartMenuFolder - -;-------------------------------- -;Interface Settings - - !define MUI_ABORTWARNING - -;-------------------------------- -;Pages - - !insertmacro MUI_PAGE_LICENSE "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt" - !insertmacro MUI_PAGE_COMPONENTS - !insertmacro MUI_PAGE_DIRECTORY - - ;Start Menu Folder Page Configuration - !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" - !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\companion9x" - !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" - - !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder - - !insertmacro MUI_PAGE_INSTFILES - - # These indented statements modify settings for MUI_PAGE_FINISH - !define MUI_FINISHPAGE_NOAUTOCLOSE - !define MUI_FINISHPAGE_RUN - !define MUI_FINISHPAGE_RUN_CHECKED - !define MUI_FINISHPAGE_RUN_TEXT "Launch companion9x" - !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink" - # !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED - # !define MUI_FINISHPAGE_SHOWREADME $INSTDIR\readme.txt - !insertmacro MUI_PAGE_FINISH - - !insertmacro MUI_UNPAGE_CONFIRM - !insertmacro MUI_UNPAGE_INSTFILES - -;-------------------------------- -;Languages - - !insertmacro MUI_LANGUAGE "English" - !insertmacro MUI_LANGUAGE "French" - -;-------------------------------- -;Installer Sections - -Section "companion9x" SecDummy - - SetOutPath "$INSTDIR" - - File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt" - File "companion9x.exe" - File "C:\Programs\xerces\src\.libs\libxerces-c-3-1.dll" - File "C:\MinGW\bin\libgcc_s_dw2-1.dll" - File "C:\MinGW\bin\mingwm10.dll" - File "C:\MinGW\bin\libstdc++-6.dll" - File "@QT_BINARY_DIR@\QtCore4.dll" - File "@QT_BINARY_DIR@\QtGui4.dll" - File "@QT_BINARY_DIR@\QtXml4.dll" - File "@QT_BINARY_DIR@\QtNetwork4.dll" - File "@QT_BINARY_DIR@\Phonon4.dll" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.exe" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.conf" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\libusb0.dll" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\dfu-util.exe" - - CreateDirectory "$INSTDIR\lang" - SetOutPath "$INSTDIR\lang" - File "*.qm" - - SetOutPath "$INSTDIR" - ;Store installation folder - WriteRegStr HKCU "Software\companion9x" "" $INSTDIR - - ;Associate with extentions ,bin and .hex - ${registerExtension} "$INSTDIR\companion9x.exe" ".bin" "BIN_File" - ${registerExtension} "$INSTDIR\companion9x.exe" ".hex" "HEX_File" - ${registerExtension} "$INSTDIR\companion9x.exe" ".companion9x" "EEPE_File" - ${registerExtension} "$INSTDIR\companion9x.exe" ".eepm" "EEPM_File" - - - ;Create uninstaller - WriteUninstaller "$INSTDIR\Uninstall.exe" - - !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - - ;Create shortcuts - CreateDirectory "$SMPROGRAMS\$StartMenuFolder" - CreateShortCut "$SMPROGRAMS\$StartMenuFolder\companion9x.lnk" "$INSTDIR\companion9x.exe" - CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" - - !insertmacro MUI_STARTMENU_WRITE_END - -SectionEnd - -;-------------------------------- -;Descriptions - - ;Language strings - LangString DESC_SecDummy ${LANG_ENGLISH} "companion9x EEPROM editor." - LangString DESC_SecDummy ${LANG_FRENCH} "companion9x editeur d'EEPROM" - - ;Assign language strings to sections - !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy) - !insertmacro MUI_FUNCTION_DESCRIPTION_END - -;-------------------------------- -;Uninstaller Section - -Section "Uninstall" - - ;ADD YOUR OWN FILES HERE... - - Delete "$INSTDIR\license.txt" - Delete "$INSTDIR\companion9x.exe" - Delete "$INSTDIR\libxerces-c-3-1.dll" - Delete "$INSTDIR\libgcc_s_dw2-1.dll" - Delete "$INSTDIR\mingwm10.dll" - Delete "$INSTDIR\libstdc++-6.dll" - Delete "$INSTDIR\QtCore4.dll" - Delete "$INSTDIR\QtGui4.dll" - Delete "$INSTDIR\QtNetwork4.dll" - Delete "$INSTDIR\Phonon4.dll" - Delete "$INSTDIR\QtXml4.dll" - Delete "$INSTDIR\avrdude.exe" - Delete "$INSTDIR\avrdude.conf" - Delete "$INSTDIR\libusb0.dll" - Delete "$INSTDIR\dfu-util.exe" - Delete "$INSTDIR\Uninstall.exe" - - Delete "$INSTDIR\lang\*.*" - - RMDir "$INSTDIR\lang" - RMDir "$INSTDIR" - - ${unregisterExtension} ".bin" "BIN File" - ${unregisterExtension} ".hex" "HEX File" - ${unregisterExtension} ".eepm" "EEPE File" - ${unregisterExtension} ".companion9x" "EEPM File" - - !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder - - Delete "$SMPROGRAMS\$StartMenuFolder\companion9x.lnk" - Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" - RMDir "$SMPROGRAMS\$StartMenuFolder" - - DeleteRegKey /ifempty HKCU "Software\companion9x" - -SectionEnd - -Function LaunchLink - ExecShell "" "$INSTDIR\companion9x.exe" -FunctionEnd +;NSIS Modern User Interface +;Start Menu Folder Selection Example Script +;Written by Joost Verburg + +;-------------------------------- +;Include Modern UI + + !include "MUI2.nsh" + !include "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\FileAssociation.nsh" + +;-------------------------------- +;General + + ;Name and file + Name "openTx companion" + OutFile "companionInstall_v@C9X_VERSION@.exe" + + ;Default installation folder + InstallDir "$PROGRAMFILES\openTx companion" + + ;Get installation folder from registry if available + InstallDirRegKey HKCU "Software\companion9x" "" + + ;Compressor options + SetCompressor /FINAL /SOLID lzma + SetCompressorDictSize 64 + + ;Request application privileges for Windows Vista + RequestExecutionLevel admin + +;-------------------------------- +;Variables + + Var StartMenuFolder + +;-------------------------------- +;Interface Settings + + !define MUI_ABORTWARNING + +;-------------------------------- +;Pages + + !insertmacro MUI_PAGE_LICENSE "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt" + !insertmacro MUI_PAGE_COMPONENTS + !insertmacro MUI_PAGE_DIRECTORY + + ;Start Menu Folder Page Configuration + !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" + !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\companion9x" + !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" + + !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder + + !insertmacro MUI_PAGE_INSTFILES + + # These indented statements modify settings for MUI_PAGE_FINISH + !define MUI_FINISHPAGE_NOAUTOCLOSE + !define MUI_FINISHPAGE_RUN + !define MUI_FINISHPAGE_RUN_CHECKED + !define MUI_FINISHPAGE_RUN_TEXT "Launch companion" + !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink" + # !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED + # !define MUI_FINISHPAGE_SHOWREADME $INSTDIR\readme.txt + !insertmacro MUI_PAGE_FINISH + + !insertmacro MUI_UNPAGE_CONFIRM + !insertmacro MUI_UNPAGE_INSTFILES + +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" + !insertmacro MUI_LANGUAGE "French" + +;-------------------------------- +;Installer Sections + +Section "openTx companion" SecDummy + + SetOutPath "$INSTDIR" + + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt" + File "companion.exe" + File "C:\Programs\xerces\src\.libs\libxerces-c-3-1.dll" + File "C:\MinGW\bin\libgcc_s_dw2-1.dll" + File "C:\MinGW\bin\mingwm10.dll" + File "C:\MinGW\bin\libstdc++-6.dll" + File "@QT_BINARY_DIR@\QtCore4.dll" + File "@QT_BINARY_DIR@\QtGui4.dll" + File "@QT_BINARY_DIR@\QtXml4.dll" + File "@QT_BINARY_DIR@\QtNetwork4.dll" + File "@QT_BINARY_DIR@\Phonon4.dll" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.exe" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.conf" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\libusb0.dll" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\dfu-util.exe" + + CreateDirectory "$INSTDIR\lang" + SetOutPath "$INSTDIR\lang" + File "*.qm" + + SetOutPath "$INSTDIR" + ;Store installation folder + WriteRegStr HKCU "Software\companion9x" "" $INSTDIR + + ;Associate with extentions ,bin and .hex + ${registerExtension} "$INSTDIR\companion.exe" ".bin" "BIN_File" + ${registerExtension} "$INSTDIR\companion.exe" ".hex" "HEX_File" + ${registerExtension} "$INSTDIR\companion.exe" ".companion" "EEPE_File" + ${registerExtension} "$INSTDIR\companion.exe" ".eepm" "EEPM_File" + + + ;Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + + ;Create shortcuts + CreateDirectory "$SMPROGRAMS\$StartMenuFolder" + CreateShortCut "$SMPROGRAMS\$StartMenuFolder\companion.lnk" "$INSTDIR\companion.exe" + CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" + + !insertmacro MUI_STARTMENU_WRITE_END + +SectionEnd + +;-------------------------------- +;Descriptions + + ;Language strings + LangString DESC_SecDummy ${LANG_ENGLISH} "Models and settings editor for openTx" + LangString DESC_SecDummy ${LANG_FRENCH} "Editeur de réglages et modèles pour openTx" + + ;Assign language strings to sections + !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy) + !insertmacro MUI_FUNCTION_DESCRIPTION_END + +;-------------------------------- +;Uninstaller Section + +Section "Uninstall" + + ;ADD YOUR OWN FILES HERE... + + Delete "$INSTDIR\license.txt" + Delete "$INSTDIR\companion.exe" + Delete "$INSTDIR\libxerces-c-3-1.dll" + Delete "$INSTDIR\libgcc_s_dw2-1.dll" + Delete "$INSTDIR\mingwm10.dll" + Delete "$INSTDIR\libstdc++-6.dll" + Delete "$INSTDIR\QtCore4.dll" + Delete "$INSTDIR\QtGui4.dll" + Delete "$INSTDIR\QtNetwork4.dll" + Delete "$INSTDIR\Phonon4.dll" + Delete "$INSTDIR\QtXml4.dll" + Delete "$INSTDIR\avrdude.exe" + Delete "$INSTDIR\avrdude.conf" + Delete "$INSTDIR\libusb0.dll" + Delete "$INSTDIR\dfu-util.exe" + Delete "$INSTDIR\Uninstall.exe" + + Delete "$INSTDIR\lang\*.*" + + RMDir "$INSTDIR\lang" + RMDir "$INSTDIR" + + ${unregisterExtension} ".bin" "BIN File" + ${unregisterExtension} ".hex" "HEX File" + ${unregisterExtension} ".eepm" "EEPE File" + ${unregisterExtension} ".companion" "EEPM File" + + !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder + + Delete "$SMPROGRAMS\$StartMenuFolder\companion.lnk" + Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" + RMDir "$SMPROGRAMS\$StartMenuFolder" + + DeleteRegKey /ifempty HKCU "Software\companion9x" + +SectionEnd + +Function LaunchLink + ExecShell "" "$INSTDIR\companion.exe" +FunctionEnd diff --git a/companion/targets/windows/companion9x-vs.nsi.in b/companion/targets/windows/companion-vs.nsi.in similarity index 82% rename from companion/targets/windows/companion9x-vs.nsi.in rename to companion/targets/windows/companion-vs.nsi.in index 3e5950ada..340abc782 100644 --- a/companion/targets/windows/companion9x-vs.nsi.in +++ b/companion/targets/windows/companion-vs.nsi.in @@ -1,214 +1,214 @@ -;NSIS Modern User Interface -;Start Menu Folder Selection Example Script -;Written by Joost Verburg - -;-------------------------------- -;Include Modern UI - - !include "MUI2.nsh" - !include "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\FileAssociation.nsh" - -;-------------------------------- -;General - - ;Name and file - Name "companion9x" - OutFile "companion9xInstall_v@C9X_VERSION@.exe" - - ;Default installation folder - InstallDir "$PROGRAMFILES\companion9x" - - ;Get installation folder from registry if available - InstallDirRegKey HKCU "Software\companion9x" "" - - ;Compressor options - SetCompressor /FINAL /SOLID lzma - SetCompressorDictSize 64 - - ;Request application privileges for Windows Vista - RequestExecutionLevel admin - -;-------------------------------- -;Variables - - Var StartMenuFolder - -;-------------------------------- -;Interface Settings - - !define MUI_ABORTWARNING - -;-------------------------------- -;File Exists Macro - -; See http://nsis.sourceforge.net/Check_if_a_file_exists_at_compile_time for documentation -!macro !defineifexist _VAR_NAME _FILE_NAME - !tempfile _TEMPFILE - !ifdef NSIS_WIN32_MAKENSIS - ; Windows - cmd.exe - !system 'if exist "${_FILE_NAME}" echo !define ${_VAR_NAME} > "${_TEMPFILE}"' - !else - ; Posix - sh - !system 'if [ -e "${_FILE_NAME}" ]; then echo "!define ${_VAR_NAME}" > "${_TEMPFILE}"; fi' - !endif - !include '${_TEMPFILE}' - !delfile '${_TEMPFILE}' - !undef _TEMPFILE -!macroend -!define !defineifexist "!insertmacro !defineifexist" - -;-------------------------------- -;Pages - - !insertmacro MUI_PAGE_LICENSE "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt" - !insertmacro MUI_PAGE_COMPONENTS - !insertmacro MUI_PAGE_DIRECTORY - - ;Start Menu Folder Page Configuration - !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" - !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\companion9x" - !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" - - !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder - - !insertmacro MUI_PAGE_INSTFILES - - # These indented statements modify settings for MUI_PAGE_FINISH - !define MUI_FINISHPAGE_NOAUTOCLOSE - !define MUI_FINISHPAGE_RUN - !define MUI_FINISHPAGE_RUN_CHECKED - !define MUI_FINISHPAGE_RUN_TEXT "Launch companion9x" - !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink" - # !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED - # !define MUI_FINISHPAGE_SHOWREADME $INSTDIR\readme.txt - !insertmacro MUI_PAGE_FINISH - - !insertmacro MUI_UNPAGE_CONFIRM - !insertmacro MUI_UNPAGE_INSTFILES - -;-------------------------------- -;Languages - - !insertmacro MUI_LANGUAGE "English" - !insertmacro MUI_LANGUAGE "French" - -;-------------------------------- -;Installer Sections - -Section "companion9x" SecDummy - - SetOutPath "$INSTDIR" - - File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt" - File "Release\companion9x.exe" - ${!defineifexist} PTHREAD_WINDIR "C:\Programs\pthreads\Pre-built.2\lib\pthreadVC2.dll" - !ifdef PTHREAD_WINDIR - File "C:\Programs\pthreads\Pre-built.2\lib\pthreadVC2.dll" - !else - File "@SYSDIR@\system32\pthreadVC2.dll" - !endif - File "C:\Programs\xerces-vc\bin\xerces-c_3_1.dll" - File "C:\Programs\SDL\lib\SDL.dll" - File "@SYSDIR@\msvcp100.dll" - File "@SYSDIR@\msvcr100.dll" - File "@QT_BINARY_DIR@\QtCore4.dll" - File "@QT_BINARY_DIR@\QtGui4.dll" - File "@QT_BINARY_DIR@\QtNetwork4.dll" - File "@QT_BINARY_DIR@\Phonon4.dll" - File "@QT_BINARY_DIR@\QtXml4.dll" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.exe" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.conf" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\libusb0.dll" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\dfu-util.exe" - File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\libusb-1.0.dll" - - CreateDirectory "$INSTDIR\lang" - SetOutPath "$INSTDIR\lang" - File "*.qm" - - SetOutPath "$INSTDIR" - ;Store installation folder - WriteRegStr HKCU "Software\companion9x" "" $INSTDIR - - ;Associate with extentions ,bin and .hex - ${registerExtension} "$INSTDIR\companion9x.exe" ".bin" "BIN_File" - ${registerExtension} "$INSTDIR\companion9x.exe" ".hex" "HEX_File" - ${registerExtension} "$INSTDIR\companion9x.exe" ".companion9x" "EEPE_File" - ${registerExtension} "$INSTDIR\companion9x.exe" ".eepm" "EEPM_File" - - - ;Create uninstaller - WriteUninstaller "$INSTDIR\Uninstall.exe" - - !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - - ;Create shortcuts - CreateDirectory "$SMPROGRAMS\$StartMenuFolder" - CreateShortCut "$SMPROGRAMS\$StartMenuFolder\companion9x.lnk" "$INSTDIR\companion9x.exe" - CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" - - !insertmacro MUI_STARTMENU_WRITE_END - -SectionEnd - -;-------------------------------- -;Descriptions - - ;Language strings - LangString DESC_SecDummy ${LANG_ENGLISH} "companion9x EEPROM editor." - LangString DESC_SecDummy ${LANG_FRENCH} "companion9x editeur d'EEPROM" - - ;Assign language strings to sections - !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy) - !insertmacro MUI_FUNCTION_DESCRIPTION_END - -;-------------------------------- -;Uninstaller Section - -Section "Uninstall" - - ;ADD YOUR OWN FILES HERE... - - Delete "$INSTDIR\license.txt" - Delete "$INSTDIR\companion9x.exe" - Delete "$INSTDIR\pthreadVC2.dll" - Delete "$INSTDIR\xerces-c_3_1.dll" - Delete "$INSTDIR\SDL.dll" - Delete "$INSTDIR\msvcp100.dll" - Delete "$INSTDIR\msvcr100.dll" - Delete "$INSTDIR\QtCore4.dll" - Delete "$INSTDIR\QtGui4.dll" - Delete "$INSTDIR\QtXml4.dll" - Delete "$INSTDIR\QtNetwork4.dll" - Delete "$INSTDIR\Phonon4.dll" - Delete "$INSTDIR\avrdude.exe" - Delete "$INSTDIR\avrdude.conf" - Delete "$INSTDIR\libusb0.dll" - Delete "$INSTDIR\dfu-util.exe" - Delete "$INSTDIR\libusb-1.0.dll" - Delete "$INSTDIR\Uninstall.exe" - - Delete "$INSTDIR\lang\*.*" - - RMDir "$INSTDIR\lang" - RMDir "$INSTDIR" - - ${unregisterExtension} ".bin" "BIN File" - ${unregisterExtension} ".hex" "HEX File" - ${unregisterExtension} ".eepm" "EEPE File" - ${unregisterExtension} ".companion9x" "EEPM File" - - !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder - - Delete "$SMPROGRAMS\$StartMenuFolder\companion9x.lnk" - Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" - RMDir "$SMPROGRAMS\$StartMenuFolder" - - DeleteRegKey /ifempty HKCU "Software\companion9x" - -SectionEnd - -Function LaunchLink - ExecShell "" "$INSTDIR\companion9x.exe" -FunctionEnd +;NSIS Modern User Interface +;Start Menu Folder Selection Example Script +;Written by Joost Verburg + +;-------------------------------- +;Include Modern UI + + !include "MUI2.nsh" + !include "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\FileAssociation.nsh" + +;-------------------------------- +;General + + ;Name and file + Name "openTx companion" + OutFile "companionInstall_v@C9X_VERSION@.exe" + + ;Default installation folder + InstallDir "$PROGRAMFILES\openTx companion" + + ;Get installation folder from registry if available + InstallDirRegKey HKCU "Software\companion9x" "" + + ;Compressor options + SetCompressor /FINAL /SOLID lzma + SetCompressorDictSize 64 + + ;Request application privileges for Windows Vista + RequestExecutionLevel admin + +;-------------------------------- +;Variables + + Var StartMenuFolder + +;-------------------------------- +;Interface Settings + + !define MUI_ABORTWARNING + +;-------------------------------- +;File Exists Macro + +; See http://nsis.sourceforge.net/Check_if_a_file_exists_at_compile_time for documentation +!macro !defineifexist _VAR_NAME _FILE_NAME + !tempfile _TEMPFILE + !ifdef NSIS_WIN32_MAKENSIS + ; Windows - cmd.exe + !system 'if exist "${_FILE_NAME}" echo !define ${_VAR_NAME} > "${_TEMPFILE}"' + !else + ; Posix - sh + !system 'if [ -e "${_FILE_NAME}" ]; then echo "!define ${_VAR_NAME}" > "${_TEMPFILE}"; fi' + !endif + !include '${_TEMPFILE}' + !delfile '${_TEMPFILE}' + !undef _TEMPFILE +!macroend +!define !defineifexist "!insertmacro !defineifexist" + +;-------------------------------- +;Pages + + !insertmacro MUI_PAGE_LICENSE "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt" + !insertmacro MUI_PAGE_COMPONENTS + !insertmacro MUI_PAGE_DIRECTORY + + ;Start Menu Folder Page Configuration + !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" + !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\companion9x" + !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" + + !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder + + !insertmacro MUI_PAGE_INSTFILES + + # These indented statements modify settings for MUI_PAGE_FINISH + !define MUI_FINISHPAGE_NOAUTOCLOSE + !define MUI_FINISHPAGE_RUN + !define MUI_FINISHPAGE_RUN_CHECKED + !define MUI_FINISHPAGE_RUN_TEXT "Launch companion" + !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink" + # !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED + # !define MUI_FINISHPAGE_SHOWREADME $INSTDIR\readme.txt + !insertmacro MUI_PAGE_FINISH + + !insertmacro MUI_UNPAGE_CONFIRM + !insertmacro MUI_UNPAGE_INSTFILES + +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" + !insertmacro MUI_LANGUAGE "French" + +;-------------------------------- +;Installer Sections + +Section "openTx companion" SecDummy + + SetOutPath "$INSTDIR" + + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\license.txt" + File "Release\companion.exe" + ${!defineifexist} PTHREAD_WINDIR "C:\Programs\pthreads\Pre-built.2\lib\pthreadVC2.dll" + !ifdef PTHREAD_WINDIR + File "C:\Programs\pthreads\Pre-built.2\lib\pthreadVC2.dll" + !else + File "@SYSDIR@\system32\pthreadVC2.dll" + !endif + File "C:\Programs\xerces-vc\bin\xerces-c_3_1.dll" + File "C:\Programs\SDL\lib\SDL.dll" + File "@SYSDIR@\msvcp100.dll" + File "@SYSDIR@\msvcr100.dll" + File "@QT_BINARY_DIR@\QtCore4.dll" + File "@QT_BINARY_DIR@\QtGui4.dll" + File "@QT_BINARY_DIR@\QtNetwork4.dll" + File "@QT_BINARY_DIR@\Phonon4.dll" + File "@QT_BINARY_DIR@\QtXml4.dll" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.exe" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\avrdude.conf" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\libusb0.dll" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\dfu-util.exe" + File "@CMAKE_CURRENT_SOURCE_DIR@\..\targets\windows\libusb-1.0.dll" + + CreateDirectory "$INSTDIR\lang" + SetOutPath "$INSTDIR\lang" + File "*.qm" + + SetOutPath "$INSTDIR" + ;Store installation folder + WriteRegStr HKCU "Software\companion9x" "" $INSTDIR + + ;Associate with extentions ,bin and .hex + ${registerExtension} "$INSTDIR\companion.exe" ".bin" "BIN_File" + ${registerExtension} "$INSTDIR\companion.exe" ".hex" "HEX_File" + ${registerExtension} "$INSTDIR\companion.exe" ".companion" "EEPE_File" + ${registerExtension} "$INSTDIR\companion.exe" ".eepm" "EEPM_File" + + + ;Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + + ;Create shortcuts + CreateDirectory "$SMPROGRAMS\$StartMenuFolder" + CreateShortCut "$SMPROGRAMS\$StartMenuFolder\companion.lnk" "$INSTDIR\companion.exe" + CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" + + !insertmacro MUI_STARTMENU_WRITE_END + +SectionEnd + +;-------------------------------- +;Descriptions + + ;Language strings + LangString DESC_SecDummy ${LANG_ENGLISH} "Models and settings editor for openTx" + LangString DESC_SecDummy ${LANG_FRENCH} "Editeur de réglages et modèles pour openTx" + + ;Assign language strings to sections + !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy) + !insertmacro MUI_FUNCTION_DESCRIPTION_END + +;-------------------------------- +;Uninstaller Section + +Section "Uninstall" + + ;ADD YOUR OWN FILES HERE... + + Delete "$INSTDIR\license.txt" + Delete "$INSTDIR\companion.exe" + Delete "$INSTDIR\pthreadVC2.dll" + Delete "$INSTDIR\xerces-c_3_1.dll" + Delete "$INSTDIR\SDL.dll" + Delete "$INSTDIR\msvcp100.dll" + Delete "$INSTDIR\msvcr100.dll" + Delete "$INSTDIR\QtCore4.dll" + Delete "$INSTDIR\QtGui4.dll" + Delete "$INSTDIR\QtXml4.dll" + Delete "$INSTDIR\QtNetwork4.dll" + Delete "$INSTDIR\Phonon4.dll" + Delete "$INSTDIR\avrdude.exe" + Delete "$INSTDIR\avrdude.conf" + Delete "$INSTDIR\libusb0.dll" + Delete "$INSTDIR\dfu-util.exe" + Delete "$INSTDIR\libusb-1.0.dll" + Delete "$INSTDIR\Uninstall.exe" + + Delete "$INSTDIR\lang\*.*" + + RMDir "$INSTDIR\lang" + RMDir "$INSTDIR" + + ${unregisterExtension} ".bin" "BIN File" + ${unregisterExtension} ".hex" "HEX File" + ${unregisterExtension} ".eepm" "EEPE File" + ${unregisterExtension} ".companion" "EEPM File" + + !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder + + Delete "$SMPROGRAMS\$StartMenuFolder\companion.lnk" + Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" + RMDir "$SMPROGRAMS\$StartMenuFolder" + + DeleteRegKey /ifempty HKCU "Software\companion9x" + +SectionEnd + +Function LaunchLink + ExecShell "" "$INSTDIR\companion.exe" +FunctionEnd