Require Windows 7 64-bit or newer to install MozillaBuild

RESOLVED FIXED

Status

mozilla.org
MozillaBuild
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: RyanVM, Assigned: RyanVM)

Tracking

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

a year ago
I'm making MozillaBuild require Win7+ and a 64-bit OS. Need to enforce it in the installer.
(Assignee)

Updated

a year ago
Assignee: nobody → ryanvm
(Assignee)

Comment 1

a year ago
Created attachment 8869633 [details] [diff] [review]
Clean up installit.nsi and make 64-bit Win7+ mandatory

I got a bit carried away and did some other cleanups while I was there. That said, I think things are a lot nicer now.

Main changes:
* Moved the .onInit function from version.nsi over to installit.nsi (along with associated logic).
* Moved the extra functions used by installit.nsi into their own included file so the main installit.nsi is easier to parse.
* Made the name, version, and default installation path compile-time defines that get referenced everywhere else.
* And of course, blocked installation on 32-bit machines or OSes older than Win7.
Attachment #8869633 - Flags: review?(mhowell)
Comment on attachment 8869633 [details] [diff] [review]
Clean up installit.nsi and make 64-bit Win7+ mandatory

Review of attachment 8869633 [details] [diff] [review]:
-----------------------------------------------------------------

r+ with one suggestion.

::: installit.nsi
@@ +28,5 @@
> +  Quit
> +${EndIf}
> +
> +${StrContains} $0 "pre" ${VERSION}
> +StrCmp $0 "" notfound

You can use LogicLib for string compares instead of goto:
${If} "$0" == ""
  StrCpy $INSTDIR ${INSTDIR_DEFAULT}
${Else}
  StrCpy $INSTDIR "${INSTDIR_DEFAULT}-${VERSION}"
${EndIf}
Attachment #8869633 - Flags: review?(mhowell) → review+
(Assignee)

Comment 3

a year ago
Fixed locally. Thanks, Matt!
(Assignee)

Comment 4

a year ago
Created attachment 8870265 [details] [diff] [review]
Clean up installit.nsi and make 64-bit Win7+ mandatory

Carrying over Matt's review of the installer bits. Tagging gps to take a look at the packageit.py bits.

Greg, this picks up where bug 1346643 leaves off in that I ended up switching over to copying installit.nsi to the stage directory and then doing an inplace version number change using fileinput.input. The only behavior change I've noticed is that it switches the line endings over to CRLF along the way (and apparently 'wb' isn't an available mode to fileinput). However, NSIS doesn't care about that anyway, so I'm inclined to just let it go. The resulting installer appears to work just fine as expected.
Attachment #8869633 - Attachment is obsolete: true
Attachment #8870265 - Flags: review?(gps)
Comment on attachment 8870265 [details] [diff] [review]
Clean up installit.nsi and make 64-bit Win7+ mandatory

Review of attachment 8870265 [details] [diff] [review]:
-----------------------------------------------------------------

::: packageit.py
@@ +285,5 @@
> +for file in ["helpers.nsi", "installit.nsi", "license.rtf"]:
> +    copyfile(join(sourcedir, file), join(stagedir, file))
> +# Write the real version number to installit.nsi in the stage directory.
> +for line in fileinput.input(join(stagedir, "installit.nsi"), inplace=True):
> +      print line.replace("@VERSION@", version),

TIL about the fileinput module.

I can't say I've been missing much. The module is nifty. But it is a lot of magic. Please rewrite this to use `with open()`.

with open(join(stagedir, 'installit.nsi'), 'rb') as fh:
   lines = fh.readlines()

with open(join(stagedir, 'installit.nsi'), 'wb') as fh:
   for line in lines:
       fh.write(line.replace('@VERSION@', version))
Attachment #8870265 - Flags: review?(gps)
(Assignee)

Comment 6

a year ago
Created attachment 8871092 [details] [diff] [review]
Clean up installit.nsi and make 64-bit Win7+ mandatory

Works like a charm, thanks for the suggestion.
Attachment #8870265 - Attachment is obsolete: true
Attachment #8871092 - Flags: review?(gps)

Updated

a year ago
Attachment #8871092 - Flags: review?(gps) → review+

Comment 7

a year ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/mozilla-build/rev/1c1122be8538
Clean up installit.nsi and make 64-bit Win7+ mandatory for installing MozillaBuild. r=mhowell, r=gps
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.