Skip to content

Commit

Permalink
nsis installer: Fix mouse-over descriptions for emulators
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
pm215 committed Mar 18, 2022
1 parent 6b98e86 commit c087963
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 1 addition & 4 deletions qemu.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,7 @@ SectionEnd
; Descriptions (mouse-over).
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SectionSystem} "System emulation."
!insertmacro MUI_DESCRIPTION_TEXT ${Section_alpha} "Alpha system emulation."
!insertmacro MUI_DESCRIPTION_TEXT ${Section_alphaw} "Alpha system emulation (GUI)."
!insertmacro MUI_DESCRIPTION_TEXT ${Section_i386} "PC i386 system emulation."
!insertmacro MUI_DESCRIPTION_TEXT ${Section_i386w} "PC i386 system emulation (GUI)."
!include "${BINDIR}\system-mui-text.nsh"
!insertmacro MUI_DESCRIPTION_TEXT ${SectionTools} "Tools."
!ifdef DLLDIR
!insertmacro MUI_DESCRIPTION_TEXT ${SectionDll} "Runtime Libraries (DLL)."
Expand Down
13 changes: 12 additions & 1 deletion scripts/nsis.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def main():
subprocess.run(["make", "install", "DESTDIR=" + destdir + os.path.sep])
with open(
os.path.join(destdir + args.prefix, "system-emulations.nsh"), "w"
) as nsh:
) as nsh, open(
os.path.join(destdir + args.prefix, "system-mui-text.nsh"), "w"
) as muinsh:
for exe in sorted(glob.glob(
os.path.join(destdir + args.prefix, "qemu-system-*.exe")
)):
Expand All @@ -49,6 +51,15 @@ def main():
arch, exe
)
)
if arch.endswith('w'):
desc = arch[:-1] + " emulation (GUI)."
else:
desc = arch + " emulation."

muinsh.write(
"""
!insertmacro MUI_DESCRIPTION_TEXT ${{Section_{0}}} "{1}"
""".format(arch, desc))

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

0 comments on commit c087963

Please sign in to comment.