Skip to content

Commit c087963

Browse files
committed
nsis installer: Fix mouse-over descriptions for emulators
We use the nsis.py script to write out an installer script Section for each emulator executable, so the exact set of Sections depends on which executables were built. However the part of qemu.nsi which specifies mouse-over descriptions for each Section still has a hard-coded and very outdated list (with just i386 and alpha). This causes two problems. Firstly, if you build the installer for a configuration where you didn't build the i386 binaries you get warnings like this: warning 6000: unknown variable/constant "{Section_i386}" detected, ignoring (macro:_==:1) warning 6000: unknown variable/constant "{Section_i386w}" detected, ignoring (macro:_==:1) (this happens in our gitlab CI jobs, for instance). Secondly, most of the emulators in the generated installer don't have any mouseover text. Make nsis.py generate a second output file which has the necessary MUI_DESCRIPTION_TEXT lines for each Section it creates, so we can include that at the right point in qemu.nsi to set the mouse-over text. Signed-off-by: Peter Maydell <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: John Snow <[email protected]> Message-id: [email protected]
1 parent 6b98e86 commit c087963

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

qemu.nsi

+1-4
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,7 @@ SectionEnd
228228
; Descriptions (mouse-over).
229229
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
230230
!insertmacro MUI_DESCRIPTION_TEXT ${SectionSystem} "System emulation."
231-
!insertmacro MUI_DESCRIPTION_TEXT ${Section_alpha} "Alpha system emulation."
232-
!insertmacro MUI_DESCRIPTION_TEXT ${Section_alphaw} "Alpha system emulation (GUI)."
233-
!insertmacro MUI_DESCRIPTION_TEXT ${Section_i386} "PC i386 system emulation."
234-
!insertmacro MUI_DESCRIPTION_TEXT ${Section_i386w} "PC i386 system emulation (GUI)."
231+
!include "${BINDIR}\system-mui-text.nsh"
235232
!insertmacro MUI_DESCRIPTION_TEXT ${SectionTools} "Tools."
236233
!ifdef DLLDIR
237234
!insertmacro MUI_DESCRIPTION_TEXT ${SectionDll} "Runtime Libraries (DLL)."

scripts/nsis.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ def main():
3333
subprocess.run(["make", "install", "DESTDIR=" + destdir + os.path.sep])
3434
with open(
3535
os.path.join(destdir + args.prefix, "system-emulations.nsh"), "w"
36-
) as nsh:
36+
) as nsh, open(
37+
os.path.join(destdir + args.prefix, "system-mui-text.nsh"), "w"
38+
) as muinsh:
3739
for exe in sorted(glob.glob(
3840
os.path.join(destdir + args.prefix, "qemu-system-*.exe")
3941
)):
@@ -49,6 +51,15 @@ def main():
4951
arch, exe
5052
)
5153
)
54+
if arch.endswith('w'):
55+
desc = arch[:-1] + " emulation (GUI)."
56+
else:
57+
desc = arch + " emulation."
58+
59+
muinsh.write(
60+
"""
61+
!insertmacro MUI_DESCRIPTION_TEXT ${{Section_{0}}} "{1}"
62+
""".format(arch, desc))
5263

5364
for exe in glob.glob(os.path.join(destdir + args.prefix, "*.exe")):
5465
signcode(exe)

0 commit comments

Comments
 (0)