mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 17:25:13 +03:00
VERSION_FAMILY dynamic string introduced
This commit is contained in:
parent
edf1dbc0b7
commit
2f54e85421
10 changed files with 33 additions and 32 deletions
|
@ -5,6 +5,7 @@ SET(VERSION_MINOR "2")
|
||||||
SET(VERSION_REVISION "0")
|
SET(VERSION_REVISION "0")
|
||||||
SET(VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
|
SET(VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
|
||||||
|
|
||||||
|
SET(VERSION_FAMILY ${VERSION_MAJOR}.${VERSION_MINOR})
|
||||||
SET(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_SUFFIX})
|
SET(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_SUFFIX})
|
||||||
MESSAGE(STATUS "OpenTX Companion ${VERSION}")
|
MESSAGE(STATUS "OpenTX Companion ${VERSION}")
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
QStringList strl = QApplication::arguments();
|
QStringList strl = QApplication::arguments();
|
||||||
if (strl.contains("--version")) {
|
if (strl.contains("--version")) {
|
||||||
printf("%s\n", C9X_VERSION);
|
printf("%s\n", VERSION);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
Encoding=UTF-8
|
Encoding=UTF-8
|
||||||
Name=Companion @C9X_VERSION@
|
Name=Companion @VERSION@
|
||||||
GenericName=Transmitter Companion App
|
GenericName=Transmitter Companion App
|
||||||
Comment=The Ultimate Transmitter Companion
|
Comment=The Ultimate Transmitter Companion
|
||||||
Icon=@COMPANION_NAME@
|
Icon=@COMPANION_NAME@
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Automatically generated file (CMake) - do not edit
|
// Automatically generated file (CMake) - do not edit
|
||||||
#define DATE_STR "@DATE@"
|
#define DATE_STR "@DATE@"
|
||||||
#define TIME_STR "@TIME@"
|
#define TIME_STR "@TIME@"
|
||||||
#define VERS_STR "@C9X_VERSION@"
|
#define VERS_STR "@VERSION@"
|
||||||
|
|
|
@ -278,7 +278,7 @@ void MainWindow::closeUpdatesWaitDialog()
|
||||||
void MainWindow::checkForCompanionUpdateFinished(QNetworkReply * reply)
|
void MainWindow::checkForCompanionUpdateFinished(QNetworkReply * reply)
|
||||||
{
|
{
|
||||||
QByteArray qba = reply->readAll();
|
QByteArray qba = reply->readAll();
|
||||||
int i = qba.indexOf("C9X_VERSION");
|
int i = qba.indexOf("VERSION");
|
||||||
if (i>0) {
|
if (i>0) {
|
||||||
QString version = qba.mid(i+14, qba.indexOf("\"", i+14)-i-14);
|
QString version = qba.mid(i+14, qba.indexOf("\"", i+14)-i-14);
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ void MainWindow::checkForCompanionUpdateFinished(QNetworkReply * reply)
|
||||||
|
|
||||||
int vnum = version2index(version);
|
int vnum = version2index(version);
|
||||||
|
|
||||||
QString c9xversion = QString(C9X_VERSION);
|
QString c9xversion = QString(VERSION);
|
||||||
int c9xver = version2index(c9xversion);
|
int c9xver = version2index(c9xversion);
|
||||||
|
|
||||||
if (c9xver < vnum) {
|
if (c9xver < vnum) {
|
||||||
|
@ -899,7 +899,7 @@ void MainWindow::about()
|
||||||
aboutStr.append("<br/><br/>");
|
aboutStr.append("<br/><br/>");
|
||||||
aboutStr.append(tr("If you've found this program useful, please support by <a href='%1'>donating</a>").arg(DONATE_STR));
|
aboutStr.append(tr("If you've found this program useful, please support by <a href='%1'>donating</a>").arg(DONATE_STR));
|
||||||
aboutStr.append("<br/><br/>");
|
aboutStr.append("<br/><br/>");
|
||||||
aboutStr.append(QString("Version %1, %2").arg(C9X_VERSION).arg(__DATE__));
|
aboutStr.append(QString("Version %1, %2").arg(VERSION).arg(__DATE__));
|
||||||
aboutStr.append("<br/><br/>");
|
aboutStr.append("<br/><br/>");
|
||||||
aboutStr.append(tr("Copyright OpenTX Team") + "<br/>© 2011-2015<br/>");
|
aboutStr.append(tr("Copyright OpenTX Team") + "<br/>© 2011-2015<br/>");
|
||||||
QMessageBox msgBox(this);
|
QMessageBox msgBox(this);
|
||||||
|
@ -930,7 +930,7 @@ void MainWindow::updateMenus()
|
||||||
updateLanguageActions();
|
updateLanguageActions();
|
||||||
updateIconSizeActions();
|
updateIconSizeActions();
|
||||||
updateIconThemeActions();
|
updateIconThemeActions();
|
||||||
setWindowTitle(tr("OpenTX Companion %1 - Radio: %2 - Profile: %3").arg(C9X_VERSION).arg(GetCurrentFirmware()->getName()).arg(g.profile[g.id()].name()));
|
setWindowTitle(tr("OpenTX Companion %1 - Radio: %2 - Profile: %3").arg(VERSION).arg(GetCurrentFirmware()->getName()).arg(g.profile[g.id()].name()));
|
||||||
}
|
}
|
||||||
|
|
||||||
MdiChild *MainWindow::createMdiChild()
|
MdiChild *MainWindow::createMdiChild()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
Encoding=UTF-8
|
Encoding=UTF-8
|
||||||
Name=Simulator @C9X_VERSION@
|
Name=Simulator @VERSION@
|
||||||
GenericName=Transmitter Simulator App
|
GenericName=Transmitter Simulator App
|
||||||
Comment=The Ultimate Transmitter Simulator
|
Comment=The Ultimate Transmitter Simulator
|
||||||
Icon=@COMPANION_NAME@
|
Icon=@COMPANION_NAME@
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#define C9X_VERSION "@C9X_VERSION@"
|
#define VERSION "@VERSION@"
|
||||||
#define SIMULATOR_LIB_SEARCH_PATH "@SIMULATOR_LIB_PATH@"
|
#define SIMULATOR_LIB_SEARCH_PATH "@SIMULATOR_LIB_PATH@"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
;Name and file
|
;Name and file
|
||||||
Name "OpenTX companion"
|
Name "OpenTX companion"
|
||||||
OutFile "companion-windows-v@C9X_VERSION@.exe"
|
OutFile "companion-windows-v@VERSION@.exe"
|
||||||
|
|
||||||
;Default installation folder
|
;Default installation folder
|
||||||
InstallDir "$PROGRAMFILES\OpenTX companion"
|
InstallDir "$PROGRAMFILES\OpenTX companion"
|
||||||
|
|
|
@ -12,14 +12,14 @@
|
||||||
;General
|
;General
|
||||||
|
|
||||||
;Name and file
|
;Name and file
|
||||||
Name "OpenTX Companion 2.1"
|
Name "OpenTX Companion @VERSION_FAMILY@"
|
||||||
OutFile "companion-windows-@C9X_VERSION@.exe"
|
OutFile "companion-windows-@VERSION@.exe"
|
||||||
|
|
||||||
;Default installation folder
|
;Default installation folder
|
||||||
InstallDir "$PROGRAMFILES\OpenTX\Companion 2.1"
|
InstallDir "$PROGRAMFILES\OpenTX\Companion @VERSION_FAMILY@"
|
||||||
|
|
||||||
;Get installation folder from registry if available
|
;Get installation folder from registry if available
|
||||||
InstallDirRegKey HKCU "Software\OpenTX\Companion 2.1" ""
|
InstallDirRegKey HKCU "Software\OpenTX\Companion @VERSION_FAMILY@" ""
|
||||||
|
|
||||||
;Compressor options
|
;Compressor options
|
||||||
SetCompressor /FINAL /SOLID lzma
|
SetCompressor /FINAL /SOLID lzma
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
|
|
||||||
;Start Menu Folder Page Configuration
|
;Start Menu Folder Page Configuration
|
||||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
|
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
|
||||||
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\OpenTX\Companion 2.1"
|
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\OpenTX\Companion @VERSION_FAMILY@"
|
||||||
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
|
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
|
||||||
|
|
||||||
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
|
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
!define MUI_FINISHPAGE_NOAUTOCLOSE
|
!define MUI_FINISHPAGE_NOAUTOCLOSE
|
||||||
!define MUI_FINISHPAGE_RUN
|
!define MUI_FINISHPAGE_RUN
|
||||||
!define MUI_FINISHPAGE_RUN_CHECKED
|
!define MUI_FINISHPAGE_RUN_CHECKED
|
||||||
!define MUI_FINISHPAGE_RUN_TEXT "Launch OpenTX Companion 2.1"
|
!define MUI_FINISHPAGE_RUN_TEXT "Launch OpenTX Companion @VERSION_FAMILY@"
|
||||||
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
|
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
|
||||||
# !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
|
# !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
|
||||||
# !define MUI_FINISHPAGE_SHOWREADME $INSTDIR\readme.txt
|
# !define MUI_FINISHPAGE_SHOWREADME $INSTDIR\readme.txt
|
||||||
|
@ -134,7 +134,7 @@ Section "OpenTX Companion" SecDummy
|
||||||
|
|
||||||
SetOutPath "$INSTDIR"
|
SetOutPath "$INSTDIR"
|
||||||
;Store installation folder
|
;Store installation folder
|
||||||
WriteRegStr HKCU "Software\OpenTX\Companion 2.1" "" $INSTDIR
|
WriteRegStr HKCU "Software\OpenTX\Companion @VERSION_FAMILY@" "" $INSTDIR
|
||||||
|
|
||||||
;Associate with extentions ,bin and .hex
|
;Associate with extentions ,bin and .hex
|
||||||
${registerExtension} "$INSTDIR\companion.exe" ".bin" "BIN_File"
|
${registerExtension} "$INSTDIR\companion.exe" ".bin" "BIN_File"
|
||||||
|
@ -147,20 +147,20 @@ Section "OpenTX Companion" SecDummy
|
||||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||||
|
|
||||||
;Registry information for add/remove programs
|
;Registry information for add/remove programs
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTX Companion 2.1" "DisplayName" "OpenTX Companion 2.1"
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTX Companion @VERSION_FAMILY@" "DisplayName" "OpenTX Companion @VERSION_FAMILY@"
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTX Companion 2.1" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTX Companion @VERSION_FAMILY@" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTX Companion 2.1" "DisplayIcon" "$\"$INSTDIR\companion.exe$\""
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTX Companion @VERSION_FAMILY@" "DisplayIcon" "$\"$INSTDIR\companion.exe$\""
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTX Companion 2.1" "Publisher" "OpenTX"
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTX Companion @VERSION_FAMILY@" "Publisher" "OpenTX"
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTX Companion 2.1" "URLInfoAbout" "http://www.open-tx.org"
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTX Companion @VERSION_FAMILY@" "URLInfoAbout" "http://www.open-tx.org"
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTX Companion 2.1" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S"
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTX Companion @VERSION_FAMILY@" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S"
|
||||||
|
|
||||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
||||||
|
|
||||||
;Create shortcuts
|
;Create shortcuts
|
||||||
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
|
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
|
||||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Companion 2.1.lnk" "$INSTDIR\companion.exe"
|
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Companion @VERSION_FAMILY@.lnk" "$INSTDIR\companion.exe"
|
||||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Firmware Simulator 2.1.lnk" "$INSTDIR\simulator.exe"
|
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Firmware Simulator @VERSION_FAMILY@.lnk" "$INSTDIR\simulator.exe"
|
||||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall Companion 2.1.lnk" "$INSTDIR\Uninstall.exe"
|
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall Companion @VERSION_FAMILY@.lnk" "$INSTDIR\Uninstall.exe"
|
||||||
|
|
||||||
!insertmacro MUI_STARTMENU_WRITE_END
|
!insertmacro MUI_STARTMENU_WRITE_END
|
||||||
|
|
||||||
|
@ -220,13 +220,13 @@ Section "Uninstall"
|
||||||
|
|
||||||
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
|
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
|
||||||
|
|
||||||
Delete "$SMPROGRAMS\$StartMenuFolder\Companion 2.1.lnk"
|
Delete "$SMPROGRAMS\$StartMenuFolder\Companion @VERSION_FAMILY@.lnk"
|
||||||
Delete "$SMPROGRAMS\$StartMenuFolder\Firmware Simulator 2.1.lnk"
|
Delete "$SMPROGRAMS\$StartMenuFolder\Firmware Simulator @VERSION_FAMILY@.lnk"
|
||||||
Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall Companion 2.1.lnk"
|
Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall Companion @VERSION_FAMILY@.lnk"
|
||||||
RMDir "$SMPROGRAMS\$StartMenuFolder"
|
RMDir "$SMPROGRAMS\$StartMenuFolder"
|
||||||
|
|
||||||
DeleteRegKey /ifempty HKCU "Software\OpenTX Companion 2.1"
|
DeleteRegKey /ifempty HKCU "Software\OpenTX Companion @VERSION_FAMILY@"
|
||||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTX Companion 2.1"
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTX Companion @VERSION_FAMILY@"
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
;Name and file
|
;Name and file
|
||||||
Name "OpenTX Simulator"
|
Name "OpenTX Simulator"
|
||||||
OutFile "simulator-windows-@C9X_VERSION@.exe"
|
OutFile "simulator-windows-@VERSION@.exe"
|
||||||
|
|
||||||
;Default installation folder
|
;Default installation folder
|
||||||
InstallDir "$PROGRAMFILES\OpenTX"
|
InstallDir "$PROGRAMFILES\OpenTX"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue