Merge tag 'v4.1.0-rc2'
[qemu/ar7.git] / qemu.nsi
blob9a813db3853b407db9da7bf1fa2e231744b13efc
1 ;!/usr/bin/makensis
3 ; This NSIS script creates an installer for QEMU on Windows.
5 ; Copyright (C) 2006-2012 Stefan Weil
7 ; This program is free software: you can redistribute it and/or modify
8 ; it under the terms of the GNU General Public License as published by
9 ; the Free Software Foundation, either version 2 of the License, or
10 ; (at your option) version 3 or any later version.
12 ; This program is distributed in the hope that it will be useful,
13 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ; GNU General Public License for more details.
17 ; You should have received a copy of the GNU General Public License
18 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ; NSIS_WIN32_MAKENSIS
22 !define PRODUCT "QEMU"
23 !define URL "https://www.qemu.org/"
25 !define UNINST_EXE "$INSTDIR\qemu-uninstall.exe"
26 !define UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}"
28 !ifndef BINDIR
29 !define BINDIR nsis.tmp
30 !endif
31 !ifndef SRCDIR
32 !define SRCDIR .
33 !endif
34 !ifndef OUTFILE
35 !define OUTFILE "qemu-setup.exe"
36 !endif
38 ; Optionally install documentation.
39 !ifndef CONFIG_DOCUMENTATION
40 !define CONFIG_DOCUMENTATION
41 !endif
43 ; Use maximum compression.
44 SetCompressor /SOLID lzma
46 !include "MUI2.nsh"
48 ; The name of the installer.
49 Name "QEMU"
51 ; The file to write
52 OutFile "${OUTFILE}"
54 ; The default installation directory.
55 !ifdef W64
56 InstallDir $PROGRAMFILES64\qemu
57 !else
58 InstallDir $PROGRAMFILES\qemu
59 !endif
61 ; Registry key to check for directory (so if you install again, it will
62 ; overwrite the old one automatically)
63 !ifdef W64
64 InstallDirRegKey HKLM "Software\qemu64" "Install_Dir"
65 !else
66 InstallDirRegKey HKLM "Software\qemu32" "Install_Dir"
67 !endif
69 ; Request administrator privileges for Windows Vista.
70 RequestExecutionLevel admin
72 ;--------------------------------
73 ; Interface Settings.
74 ;!define MUI_HEADERIMAGE "qemu-nsis.bmp"
75 ; !define MUI_SPECIALBITMAP "qemu.bmp"
76 !define MUI_ICON "${SRCDIR}\pc-bios\qemu-nsis.ico"
77 !define MUI_UNICON "${SRCDIR}\pc-bios\qemu-nsis.ico"
78 !define MUI_WELCOMEFINISHPAGE_BITMAP "${SRCDIR}\pc-bios\qemu-nsis.bmp"
79 ; !define MUI_HEADERIMAGE_BITMAP "qemu-install.bmp"
80 ; !define MUI_HEADERIMAGE_UNBITMAP "qemu-uninstall.bmp"
81 ; !define MUI_COMPONENTSPAGE_SMALLDESC
82 ; !define MUI_WELCOMEPAGE_TEXT "Insert text here.$\r$\n$\r$\n$\r$\n$_CLICK"
84 ;--------------------------------
85 ; Pages.
87 !insertmacro MUI_PAGE_WELCOME
88 !insertmacro MUI_PAGE_LICENSE "${SRCDIR}\COPYING"
89 !insertmacro MUI_PAGE_COMPONENTS
90 !insertmacro MUI_PAGE_DIRECTORY
91 !insertmacro MUI_PAGE_INSTFILES
92 !define MUI_FINISHPAGE_LINK "Visit the QEMU Wiki online!"
93 !define MUI_FINISHPAGE_LINK_LOCATION "${URL}"
94 !insertmacro MUI_PAGE_FINISH
96 !insertmacro MUI_UNPAGE_CONFIRM
97 !insertmacro MUI_UNPAGE_INSTFILES
99 ;--------------------------------
100 ; Languages.
102 !insertmacro MUI_LANGUAGE "English"
103 !insertmacro MUI_LANGUAGE "French"
104 !insertmacro MUI_LANGUAGE "German"
105 !insertmacro MUI_LANGUAGE "Italian"
106 !insertmacro MUI_LANGUAGE "Spanish"
108 ;--------------------------------
110 ; The stuff to install.
112 ; Remember to keep the "Uninstall" section in sync.
114 Section "${PRODUCT} (required)"
116 SectionIn RO
118 ; Set output path to the installation directory.
119 SetOutPath "$INSTDIR"
121 File "${SRCDIR}\Changelog"
122 File "${SRCDIR}\COPYING"
123 File "${SRCDIR}\COPYING.LIB"
124 File "${SRCDIR}\README"
125 File "${SRCDIR}\VERSION"
127 File "${BINDIR}\*.bin"
128 File "${BINDIR}\*.dtb"
129 File "${BINDIR}\*.fd"
130 File "${BINDIR}\*.img"
131 File "${BINDIR}\*.lid"
132 File "${BINDIR}\*.ndrv"
133 File "${BINDIR}\*.rom"
134 File "${BINDIR}\openbios-*"
135 File "${BINDIR}\palcode-clipper"
136 File "${BINDIR}\u-boot.e500"
137 File "${BINDIR}\icons\hicolor\scalable\apps\qemu.svg"
139 File /r "${BINDIR}\keymaps"
140 !ifdef CONFIG_GTK
141 File /r "${BINDIR}\share"
142 !endif
144 SetOutPath "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0"
145 FileOpen $0 "loaders.cache" w
146 FileClose $0
148 !ifdef W64
149 SetRegView 64
150 !endif
152 ; Write the installation path into the registry
153 WriteRegStr HKLM SOFTWARE\${PRODUCT} "Install_Dir" "$INSTDIR"
155 ; Write the uninstall keys for Windows
156 WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "QEMU"
157 !ifdef DISPLAYVERSION
158 WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "${DISPLAYVERSION}"
159 !endif
160 WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" '"${UNINST_EXE}"'
161 WriteRegDWORD HKLM "${UNINST_KEY}" "NoModify" 1
162 WriteRegDWORD HKLM "${UNINST_KEY}" "NoRepair" 1
163 WriteUninstaller "qemu-uninstall.exe"
164 SectionEnd
166 Section "Tools" SectionTools
167 SetOutPath "$INSTDIR"
168 File "${BINDIR}\qemu-edid.exe"
169 File "${BINDIR}\qemu-ga.exe"
170 File "${BINDIR}\qemu-img.exe"
171 File "${BINDIR}\qemu-io.exe"
172 SectionEnd
174 SectionGroup "System Emulations" SectionSystem
176 !include "${BINDIR}\system-emulations.nsh"
178 SectionGroupEnd
180 Section "Desktop icons" SectionGnome
181 SetOutPath "$INSTDIR\share"
182 !ifdef W64
183 File /r /usr/x86_64-w64-mingw32/sys-root/mingw/share/icons
184 !else
185 File /r /usr/i686-w64-mingw32/sys-root/mingw/share/icons
186 !endif
187 SectionEnd
189 !ifdef DLLDIR
190 Section "Libraries (DLL)" SectionDll
191 SetOutPath "$INSTDIR"
192 File "${DLLDIR}\*.dll"
193 SectionEnd
194 !endif
196 !ifdef CONFIG_DOCUMENTATION
197 Section "Documentation" SectionDoc
198 SetOutPath "$INSTDIR"
199 File "${BINDIR}\qemu-doc.html"
200 CreateDirectory "$SMPROGRAMS\${PRODUCT}"
201 CreateShortCut "$SMPROGRAMS\${PRODUCT}\User Documentation.lnk" "$INSTDIR\qemu-doc.html" "" "$INSTDIR\qemu-doc.html" 0
202 SectionEnd
203 !endif
205 ; Optional section (can be disabled by the user)
206 Section "Start Menu Shortcuts" SectionMenu
207 CreateDirectory "$SMPROGRAMS\${PRODUCT}"
208 CreateShortCut "$SMPROGRAMS\${PRODUCT}\Uninstall.lnk" "${UNINST_EXE}" "" "${UNINST_EXE}" 0
209 SectionEnd
211 ;--------------------------------
213 ; Uninstaller
215 Section "Uninstall"
216 ; Remove registry keys
217 !ifdef W64
218 SetRegView 64
219 !endif
220 DeleteRegKey HKLM "${UNINST_KEY}"
221 DeleteRegKey HKLM SOFTWARE\${PRODUCT}
223 ; Remove shortcuts, if any
224 Delete "$SMPROGRAMS\${PRODUCT}\User Documentation.lnk"
225 Delete "$SMPROGRAMS\${PRODUCT}\Technical Documentation.lnk"
226 Delete "$SMPROGRAMS\${PRODUCT}\Uninstall.lnk"
227 RMDir "$SMPROGRAMS\${PRODUCT}"
229 ; Remove files and directories used
230 Delete "$INSTDIR\Changelog"
231 Delete "$INSTDIR\COPYING"
232 Delete "$INSTDIR\COPYING.LIB"
233 Delete "$INSTDIR\README"
234 Delete "$INSTDIR\VERSION"
235 Delete "$INSTDIR\*.bin"
236 Delete "$INSTDIR\*.dll"
237 Delete "$INSTDIR\*.dtb"
238 Delete "$INSTDIR\*.fd"
239 Delete "$INSTDIR\*.img"
240 Delete "$INSTDIR\*.lid"
241 Delete "$INSTDIR\*.ndrv"
242 Delete "$INSTDIR\*.rom"
243 Delete "$INSTDIR\openbios-*"
244 Delete "$INSTDIR\palcode-clipper"
245 Delete "$INSTDIR\u-boot.e500"
246 Delete "$INSTDIR\qemu.svg"
247 Delete "$INSTDIR\qemu-io.exe"
248 Delete "$INSTDIR\qemu-img.exe"
249 Delete "$INSTDIR\qemu-ga.exe"
250 Delete "$INSTDIR\qemu-edid.exe"
251 Delete "$INSTDIR\qemu.exe"
252 Delete "$INSTDIR\qemu-system-*.exe"
253 Delete "$INSTDIR\qemu-doc.html"
254 RMDir /r "$INSTDIR\keymaps"
255 RMDir /r "$INSTDIR\lib"
256 RMDir /r "$INSTDIR\share"
257 ; Remove generated files
258 Delete "$INSTDIR\stderr.txt"
259 Delete "$INSTDIR\stdout.txt"
260 ; Remove uninstaller
261 Delete "${UNINST_EXE}"
262 RMDir "$INSTDIR"
263 SectionEnd
265 ;--------------------------------
267 ; Descriptions (mouse-over).
268 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
269 !insertmacro MUI_DESCRIPTION_TEXT ${SectionGnome} "GNOME desktop icon theme."
270 !insertmacro MUI_DESCRIPTION_TEXT ${SectionSystem} "System emulation."
271 !insertmacro MUI_DESCRIPTION_TEXT ${Section_alpha} "Alpha system emulation."
272 !insertmacro MUI_DESCRIPTION_TEXT ${Section_i386} "PC i386 system emulation."
273 !insertmacro MUI_DESCRIPTION_TEXT ${SectionTools} "Tools."
274 !ifdef DLLDIR
275 !insertmacro MUI_DESCRIPTION_TEXT ${SectionDll} "Runtime Libraries (DLL)."
276 !endif
277 !ifdef CONFIG_DOCUMENTATION
278 !insertmacro MUI_DESCRIPTION_TEXT ${SectionDoc} "Documentation."
279 !endif
280 !insertmacro MUI_DESCRIPTION_TEXT ${SectionMenu} "Menu entries."
281 !insertmacro MUI_FUNCTION_DESCRIPTION_END
283 ;--------------------------------
284 ; Functions.
286 Function .onInit
287 !insertmacro MUI_LANGDLL_DISPLAY
288 FunctionEnd