You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

qemu.nsi 7.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. ;!/usr/bin/makensis
  2. ; This NSIS script creates an installer for QEMU on Windows.
  3. ; Copyright (C) 2006-2012 Stefan Weil
  4. ;
  5. ; This program is free software: you can redistribute it and/or modify
  6. ; it under the terms of the GNU General Public License as published by
  7. ; the Free Software Foundation, either version 2 of the License, or
  8. ; (at your option) version 3 or any later version.
  9. ;
  10. ; This program is distributed in the hope that it will be useful,
  11. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ; GNU General Public License for more details.
  14. ;
  15. ; You should have received a copy of the GNU General Public License
  16. ; along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. ; NSIS_WIN32_MAKENSIS
  18. !define PRODUCT "QEMU"
  19. !define URL "https://www.qemu.org/"
  20. !define UNINST_EXE "$INSTDIR\qemu-uninstall.exe"
  21. !define UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}"
  22. !ifndef BINDIR
  23. !define BINDIR nsis.tmp
  24. !endif
  25. !ifndef SRCDIR
  26. !define SRCDIR .
  27. !endif
  28. !ifndef OUTFILE
  29. !define OUTFILE "qemu-setup.exe"
  30. !endif
  31. ; Optionally install documentation.
  32. !ifndef CONFIG_DOCUMENTATION
  33. !define CONFIG_DOCUMENTATION
  34. !endif
  35. ; Use maximum compression.
  36. SetCompressor /SOLID lzma
  37. !include "MUI2.nsh"
  38. ; The name of the installer.
  39. Name "QEMU"
  40. ; The file to write
  41. OutFile "${OUTFILE}"
  42. ; The default installation directory.
  43. !ifdef W64
  44. InstallDir $PROGRAMFILES64\qemu
  45. !else
  46. InstallDir $PROGRAMFILES\qemu
  47. !endif
  48. ; Registry key to check for directory (so if you install again, it will
  49. ; overwrite the old one automatically)
  50. !ifdef W64
  51. InstallDirRegKey HKLM "Software\qemu64" "Install_Dir"
  52. !else
  53. InstallDirRegKey HKLM "Software\qemu32" "Install_Dir"
  54. !endif
  55. ; Request administrator privileges for Windows Vista.
  56. RequestExecutionLevel admin
  57. ;--------------------------------
  58. ; Interface Settings.
  59. ;!define MUI_HEADERIMAGE "qemu-nsis.bmp"
  60. ; !define MUI_SPECIALBITMAP "qemu.bmp"
  61. !define MUI_ICON "${SRCDIR}\pc-bios\qemu-nsis.ico"
  62. !define MUI_UNICON "${SRCDIR}\pc-bios\qemu-nsis.ico"
  63. !define MUI_WELCOMEFINISHPAGE_BITMAP "${SRCDIR}\pc-bios\qemu-nsis.bmp"
  64. ; !define MUI_HEADERIMAGE_BITMAP "qemu-install.bmp"
  65. ; !define MUI_HEADERIMAGE_UNBITMAP "qemu-uninstall.bmp"
  66. ; !define MUI_COMPONENTSPAGE_SMALLDESC
  67. ; !define MUI_WELCOMEPAGE_TEXT "Insert text here.$\r$\n$\r$\n$\r$\n$_CLICK"
  68. ;--------------------------------
  69. ; Pages.
  70. !insertmacro MUI_PAGE_WELCOME
  71. !insertmacro MUI_PAGE_LICENSE "${SRCDIR}\COPYING"
  72. !insertmacro MUI_PAGE_COMPONENTS
  73. !insertmacro MUI_PAGE_DIRECTORY
  74. !insertmacro MUI_PAGE_INSTFILES
  75. !define MUI_FINISHPAGE_LINK "Visit the QEMU Wiki online!"
  76. !define MUI_FINISHPAGE_LINK_LOCATION "${URL}"
  77. !insertmacro MUI_PAGE_FINISH
  78. !insertmacro MUI_UNPAGE_CONFIRM
  79. !insertmacro MUI_UNPAGE_INSTFILES
  80. ;--------------------------------
  81. ; Languages.
  82. !insertmacro MUI_LANGUAGE "English"
  83. !insertmacro MUI_LANGUAGE "French"
  84. !insertmacro MUI_LANGUAGE "German"
  85. ;--------------------------------
  86. ; The stuff to install.
  87. ;
  88. ; Remember to keep the "Uninstall" section in sync.
  89. Section "${PRODUCT} (required)"
  90. SectionIn RO
  91. ; Set output path to the installation directory.
  92. SetOutPath "$INSTDIR"
  93. File "${SRCDIR}\Changelog"
  94. File "${SRCDIR}\COPYING"
  95. File "${SRCDIR}\COPYING.LIB"
  96. File "${SRCDIR}\README"
  97. File "${SRCDIR}\VERSION"
  98. File "${BINDIR}\*.bmp"
  99. File "${BINDIR}\*.bin"
  100. File "${BINDIR}\*.dtb"
  101. File "${BINDIR}\*.fd"
  102. File "${BINDIR}\*.img"
  103. File "${BINDIR}\*.lid"
  104. File "${BINDIR}\*.ndrv"
  105. File "${BINDIR}\*.rom"
  106. File "${BINDIR}\openbios-*"
  107. File /r "${BINDIR}\keymaps"
  108. !ifdef CONFIG_GTK
  109. File /r "${BINDIR}\share"
  110. !endif
  111. !ifdef W64
  112. SetRegView 64
  113. !endif
  114. ; Write the installation path into the registry
  115. WriteRegStr HKLM SOFTWARE\${PRODUCT} "Install_Dir" "$INSTDIR"
  116. ; Write the uninstall keys for Windows
  117. WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "QEMU"
  118. !ifdef DISPLAYVERSION
  119. WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "${DISPLAYVERSION}"
  120. !endif
  121. WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" '"${UNINST_EXE}"'
  122. WriteRegDWORD HKLM "${UNINST_KEY}" "NoModify" 1
  123. WriteRegDWORD HKLM "${UNINST_KEY}" "NoRepair" 1
  124. WriteUninstaller "qemu-uninstall.exe"
  125. SectionEnd
  126. Section "Tools" SectionTools
  127. SetOutPath "$INSTDIR"
  128. File "${BINDIR}\qemu-img.exe"
  129. File "${BINDIR}\qemu-io.exe"
  130. SectionEnd
  131. SectionGroup "System Emulations" SectionSystem
  132. !include "${BINDIR}\system-emulations.nsh"
  133. SectionGroupEnd
  134. !ifdef DLLDIR
  135. Section "Libraries (DLL)" SectionDll
  136. SetOutPath "$INSTDIR"
  137. File "${DLLDIR}\*.dll"
  138. SectionEnd
  139. !endif
  140. !ifdef CONFIG_DOCUMENTATION
  141. Section "Documentation" SectionDoc
  142. SetOutPath "$INSTDIR"
  143. File "${BINDIR}\qemu-doc.html"
  144. CreateDirectory "$SMPROGRAMS\${PRODUCT}"
  145. CreateShortCut "$SMPROGRAMS\${PRODUCT}\User Documentation.lnk" "$INSTDIR\qemu-doc.html" "" "$INSTDIR\qemu-doc.html" 0
  146. SectionEnd
  147. !endif
  148. ; Optional section (can be disabled by the user)
  149. Section "Start Menu Shortcuts" SectionMenu
  150. CreateDirectory "$SMPROGRAMS\${PRODUCT}"
  151. CreateShortCut "$SMPROGRAMS\${PRODUCT}\Uninstall.lnk" "${UNINST_EXE}" "" "${UNINST_EXE}" 0
  152. SectionEnd
  153. ;--------------------------------
  154. ; Uninstaller
  155. Section "Uninstall"
  156. ; Remove registry keys
  157. !ifdef W64
  158. SetRegView 64
  159. !endif
  160. DeleteRegKey HKLM "${UNINST_KEY}"
  161. DeleteRegKey HKLM SOFTWARE\${PRODUCT}
  162. ; Remove shortcuts, if any
  163. Delete "$SMPROGRAMS\${PRODUCT}\User Documentation.lnk"
  164. Delete "$SMPROGRAMS\${PRODUCT}\Technical Documentation.lnk"
  165. Delete "$SMPROGRAMS\${PRODUCT}\Uninstall.lnk"
  166. RMDir "$SMPROGRAMS\${PRODUCT}"
  167. ; Remove files and directories used
  168. Delete "$INSTDIR\Changelog"
  169. Delete "$INSTDIR\COPYING"
  170. Delete "$INSTDIR\COPYING.LIB"
  171. Delete "$INSTDIR\README"
  172. Delete "$INSTDIR\VERSION"
  173. Delete "$INSTDIR\*.bmp"
  174. Delete "$INSTDIR\*.bin"
  175. Delete "$INSTDIR\*.dll"
  176. Delete "$INSTDIR\*.dtb"
  177. Delete "$INSTDIR\*.fd"
  178. Delete "$INSTDIR\*.img"
  179. Delete "$INSTDIR\*.lid"
  180. Delete "$INSTDIR\*.ndrv"
  181. Delete "$INSTDIR\*.rom"
  182. Delete "$INSTDIR\openbios-*"
  183. Delete "$INSTDIR\qemu-img.exe"
  184. Delete "$INSTDIR\qemu-io.exe"
  185. Delete "$INSTDIR\qemu.exe"
  186. Delete "$INSTDIR\qemu-system-*.exe"
  187. Delete "$INSTDIR\qemu-doc.html"
  188. RMDir /r "$INSTDIR\keymaps"
  189. RMDir /r "$INSTDIR\share"
  190. ; Remove generated files
  191. Delete "$INSTDIR\stderr.txt"
  192. Delete "$INSTDIR\stdout.txt"
  193. ; Remove uninstaller
  194. Delete "${UNINST_EXE}"
  195. RMDir "$INSTDIR"
  196. SectionEnd
  197. ;--------------------------------
  198. ; Descriptions (mouse-over).
  199. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  200. !insertmacro MUI_DESCRIPTION_TEXT ${SectionSystem} "System emulation."
  201. !insertmacro MUI_DESCRIPTION_TEXT ${Section_alpha} "Alpha system emulation."
  202. !insertmacro MUI_DESCRIPTION_TEXT ${Section_alphaw} "Alpha system emulation (GUI)."
  203. !insertmacro MUI_DESCRIPTION_TEXT ${Section_i386} "PC i386 system emulation."
  204. !insertmacro MUI_DESCRIPTION_TEXT ${Section_i386w} "PC i386 system emulation (GUI)."
  205. !insertmacro MUI_DESCRIPTION_TEXT ${SectionTools} "Tools."
  206. !ifdef DLLDIR
  207. !insertmacro MUI_DESCRIPTION_TEXT ${SectionDll} "Runtime Libraries (DLL)."
  208. !endif
  209. !ifdef CONFIG_DOCUMENTATION
  210. !insertmacro MUI_DESCRIPTION_TEXT ${SectionDoc} "Documentation."
  211. !endif
  212. !insertmacro MUI_DESCRIPTION_TEXT ${SectionMenu} "Menu entries."
  213. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  214. ;--------------------------------
  215. ; Functions.
  216. Function .onInit
  217. !insertmacro MUI_LANGDLL_DISPLAY
  218. FunctionEnd