From: John Snow <jsnow@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Stefan Weil <sw@weilnetz.de>, qemu-devel <qemu-devel@nongnu.org>,
Cleber Rosa <crosa@redhat.com>
Subject: Re: [PATCH 3/3] nsis installer: Fix mouse-over descriptions for emulators
Date: Mon, 7 Mar 2022 14:31:03 -0500 [thread overview]
Message-ID: <CAFn=p-ZkcsWyiGSAY16AvT-DN-x3rs2Lg+N_eUoenjONaA8hRg@mail.gmail.com> (raw)
In-Reply-To: <20220305105743.2384766-4-peter.maydell@linaro.org>
On Sat, Mar 5, 2022 at 5:57 AM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> 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 <peter.maydell@linaro.org>
> ---
> I opted to put the logic into the Python script, which I think
> many QEMU contributors understand, rather than investigating
> whether NSIS installer script magic might for instance allow
> us to write out only one file rather than two, since I think
> very few of us understand the NSIS installer...
Makes sense.
Python bits:
Reviewed-by: John Snow <jsnow@redhat.com>
> ---
> qemu.nsi | 5 +----
> scripts/nsis.py | 13 ++++++++++++-
> 2 files changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/qemu.nsi b/qemu.nsi
> index a44d2be32a2..aa93adee396 100644
> --- a/qemu.nsi
> +++ b/qemu.nsi
> @@ -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)."
> diff --git a/scripts/nsis.py b/scripts/nsis.py
> index 383bef70332..462d6cac3b6 100644
> --- a/scripts/nsis.py
> +++ b/scripts/nsis.py
> @@ -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")
> )):
> @@ -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)
> --
> 2.25.1
>
prev parent reply other threads:[~2022-03-07 19:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-05 10:57 [PATCH 0/3] windows installer: Fix warnings, mouse-over descriptions, item order Peter Maydell
2022-03-05 10:57 ` [PATCH 1/3] nsis installer: List emulators in alphabetical order Peter Maydell
2022-03-05 11:15 ` Philippe Mathieu-Daudé
2022-03-05 14:07 ` Stefan Weil
2022-03-07 19:25 ` John Snow
2022-03-07 20:16 ` Peter Maydell
2022-03-05 10:57 ` [PATCH 2/3] nsis installer: Suppress "ANSI targets are deprecated" warning Peter Maydell
2022-03-05 11:17 ` Philippe Mathieu-Daudé
2022-03-05 14:15 ` Stefan Weil
2022-03-05 10:57 ` [PATCH 3/3] nsis installer: Fix mouse-over descriptions for emulators Peter Maydell
2022-03-05 11:19 ` Philippe Mathieu-Daudé
2022-03-07 19:31 ` John Snow [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFn=p-ZkcsWyiGSAY16AvT-DN-x3rs2Lg+N_eUoenjONaA8hRg@mail.gmail.com' \
--to=jsnow@redhat.com \
--cc=crosa@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).