Closed Bug 1366135 Opened 7 years ago Closed 7 years ago

Require Windows 7 64-bit or newer to install MozillaBuild

Categories

(Firefox Build System :: MozillaBuild, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: RyanVM, Assigned: RyanVM)

References

Details

Attachments

(1 file, 2 obsolete files)

I'm making MozillaBuild require Win7+ and a 64-bit OS. Need to enforce it in the installer.
Assignee: nobody → ryanvm
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+
Fixed locally. Thanks, Matt!
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)
Works like a charm, thanks for the suggestion.
Attachment #8870265 - Attachment is obsolete: true
Attachment #8871092 - Flags: review?(gps)
Attachment #8871092 - Flags: review?(gps) → review+
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
Closed: 7 years ago
Resolution: --- → FIXED
Product: mozilla.org → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: