hw/isa/piix4: Pass PIIX4State as opaque parameter for piix4_set_irq()
[qemu.git] / qemu.nsi
blobc3df8c9d3b0343bf1eac332807c0a25d34a15b09
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 ; Use maximum compression.
39 SetCompressor /SOLID lzma
41 !include "MUI2.nsh"
43 ; The name of the installer.
44 Name "QEMU"
46 ; The file to write
47 OutFile "${OUTFILE}"
49 ; The default installation directory.
50 !ifdef W64
51 InstallDir $PROGRAMFILES64\qemu
52 !else
53 InstallDir $PROGRAMFILES\qemu
54 !endif
56 ; Registry key to check for directory (so if you install again, it will
57 ; overwrite the old one automatically)
58 !ifdef W64
59 InstallDirRegKey HKLM "Software\qemu64" "Install_Dir"
60 !else
61 InstallDirRegKey HKLM "Software\qemu32" "Install_Dir"
62 !endif
64 ; Request administrator privileges for Windows Vista.
65 RequestExecutionLevel admin
67 ;--------------------------------
68 ; Interface Settings.
69 ;!define MUI_HEADERIMAGE "qemu-nsis.bmp"
70 ; !define MUI_SPECIALBITMAP "qemu.bmp"
71 !define MUI_ICON "${SRCDIR}\pc-bios\qemu-nsis.ico"
72 !define MUI_UNICON "${SRCDIR}\pc-bios\qemu-nsis.ico"
73 !define MUI_WELCOMEFINISHPAGE_BITMAP "${SRCDIR}\pc-bios\qemu-nsis.bmp"
74 ; !define MUI_HEADERIMAGE_BITMAP "qemu-install.bmp"
75 ; !define MUI_HEADERIMAGE_UNBITMAP "qemu-uninstall.bmp"
76 ; !define MUI_COMPONENTSPAGE_SMALLDESC
77 ; !define MUI_WELCOMEPAGE_TEXT "Insert text here.$\r$\n$\r$\n$\r$\n$_CLICK"
79 ;--------------------------------
80 ; Pages.
82 !insertmacro MUI_PAGE_WELCOME
83 !insertmacro MUI_PAGE_LICENSE "${SRCDIR}\COPYING"
84 !insertmacro MUI_PAGE_COMPONENTS
85 !insertmacro MUI_PAGE_DIRECTORY
86 !insertmacro MUI_PAGE_INSTFILES
87 !define MUI_FINISHPAGE_LINK "Visit the QEMU Wiki online!"
88 !define MUI_FINISHPAGE_LINK_LOCATION "${URL}"
89 !insertmacro MUI_PAGE_FINISH
91 !insertmacro MUI_UNPAGE_CONFIRM
92 !insertmacro MUI_UNPAGE_INSTFILES
94 ;--------------------------------
95 ; Languages.
97 !insertmacro MUI_LANGUAGE "English"
98 !insertmacro MUI_LANGUAGE "French"
99 !insertmacro MUI_LANGUAGE "German"
101 ;--------------------------------
103 ; The stuff to install.
105 ; Remember to keep the "Uninstall" section in sync.
107 Section "${PRODUCT} (required)"
109 SectionIn RO
111 ; Set output path to the installation directory.
112 SetOutPath "$INSTDIR"
114 File "${SRCDIR}\COPYING"
115 File "${SRCDIR}\COPYING.LIB"
116 File "${SRCDIR}\README.rst"
117 File "${SRCDIR}\VERSION"
119 File /r "${BINDIR}\keymaps"
120 File /r "${BINDIR}\share"
122 !ifdef W64
123 SetRegView 64
124 !endif
126 ; Write the installation path into the registry
127 WriteRegStr HKLM SOFTWARE\${PRODUCT} "Install_Dir" "$INSTDIR"
129 ; Write the uninstall keys for Windows
130 WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "QEMU"
131 !ifdef DISPLAYVERSION
132 WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "${DISPLAYVERSION}"
133 !endif
134 WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" '"${UNINST_EXE}"'
135 WriteRegDWORD HKLM "${UNINST_KEY}" "NoModify" 1
136 WriteRegDWORD HKLM "${UNINST_KEY}" "NoRepair" 1
137 WriteUninstaller "qemu-uninstall.exe"
138 SectionEnd
140 Section "Tools" SectionTools
141 SetOutPath "$INSTDIR"
142 File "${BINDIR}\qemu-img.exe"
143 File "${BINDIR}\qemu-io.exe"
144 SectionEnd
146 SectionGroup "System Emulations" SectionSystem
148 !include "${BINDIR}\system-emulations.nsh"
150 SectionGroupEnd
152 !ifdef DLLDIR
153 Section "Libraries (DLL)" SectionDll
154 SetOutPath "$INSTDIR"
155 File "${DLLDIR}\*.dll"
156 SectionEnd
157 !endif
159 !ifdef CONFIG_DOCUMENTATION
160 Section "Documentation" SectionDoc
161 SetOutPath "$INSTDIR\doc"
162 File /r "${BINDIR}\doc"
163 SetOutPath "$INSTDIR"
164 CreateDirectory "$SMPROGRAMS\${PRODUCT}"
165 CreateShortCut "$SMPROGRAMS\${PRODUCT}\User Documentation.lnk" "$INSTDIR\doc\index.html" "" "$INSTDIR\doc\index.html" 0
166 SectionEnd
167 !endif
169 ; Optional section (can be disabled by the user)
170 Section "Start Menu Shortcuts" SectionMenu
171 CreateDirectory "$SMPROGRAMS\${PRODUCT}"
172 CreateShortCut "$SMPROGRAMS\${PRODUCT}\Uninstall.lnk" "${UNINST_EXE}" "" "${UNINST_EXE}" 0
173 SectionEnd
175 ;--------------------------------
177 ; Uninstaller
179 Section "Uninstall"
180 ; Remove registry keys
181 !ifdef W64
182 SetRegView 64
183 !endif
184 DeleteRegKey HKLM "${UNINST_KEY}"
185 DeleteRegKey HKLM SOFTWARE\${PRODUCT}
187 ; Remove shortcuts, if any
188 Delete "$SMPROGRAMS\${PRODUCT}\User Documentation.lnk"
189 Delete "$SMPROGRAMS\${PRODUCT}\Technical Documentation.lnk"
190 Delete "$SMPROGRAMS\${PRODUCT}\Uninstall.lnk"
191 RMDir "$SMPROGRAMS\${PRODUCT}"
193 ; Remove files and directories used
194 Delete "$INSTDIR\Changelog"
195 Delete "$INSTDIR\COPYING"
196 Delete "$INSTDIR\COPYING.LIB"
197 Delete "$INSTDIR\README.rst"
198 Delete "$INSTDIR\VERSION"
199 Delete "$INSTDIR\*.bmp"
200 Delete "$INSTDIR\*.bin"
201 Delete "$INSTDIR\*.dll"
202 Delete "$INSTDIR\*.dtb"
203 Delete "$INSTDIR\*.fd"
204 Delete "$INSTDIR\*.img"
205 Delete "$INSTDIR\*.lid"
206 Delete "$INSTDIR\*.ndrv"
207 Delete "$INSTDIR\*.rom"
208 Delete "$INSTDIR\openbios-*"
209 Delete "$INSTDIR\qemu-img.exe"
210 Delete "$INSTDIR\qemu-io.exe"
211 Delete "$INSTDIR\qemu.exe"
212 Delete "$INSTDIR\qemu-system-*.exe"
213 RMDir /r "$INSTDIR\doc"
214 RMDir /r "$INSTDIR\share"
215 ; Remove generated files
216 Delete "$INSTDIR\stderr.txt"
217 Delete "$INSTDIR\stdout.txt"
218 ; Remove uninstaller
219 Delete "${UNINST_EXE}"
220 RMDir "$INSTDIR"
221 SectionEnd
223 ;--------------------------------
225 ; Descriptions (mouse-over).
226 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
227 !insertmacro MUI_DESCRIPTION_TEXT ${SectionSystem} "System emulation."
228 !insertmacro MUI_DESCRIPTION_TEXT ${Section_alpha} "Alpha system emulation."
229 !insertmacro MUI_DESCRIPTION_TEXT ${Section_alphaw} "Alpha system emulation (GUI)."
230 !insertmacro MUI_DESCRIPTION_TEXT ${Section_i386} "PC i386 system emulation."
231 !insertmacro MUI_DESCRIPTION_TEXT ${Section_i386w} "PC i386 system emulation (GUI)."
232 !insertmacro MUI_DESCRIPTION_TEXT ${SectionTools} "Tools."
233 !ifdef DLLDIR
234 !insertmacro MUI_DESCRIPTION_TEXT ${SectionDll} "Runtime Libraries (DLL)."
235 !endif
236 !ifdef CONFIG_DOCUMENTATION
237 !insertmacro MUI_DESCRIPTION_TEXT ${SectionDoc} "Documentation."
238 !endif
239 !insertmacro MUI_DESCRIPTION_TEXT ${SectionMenu} "Menu entries."
240 !insertmacro MUI_FUNCTION_DESCRIPTION_END
242 ;--------------------------------
243 ; Functions.
245 Function .onInit
246 !insertmacro MUI_LANGDLL_DISPLAY
247 FunctionEnd