qgroundcontrol_installer.nsi 1.55 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
Name "QGroundcontrol"

InstallDir $PROGRAMFILES\qgroundcontrol

Page license 
Page directory
Page components
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles

12
LicenseData license.txt
13

14
Section
15
  SetOutPath $INSTDIR
16
  File /r build_windows_install\release\*.*
Don Gagne's avatar
Don Gagne committed
17
  File deploy\px4driver.msi
pixhawk's avatar
pixhawk committed
18
  WriteUninstaller $INSTDIR\QGroundControl_uninstall.exe
19 20
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QGroundControl" "DisplayName" "QGroundControl"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QGroundControl" "UninstallString" "$\"$INSTDIR\QGroundControl_uninstall.exe$\""
Don Gagne's avatar
Don Gagne committed
21
  ExecWait '"msiexec" /i "px4driver.msi"'
22 23 24
SectionEnd 

Section "Uninstall"
25
  SetShellVarContext all
pixhawk's avatar
pixhawk committed
26
  Delete $INSTDIR\QGroundControl_uninstall.exe
Don Gagne's avatar
Don Gagne committed
27 28
  RMDir /r /REBOOTOK $INSTDIR
  RMDir /r /REBOOTOK "$SMPROGRAMS\QGroundControl\"
29
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QGroundControl"
30 31 32
SectionEnd

Section "create Start Menu Shortcuts"
33
  SetShellVarContext all
pixhawk's avatar
pixhawk committed
34 35
  CreateDirectory "$SMPROGRAMS\QGroundControl"
  CreateShortCut "$SMPROGRAMS\QGroundControl\QGroundControl.lnk" "$INSTDIR\qgroundcontrol.exe" "" "$INSTDIR\qgroundcontrol.exe" 0
36 37 38 39 40 41 42 43 44 45 46
SectionEnd

Function .onInit
  ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QGroundControl" "UninstallString"
  StrCmp $R0 "" done
 
  MessageBox MB_OK|MB_ICONEXCLAMATION \
  	"QGroundControl is already installed. $\n$\nYou must uninstall the previous version before installing a new one."
  Abort
done: 
FunctionEnd