Commit 08027c2f authored by DonLakeFlyer's avatar DonLakeFlyer

Support for custom build installers for Windows/OSX

Correctly supports application name and branding changes
parent ae04500d
...@@ -27,18 +27,12 @@ installer { ...@@ -27,18 +27,12 @@ installer {
# qgroundcontrol.app file. If you specify a path to the .app file the symbolic # qgroundcontrol.app file. If you specify a path to the .app file the symbolic
# links to plugins will not be created correctly. # links to plugins will not be created correctly.
QMAKE_POST_LINK += && mkdir -p $${DESTDIR}/package QMAKE_POST_LINK += && mkdir -p $${DESTDIR}/package
QMAKE_POST_LINK += && cd $${DESTDIR} && $$dirname(QMAKE_QMAKE)/macdeployqt QGroundControl.app -appstore-compliant -verbose=2 -qmldir=$${BASEDIR}/src QMAKE_POST_LINK += && cd $${DESTDIR} && $$dirname(QMAKE_QMAKE)/macdeployqt $${TARGET}.app -appstore-compliant -verbose=2 -qmldir=$${BASEDIR}/src
QMAKE_POST_LINK += && cd $${OUT_PWD} QMAKE_POST_LINK += && cd $${OUT_PWD}
QMAKE_POST_LINK += && hdiutil create -verbose -stretch 4g -layout SPUD -srcfolder $${DESTDIR}/QGroundControl.app -volname QGroundControl $${DESTDIR}/package/QGroundControl.dmg QMAKE_POST_LINK += && hdiutil create -verbose -stretch 4g -layout SPUD -srcfolder $${DESTDIR}/$${TARGET}.app -volname $${TARGET} $${DESTDIR}/package/$${TARGET}.dmg
} }
WindowsBuild { WindowsBuild {
# The pdb moving command are commented out for now since we are including the .pdb in the installer. This makes it much QMAKE_POST_LINK += $$escape_expand(\\n) cd $$BASEDIR_WIN && $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /DAPPNAME="\"$${QGC_APP_NAME}\"" /DEXENAME="\"$${TARGET}\"" /DORGNAME="\"$${QGC_ORG_NAME}\"" /DDESTDIR=$${DESTDIR} /NOCD "\"/XOutFile $${DESTDIR_WIN}\\$${TARGET}-installer.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
# easier to debug user crashes.
#QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY $${DESTDIR_WIN}\\qgroundcontrol.pdb
#QMAKE_POST_LINK += $$escape_expand(\\n) del $${DESTDIR_WIN}\\qgroundcontrol.pdb
QMAKE_POST_LINK += $$escape_expand(\\n) cd $$BASEDIR_WIN && $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /NOCD "\"/XOutFile $${DESTDIR_WIN}\\QGroundControl-installer.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
#QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY qgroundcontrol.pdb $${DESTDIR_WIN}
#QMAKE_POST_LINK += $$escape_expand(\\n) del qgroundcontrol.pdb
OTHER_FILES += deploy/qgroundcontrol_installer.nsi OTHER_FILES += deploy/qgroundcontrol_installer.nsi
} }
LinuxBuild { LinuxBuild {
......
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
${EndIf} ${EndIf}
!macroend !macroend
Name "QGroundcontrol" Name "${APPNAME}"
Var StartMenuFolder Var StartMenuFolder
InstallDir $PROGRAMFILES\qgroundcontrol InstallDir "$PROGRAMFILES\${APPNAME}"
SetCompressor /SOLID /FINAL lzma SetCompressor /SOLID /FINAL lzma
...@@ -58,23 +58,23 @@ SetCompressor /SOLID /FINAL lzma ...@@ -58,23 +58,23 @@ SetCompressor /SOLID /FINAL lzma
!insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "English"
Section Section
ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QGroundControl" "UninstallString" ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString"
StrCmp $R0 "" doinstall StrCmp $R0 "" doinstall
ExecWait "$R0 /S _?=$INSTDIR" ExecWait "$R0 /S _?=$INSTDIR"
IntCmp $0 0 doinstall IntCmp $0 0 doinstall
MessageBox MB_OK|MB_ICONEXCLAMATION \ MessageBox MB_OK|MB_ICONEXCLAMATION \
"Could not remove a previously installed QGroundControl version.$\n$\nPlease remove it before continuing." "Could not remove a previously installed ${APPNAME} version.$\n$\nPlease remove it before continuing."
Abort Abort
doinstall: doinstall:
SetOutPath $INSTDIR SetOutPath $INSTDIR
File /r /x qgroundcontrol.pdb /x qgroundcontrol.lib /x qgroundcontrol.exp build_windows_install\release\*.* File /r /x ${EXENAME}.pdb /x ${EXENAME}.lib /x ${EXENAME}.exp ${DESTDIR}\*.*
File deploy\px4driver.msi File deploy\px4driver.msi
WriteUninstaller $INSTDIR\QGroundControl_uninstall.exe WriteUninstaller $INSTDIR\${EXENAME}-Uninstall.exe
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QGroundControl" "DisplayName" "QGroundControl" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QGroundControl" "UninstallString" "$\"$INSTDIR\QGroundControl_uninstall.exe$\"" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$\"$INSTDIR\${EXENAME}-Uninstall.exe$\""
; Only attempt to install the PX4 driver if the version isn't present ; Only attempt to install the PX4 driver if the version isn't present
!define ROOTKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\434608CF2B6E31F0DDBA5C511053F957B55F098E" !define ROOTKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\434608CF2B6E31F0DDBA5C511053F957B55F098E"
...@@ -105,17 +105,17 @@ Section "Uninstall" ...@@ -105,17 +105,17 @@ Section "Uninstall"
RMDir /r /REBOOTOK $INSTDIR RMDir /r /REBOOTOK $INSTDIR
RMDir /r /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\" RMDir /r /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\"
SetShellVarContext current SetShellVarContext current
RMDir /r /REBOOTOK "$APPDATA\QGROUNDCONTROL.ORG\" RMDir /r /REBOOTOK "$APPDATA\${ORGNAME}\"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QGroundControl" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
SectionEnd SectionEnd
Section "create Start Menu Shortcuts" Section "create Start Menu Shortcuts"
SetShellVarContext all SetShellVarContext all
CreateDirectory "$SMPROGRAMS\$StartMenuFolder" CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\QGroundControl.lnk" "$INSTDIR\qgroundcontrol.exe" "" "$INSTDIR\qgroundcontrol.exe" 0 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${APPNAME}.lnk" "$INSTDIR\${EXENAME}.exe" "" "$INSTDIR\${EXENAME}.exe" 0
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\QGroundControl (GPU Compatibility Mode).lnk" "$INSTDIR\qgroundcontrol.exe" "-angle" "$INSTDIR\qgroundcontrol.exe" 0 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${APPNAME} (GPU Compatibility Mode).lnk" "$INSTDIR\${EXENAME}.exe" "-angle" "$INSTDIR\${EXENAME}.exe" 0
!insertmacro DemoteShortCut "$SMPROGRAMS\$StartMenuFolder\QGroundControl (GPU Compatibility Mode).lnk" !insertmacro DemoteShortCut "$SMPROGRAMS\$StartMenuFolder\${APPNAME} (GPU Compatibility Mode).lnk"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\QGroundControl (GPU Safe Mode).lnk" "$INSTDIR\qgroundcontrol.exe" "-swrast" "$INSTDIR\qgroundcontrol.exe" 0 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${APPNAME} (GPU Safe Mode).lnk" "$INSTDIR\${EXENAME}.exe" "-swrast" "$INSTDIR\${EXENAME}.exe" 0
!insertmacro DemoteShortCut "$SMPROGRAMS\$StartMenuFolder\QGroundControl (GPU Safe Mode).lnk" !insertmacro DemoteShortCut "$SMPROGRAMS\$StartMenuFolder\${APPNAME} (GPU Safe Mode).lnk"
SectionEnd SectionEnd
...@@ -72,6 +72,17 @@ WindowsBuild { ...@@ -72,6 +72,17 @@ WindowsBuild {
RC_ICONS = resources/icons/qgroundcontrol.ico RC_ICONS = resources/icons/qgroundcontrol.ico
} }
#
# Branding
#
QGC_APP_NAME = "QGroundControl Foo"
QGC_ORG_NAME = "QGroundControl.org"
QGC_ORG_DOMAIN = "org.qgroundcontrol"
QGC_APP_DESCRIPTION = "Open source ground control app provided by QGroundControl dev team"
QGC_APP_COPYRIGHT = "Copyright (C) 2017 QGroundControl Development Team. All rights reserved."
# Load additional config flags from user_config.pri # Load additional config flags from user_config.pri
exists(user_config.pri):infile(user_config.pri, CONFIG) { exists(user_config.pri):infile(user_config.pri, CONFIG) {
CONFIG += $$fromfile(user_config.pri, CONFIG) CONFIG += $$fromfile(user_config.pri, CONFIG)
...@@ -106,6 +117,14 @@ contains (CONFIG, QGC_DISABLE_CUSTOM_BUILD) { ...@@ -106,6 +117,14 @@ contains (CONFIG, QGC_DISABLE_CUSTOM_BUILD) {
} }
} }
WindowsBuild {
# Sets up application properties
QMAKE_TARGET_COMPANY = "$${QGC_ORG_NAME}"
QMAKE_TARGET_DESCRIPTION = "$${QGC_APP_DESCRIPTION}"
QMAKE_TARGET_COPYRIGHT = "$${QGC_APP_COPYRIGHT}"
QMAKE_TARGET_PRODUCT = "$${QGC_APP_NAME}"
}
# #
# Plugin configuration # Plugin configuration
# #
...@@ -225,15 +244,6 @@ ReleaseBuild { ...@@ -225,15 +244,6 @@ ReleaseBuild {
QT.testlib.CONFIG -= console QT.testlib.CONFIG -= console
} }
#
# Branding
#
QMAKE_TARGET_COMPANY = "qgroundcontrol.org"
QMAKE_TARGET_DESCRIPTION = "Open source ground control app provided by QGroundControl dev team"
QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2016 QGroundControl Development Team. All rights reserved."
QMAKE_TARGET_PRODUCT = "QGroundControl"
# #
# Build-specific settings # Build-specific settings
# #
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment