Create empty dummy file "loaders.cache" (bug #1766841)
[qemu/ar7.git] / qemu.nsi
blob162d7c1f63b416b476c7a26e6939d0f65ce66ab1
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"
106 ;--------------------------------
108 ; The stuff to install.
109 Section "${PRODUCT} (required)"
111 SectionIn RO
113 ; Set output path to the installation directory.
114 SetOutPath "$INSTDIR"
116 File "${SRCDIR}\Changelog"
117 File "${SRCDIR}\COPYING"
118 File "${SRCDIR}\COPYING.LIB"
119 File "${SRCDIR}\README"
120 File "${SRCDIR}\VERSION"
122 File "${BINDIR}\*.bmp"
123 File "${BINDIR}\*.bin"
124 File "${BINDIR}\*.dtb"
125 File "${BINDIR}\*.img"
126 File "${BINDIR}\*.lid"
127 File "${BINDIR}\*.ndrv"
128 File "${BINDIR}\*.rom"
129 File "${BINDIR}\openbios-*"
130 File "${BINDIR}\palcode-clipper"
131 File "${BINDIR}\u-boot.e500"
132 File "${BINDIR}\qemu_logo_no_text.svg"
134 File /r "${BINDIR}\keymaps"
135 !ifdef CONFIG_GTK
136 File /r "${BINDIR}\share"
137 !endif
139 SetOutPath "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0"
140 FileOpen $0 "loaders.cache" w
141 FileClose $0
143 !ifdef W64
144 SetRegView 64
145 !endif
147 ; Write the installation path into the registry
148 WriteRegStr HKLM SOFTWARE\${PRODUCT} "Install_Dir" "$INSTDIR"
150 ; Write the uninstall keys for Windows
151 WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "QEMU"
152 !ifdef DISPLAYVERSION
153 WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "${DISPLAYVERSION}"
154 !endif
155 WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" '"${UNINST_EXE}"'
156 WriteRegDWORD HKLM "${UNINST_KEY}" "NoModify" 1
157 WriteRegDWORD HKLM "${UNINST_KEY}" "NoRepair" 1
158 WriteUninstaller "qemu-uninstall.exe"
159 SectionEnd
161 Section "Tools" SectionTools
162 SetOutPath "$INSTDIR"
163 File "${BINDIR}\qemu-img.exe"
164 File "${BINDIR}\qemu-io.exe"
165 SectionEnd
167 SectionGroup "System Emulations" SectionSystem
169 !include "${BINDIR}\system-emulations.nsh"
171 SectionGroupEnd
173 Section "Desktop icons" SectionGnome
174 SetOutPath "$INSTDIR\share"
175 !ifdef W64
176 File /r /usr/x86_64-w64-mingw32/sys-root/mingw/share/icons
177 !else
178 File /r /usr/i686-w64-mingw32/sys-root/mingw/share/icons
179 !endif
180 SectionEnd
182 !ifdef DLLDIR
183 Section "Libraries (DLL)" SectionDll
184 SetOutPath "$INSTDIR"
185 File "${DLLDIR}\*.dll"
186 SectionEnd
187 !endif
189 !ifdef CONFIG_DOCUMENTATION
190 Section "Documentation" SectionDoc
191 SetOutPath "$INSTDIR"
192 File "${BINDIR}\qemu-doc.html"
193 CreateDirectory "$SMPROGRAMS\${PRODUCT}"
194 CreateShortCut "$SMPROGRAMS\${PRODUCT}\User Documentation.lnk" "$INSTDIR\qemu-doc.html" "" "$INSTDIR\qemu-doc.html" 0
195 SectionEnd
196 !endif
198 ; Optional section (can be disabled by the user)
199 Section "Start Menu Shortcuts" SectionMenu
200 CreateDirectory "$SMPROGRAMS\${PRODUCT}"
201 CreateShortCut "$SMPROGRAMS\${PRODUCT}\Uninstall.lnk" "${UNINST_EXE}" "" "${UNINST_EXE}" 0
202 SectionEnd
204 ;--------------------------------
206 ; Uninstaller
208 Section "Uninstall"
209 ; Remove registry keys
210 !ifdef W64
211 SetRegView 64
212 !endif
213 DeleteRegKey HKLM "${UNINST_KEY}"
214 DeleteRegKey HKLM SOFTWARE\${PRODUCT}
216 ; Remove shortcuts, if any
217 Delete "$SMPROGRAMS\${PRODUCT}\User Documentation.lnk"
218 Delete "$SMPROGRAMS\${PRODUCT}\Technical Documentation.lnk"
219 Delete "$SMPROGRAMS\${PRODUCT}\Uninstall.lnk"
220 RMDir "$SMPROGRAMS\${PRODUCT}"
222 ; Remove files and directories used
223 Delete "$INSTDIR\Changelog"
224 Delete "$INSTDIR\COPYING"
225 Delete "$INSTDIR\COPYING.LIB"
226 Delete "$INSTDIR\README"
227 Delete "$INSTDIR\VERSION"
228 Delete "$INSTDIR\*.bmp"
229 Delete "$INSTDIR\*.bin"
230 Delete "$INSTDIR\*.dll"
231 Delete "$INSTDIR\*.dtb"
232 Delete "$INSTDIR\*.img"
233 Delete "$INSTDIR\*.lid"
234 Delete "$INSTDIR\*.ndrv"
235 Delete "$INSTDIR\*.rom"
236 Delete "$INSTDIR\openbios-*"
237 Delete "$INSTDIR\palcode-clipper"
238 Delete "$INSTDIR\u-boot.e500"
239 Delete "$INSTDIR\qemu_logo_no_text.svg"
240 Delete "$INSTDIR\qemu-img.exe"
241 Delete "$INSTDIR\qemu-io.exe"
242 Delete "$INSTDIR\qemu.exe"
243 Delete "$INSTDIR\qemu-system-*.exe"
244 Delete "$INSTDIR\qemu-doc.html"
245 RMDir /r "$INSTDIR\keymaps"
246 RMDir /r "$INSTDIR\share"
247 ; Remove generated files
248 Delete "$INSTDIR\stderr.txt"
249 Delete "$INSTDIR\stdout.txt"
250 ; Remove uninstaller
251 Delete "${UNINST_EXE}"
252 RMDir "$INSTDIR"
253 SectionEnd
255 ;--------------------------------
257 ; Descriptions (mouse-over).
258 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
259 !insertmacro MUI_DESCRIPTION_TEXT ${SectionGnome} "GNOME desktop icon theme."
260 !insertmacro MUI_DESCRIPTION_TEXT ${SectionSystem} "System emulation."
261 !insertmacro MUI_DESCRIPTION_TEXT ${Section_alpha} "Alpha system emulation."
262 !insertmacro MUI_DESCRIPTION_TEXT ${Section_i386} "PC i386 system emulation."
263 !insertmacro MUI_DESCRIPTION_TEXT ${SectionTools} "Tools."
264 !ifdef DLLDIR
265 !insertmacro MUI_DESCRIPTION_TEXT ${SectionDll} "Runtime Libraries (DLL)."
266 !endif
267 !ifdef CONFIG_DOCUMENTATION
268 !insertmacro MUI_DESCRIPTION_TEXT ${SectionDoc} "Documentation."
269 !endif
270 !insertmacro MUI_DESCRIPTION_TEXT ${SectionMenu} "Menu entries."
271 !insertmacro MUI_FUNCTION_DESCRIPTION_END
273 ;--------------------------------
274 ; Functions.
276 Function .onInit
277 !insertmacro MUI_LANGDLL_DISPLAY
278 FunctionEnd