pianobooster.nsi 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. ;NSIS Modern User Interface
  2. ;create the windows install exectuable
  3. ;Piano Booster
  4. ;--------------------------------
  5. ;Include Modern UI
  6. !include "MUI2.nsh"
  7. ;--------------------------------
  8. ;General
  9. ; The name of the installer
  10. Name "Piano Booster"
  11. ; The file to write
  12. OutFile "PianoBoosterInstall.exe"
  13. ; The default installation directory
  14. InstallDir "$PROGRAMFILES\Piano Booster"
  15. ; Registry key to check for directory (so if you install again, it will
  16. ; overwrite the old one automatically)
  17. InstallDirRegKey HKCU "Software\NSIS_PianoBooster" ""
  18. ;Request application privileges for Windows Vista
  19. RequestExecutionLevel admin
  20. ;--------------------------------
  21. ;Variables
  22. Var StartMenuFolder
  23. ;--------------------------------
  24. ;Interface Settings
  25. !define MUI_ABORTWARNING
  26. ;--------------------------------
  27. ;Pages
  28. !insertmacro MUI_PAGE_WELCOME
  29. #!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
  30. #!insertmacro MUI_PAGE_COMPONENTS
  31. !insertmacro MUI_PAGE_DIRECTORY
  32. ;Start Menu Folder Page Configuration
  33. !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
  34. !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\NSIS_PianoBooster"
  35. !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
  36. !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
  37. !insertmacro MUI_PAGE_INSTFILES
  38. !insertmacro MUI_PAGE_FINISH
  39. !insertmacro MUI_UNPAGE_WELCOME
  40. !insertmacro MUI_UNPAGE_CONFIRM
  41. !insertmacro MUI_UNPAGE_INSTFILES
  42. !insertmacro MUI_UNPAGE_FINISH
  43. ;--------------------------------
  44. ;Languages
  45. !insertmacro MUI_LANGUAGE "English"
  46. ;--------------------------------
  47. ;Installer Sections
  48. Section "Dummy Section" SecDummy
  49. SetOutPath "$INSTDIR"
  50. ; Put file there
  51. File FilesForRelease\pianobooster.exe
  52. #File FilesForRelease\libfluidsynth-1.dll
  53. File FilesForRelease\QtCore4.dll
  54. File FilesForRelease\QtGui4.dll
  55. File FilesForRelease\QtXml4.dll
  56. File FilesForRelease\QtOpenGL4.dll
  57. File FilesForRelease\mingwm10.dll
  58. CreateDirectory $INSTDIR\doc
  59. SetOutPath $INSTDIR\doc
  60. File FilesForRelease\README.txt
  61. File FilesForRelease\license.txt
  62. File FilesForRelease\gplv3.txt
  63. SetOutPath $INSTDIR
  64. ; Write the installation path into the registry
  65. WriteRegStr HKCU SOFTWARE\NSIS_PianoBooster "" "$INSTDIR"
  66. ;Create uninstaller
  67. WriteUninstaller "$INSTDIR\Uninstall.exe"
  68. !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
  69. ;Create shortcuts
  70. CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
  71. CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Piano Booster.lnk" "$INSTDIR\pianobooster.exe" "" "$INSTDIR\pianobooster.exe" 0
  72. CreateShortCut "$SMPROGRAMS\$StartMenuFolder\ReadMe.lnk" "$INSTDIR\doc\ReadMe.txt" "" "$INSTDIR\doc\ReadMe.txt" 0
  73. CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
  74. !insertmacro MUI_STARTMENU_WRITE_END
  75. SectionEnd
  76. ;--------------------------------
  77. ;Descriptions
  78. ;Language strings
  79. ; LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
  80. ;Assign language strings to sections
  81. ; !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  82. ; !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
  83. ; !insertmacro MUI_FUNCTION_DESCRIPTION_END
  84. ;--------------------------------
  85. ;Uninstaller Section
  86. Section "Uninstall"
  87. ; Remove files and uninstaller
  88. Delete $INSTDIR\pianobooster.exe
  89. Delete $INSTDIR\mingwm10.dll
  90. #Delete $INSTDIR\libfluidsynth-1.dll
  91. Delete $INSTDIR\QtCore4.dll
  92. Delete $INSTDIR\QtGui4.dll
  93. Delete $INSTDIR\QtXml4.dll
  94. Delete $INSTDIR\QtOpenGL4.dll
  95. Delete $INSTDIR\mingwm10.dll
  96. Delete $INSTDIR\doc\README.txt
  97. Delete $INSTDIR\doc\license.txt
  98. Delete $INSTDIR\doc\gplv3.txt
  99. RMDir "$INSTDIR\doc"
  100. Delete $INSTDIR\uninstall.exe
  101. RMDir "$INSTDIR"
  102. !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
  103. ; Remove shortcuts, if any
  104. Delete "$SMPROGRAMS\$StartMenuFolder\*.*"
  105. RMDir "$SMPROGRAMS\$StartMenuFolder"
  106. ; Remove registry keys
  107. DeleteRegKey /ifempty HKCU "Software\NSIS_PianoBooster"
  108. SectionEnd