From 65dd31631f385d6ad85ed78b2fa07525dbd9d360 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 8 Sep 2018 10:05:26 -0400 Subject: DRTVWR-474, MAINT-9047: Restore viewer to top-level Mac app. The relationship to MAINT-9047 is that we hope this will improve the behavior of Mac code signing. --- indra/newview/viewer_manifest.py | 633 ++++++++++++++++----------------------- 1 file changed, 254 insertions(+), 379 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 541112a765..14ff2c194e 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -880,394 +880,269 @@ class DarwinManifest(ViewerManifest): return True def construct(self): - # These are the names of the top-level application and the embedded - # applications for the VMP and for the actual viewer, respectively. - # These names, without the .app suffix, determine the flyover text for - # their corresponding Dock icons. - toplevel_app, toplevel_icon = "Second Life.app", "secondlife.icns" - launcher_app, launcher_icon = "Second Life Launcher.app", "secondlife.icns" - viewer_app, viewer_icon = "Second Life Viewer.app", "secondlife.icns" - # copy over the build result (this is a no-op if run within the xcode script) - self.path(os.path.join(self.args['configuration'], toplevel_app), dst="") + self.path(os.path.join(self.args['configuration'], "Second Life.app"), dst="") pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") debpkgdir = os.path.join(pkgdir, "lib", "debug") - # -------------------- top-level Second Life.app --------------------- - # top-level Second Life application is only a container with self.prefix(src="", dst="Contents"): # everything goes in Contents - # top-level Info.plist is as generated by CMake - Info_plist = "Info.plist" - ## This self.path() call reports 0 files... skip? - self.path(Info_plist) - Info_plist = self.dst_path_of(Info_plist) - - # the one file in top-level MacOS directory is the trampoline to - # our nested launcher_app + # CEF framework goes inside Contents/Frameworks. + # Remember where we parked this car. + with self.prefix(src="", dst="Frameworks"): + CEF_framework = "Chromium Embedded Framework.framework" + self.path2basename(relpkgdir, CEF_framework) + CEF_framework = self.dst_path_of(CEF_framework) + with self.prefix(dst="MacOS"): - toplevel_MacOS = self.get_dst_prefix() - trampoline = self.put_in_file("""\ -#!/bin/bash -open "%s" --args "$@" -""" % - # up one directory from MacOS to its sibling Resources directory - os.path.join('$(dirname "$0")', os.pardir, 'Resources', launcher_app), - "SL_Launcher", # write this file - "trampoline") # flag to add to list of copied files - # Script must be executable - self.run_command(["chmod", "+x", trampoline]) - - # Make a symlink to a nested app Frameworks directory that doesn't - # yet exist. We shouldn't need this; the only things that need - # Frameworks are nested apps under viewer_app, and they should - # simply find its Contents/Frameworks by relative pathnames. But - # empirically, we do: if we omit this symlink, CEF doesn't work -- - # the login splash screen doesn't even display. SIIIIGH. - # We're passing a path that's already relative, hence symlinkf() - # rather than relsymlinkf(). - self.symlinkf(os.path.join("Resources", viewer_app, "Contents", "Frameworks")) - - with self.prefix(src="", dst="Resources"): - # top-level Resources directory should be pretty sparse - # need .icns file referenced by top-level Info.plist + # NOTE: the -S argument to strip causes it to keep + # enough info for annotated backtraces (i.e. function + # names in the crash log). 'strip' with no arguments + # yields a slightly smaller binary but makes crash + # logs mostly useless. This may be desirable for the + # final release. Or not. + if ("package" in self.args['actions'] or + "unpacked" in self.args['actions']): + self.run_command( + ['strip', '-S', self.dst_path_of('Second Life')]) + + with self.prefix(dst="Resources"): + # defer cross-platform file copies until we're in the + # nested Resources directory + super(DarwinManifest, self).construct() + + # need .icns file referenced by Info.plist with self.prefix(src=self.icon_path(), dst="") : - self.path(toplevel_icon) - - # ------------------- nested launcher_app -------------------- - with self.prefix(dst=os.path.join(launcher_app, "Contents")): - # Info.plist is just like top-level one... - Info = plistlib.readPlist(Info_plist) - # except for these replacements: - Info["CFBundleExecutable"] = "SL_Launcher" - Info["CFBundleIconFile"] = launcher_icon - self.put_in_file( - plistlib.writePlistToString(Info), - os.path.basename(Info_plist), - "Info.plist") - - # copy VMP libs to MacOS - with self.prefix(dst="MacOS"): - #this copies over the python wrapper script, - #associated utilities and required libraries, see - #SL-321, SL-322, SL-323 - with self.prefix(src=os.path.join(pkgdir, "VMP"), dst=""): - self.path("SL_Launcher") - self.path("*.py") - # certifi will be imported by requests; this is - # our custom version to get our ca-bundle.crt - self.path("certifi") - with self.prefix(src=os.path.join(pkgdir, "lib", "python"), dst=""): - # llbase provides our llrest service layer and llsd decoding - with self.prefix("llbase"): - # (Why is llbase treated specially here? What - # DON'T we want to copy out of lib/python/llbase?) - self.path("*.py") - self.path("_cllsd.so") - #requests module needed by llbase/llrest.py - #this is only needed on POSIX, because in Windows - #we compile it into the EXE - for pypkg in "chardet", "idna", "requests", "urllib3": - self.path(pypkg) - - # launcher_app/Contents/Resources - with self.prefix(dst="Resources"): - with self.prefix(src=self.icon_path(), dst="") : - self.path(launcher_icon) - with self.prefix(dst="vmp_icons"): - self.path("secondlife.ico") - #VMP Tkinter icons - with self.prefix("vmp_icons"): - self.path("*.png") - self.path("*.gif") - - # -------------------- nested viewer_app --------------------- - with self.prefix(dst=os.path.join(viewer_app, "Contents")): - # Info.plist is just like top-level one... - Info = plistlib.readPlist(Info_plist) - # except for these replacements: - # (CFBundleExecutable may be moot: SL_Launcher directly - # runs the executable, instead of launching the app) - Info["CFBundleExecutable"] = "Second Life" - Info["CFBundleIconFile"] = viewer_icon - self.put_in_file( - plistlib.writePlistToString(Info), - os.path.basename(Info_plist), - "Info.plist") - - # CEF framework goes inside viewer_app/Contents/Frameworks. - # Remember where we parked this car. - with self.prefix(src="", dst="Frameworks"): - CEF_framework = "Chromium Embedded Framework.framework" - self.path2basename(relpkgdir, CEF_framework) - CEF_framework = self.dst_path_of(CEF_framework) - - with self.prefix(dst="MacOS"): - # CMake constructs the Second Life executable in the - # MacOS directory belonging to the top-level Second - # Life.app. Move it here. - here = self.get_dst_prefix() - relbase = os.path.realpath(os.path.dirname(Info_plist)) - self.cmakedirs(here) - for f in os.listdir(toplevel_MacOS): - if f == os.path.basename(trampoline): - # don't move the trampoline script we just made! - continue - fromwhere = os.path.join(toplevel_MacOS, f) - towhere = os.path.join(here, f) - print "Moving %s => %s" % \ - (self.relpath(fromwhere, relbase), - self.relpath(towhere, relbase)) - # now do it, only without relativizing paths - os.rename(fromwhere, towhere) - - # NOTE: the -S argument to strip causes it to keep - # enough info for annotated backtraces (i.e. function - # names in the crash log). 'strip' with no arguments - # yields a slightly smaller binary but makes crash - # logs mostly useless. This may be desirable for the - # final release. Or not. - if ("package" in self.args['actions'] or - "unpacked" in self.args['actions']): - self.run_command( - ['strip', '-S', self.dst_path_of('Second Life')]) - - with self.prefix(dst="Resources"): - # defer cross-platform file copies until we're in the right - # nested Resources directory - super(DarwinManifest, self).construct() - - with self.prefix(src=self.icon_path(), dst="") : - self.path(viewer_icon) - - with self.prefix(src=relpkgdir, dst=""): - self.path("libndofdev.dylib") - self.path("libhunspell-1.3.0.dylib") - - with self.prefix("cursors_mac"): - self.path("*.tif") - - self.path("licenses-mac.txt", dst="licenses.txt") - self.path("featuretable_mac.txt") - self.path("SecondLife.nib") - - with self.prefix(src=pkgdir,dst=""): - self.path("ca-bundle.crt") - - self.path("SecondLife.nib") - - # Translations - self.path("English.lproj/language.txt") - self.replace_in(src="English.lproj/InfoPlist.strings", - dst="English.lproj/InfoPlist.strings", - searchdict={'%%VERSION%%':'.'.join(self.args['version'])} - ) - self.path("German.lproj") - self.path("Japanese.lproj") - self.path("Korean.lproj") - self.path("da.lproj") - self.path("es.lproj") - self.path("fr.lproj") - self.path("hu.lproj") - self.path("it.lproj") - self.path("nl.lproj") - self.path("pl.lproj") - self.path("pt.lproj") - self.path("ru.lproj") - self.path("tr.lproj") - self.path("uk.lproj") - self.path("zh-Hans.lproj") - - def path_optional(src, dst): - """ - For a number of our self.path() calls, not only do we want - to deal with the absence of src, we also want to remember - which were present. Return either an empty list (absent) - or a list containing dst (present). Concatenate these - return values to get a list of all libs that are present. - """ - # This was simple before we started needing to pass - # wildcards. Fortunately, self.path() ends up appending a - # (source, dest) pair to self.file_list for every expanded - # file processed. Remember its size before the call. - oldlen = len(self.file_list) - self.path(src, dst) - # The dest appended to self.file_list has been prepended - # with self.get_dst_prefix(). Strip it off again. - added = [os.path.relpath(d, self.get_dst_prefix()) - for s, d in self.file_list[oldlen:]] - if not added: - print "Skipping %s" % dst - return added - - # dylibs is a list of all the .dylib files we expect to need - # in our bundled sub-apps. For each of these we'll create a - # symlink from sub-app/Contents/Resources to the real .dylib. - # Need to get the llcommon dll from any of the build directories as well. - libfile_parent = self.get_dst_prefix() - libfile = "libllcommon.dylib" - dylibs = path_optional(self.find_existing_file(os.path.join(os.pardir, - "llcommon", - self.args['configuration'], - libfile), - os.path.join(relpkgdir, libfile)), - dst=libfile) - - for libfile in ( - "libapr-1.0.dylib", - "libaprutil-1.0.dylib", - "libcollada14dom.dylib", - "libexpat.1.dylib", - "libexception_handler.dylib", - "libGLOD.dylib", - # libnghttp2.dylib is a symlink to - # libnghttp2.major.dylib, which is a symlink to - # libnghttp2.version.dylib. Get all of them. - "libnghttp2.*dylib", - ): - dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) - - # SLVoice and vivox lols, no symlinks needed - for libfile in ( - 'libortp.dylib', - 'libsndfile.dylib', - 'libvivoxoal.dylib', - 'libvivoxsdk.dylib', - 'libvivoxplatform.dylib', - 'SLVoice', - ): - self.path2basename(relpkgdir, libfile) - - # dylibs that vary based on configuration - if self.args['configuration'].lower() == 'debug': - for libfile in ( - "libfmodexL.dylib", - ): - dylibs += path_optional(os.path.join(debpkgdir, libfile), libfile) - else: - for libfile in ( - "libfmodex.dylib", - ): - dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) - - # our apps - executable_path = {} - for app_bld_dir, app in (("mac_crash_logger", "mac-crash-logger.app"), - # plugin launcher - (os.path.join("llplugin", "slplugin"), "SLPlugin.app"), - ): - self.path2basename(os.path.join(os.pardir, - app_bld_dir, self.args['configuration']), - app) - executable_path[app] = \ - self.dst_path_of(os.path.join(app, "Contents", "MacOS")) - - # our apps dependencies on shared libs - # for each app, for each dylib we collected in dylibs, - # create a symlink to the real copy of the dylib. - with self.prefix(dst=os.path.join(app, "Contents", "Resources")): - for libfile in dylibs: - self.relsymlinkf(os.path.join(libfile_parent, libfile)) - - # Dullahan helper apps go inside SLPlugin.app - with self.prefix(dst=os.path.join( - "SLPlugin.app", "Contents", "Frameworks")): - - frameworkname = 'Chromium Embedded Framework' - - # This code constructs a relative symlink from the - # target framework folder back to the real CEF framework. - # It needs to be relative so that the symlink still works when - # (as is normal) the user moves the app bundle out of the DMG - # and into the /Applications folder. Note we pass catch=False, - # letting the uncaught exception terminate the process, since - # without this symlink, Second Life web media can't possibly work. - - # It might seem simpler just to symlink Frameworks back to - # the parent of Chromimum Embedded Framework.framework. But - # that would create a symlink cycle, which breaks our - # packaging step. So make a symlink from Chromium Embedded - # Framework.framework to the directory of the same name, which - # is NOT an ancestor of the symlink. - - # from SLPlugin.app/Contents/Frameworks/Chromium Embedded - # Framework.framework back to - # $viewer_app/Contents/Frameworks/Chromium Embedded Framework.framework - SLPlugin_framework = self.relsymlinkf(CEF_framework, catch=False) - - # copy DullahanHelper.app - self.path2basename(relpkgdir, 'DullahanHelper.app') - - # and fix that up with a Frameworks/CEF symlink too - with self.prefix(dst=os.path.join( - 'DullahanHelper.app', 'Contents', 'Frameworks')): - # from Dullahan Helper.app/Contents/Frameworks/Chromium Embedded - # Framework.framework back to - # SLPlugin.app/Contents/Frameworks/Chromium Embedded Framework.framework - # Since SLPlugin_framework is itself a - # symlink, don't let relsymlinkf() resolve -- - # explicitly call relpath(symlink=True) and - # create that symlink here. - DullahanHelper_framework = \ - self.symlinkf(self.relpath(SLPlugin_framework, symlink=True), - catch=False) - - # change_command includes install_name_tool, the - # -change subcommand and the old framework rpath - # stamped into the executable. To use it with - # run_command(), we must still append the new - # framework path and the pathname of the - # executable to change. - change_command = [ - 'install_name_tool', '-change', - '@rpath/Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework'] - - with self.prefix(dst=os.path.join( - 'DullahanHelper.app', 'Contents', 'MacOS')): - # Now self.get_dst_prefix() is, at runtime, - # @executable_path. Locate the helper app - # framework (which is a symlink) from here. - newpath = os.path.join( - '@executable_path', - self.relpath(DullahanHelper_framework, symlink=True), - frameworkname) - # and restamp the DullahanHelper executable - self.run_command( - change_command + - [newpath, self.dst_path_of('DullahanHelper')]) - - # SLPlugin plugins - with self.prefix(dst="llplugin"): - dylibexecutable = 'media_plugin_cef.dylib' - self.path2basename("../media_plugins/cef/" + self.args['configuration'], - dylibexecutable) - - # Do this install_name_tool *after* media plugin is copied over. - # Locate the framework lib executable -- relative to - # SLPlugin.app/Contents/MacOS, which will be our - # @executable_path at runtime! - newpath = os.path.join( - '@executable_path', - self.relpath(SLPlugin_framework, executable_path["SLPlugin.app"], - symlink=True), - frameworkname) - # restamp media_plugin_cef.dylib - self.run_command( - change_command + - [newpath, self.dst_path_of(dylibexecutable)]) - - # copy LibVLC plugin itself - self.path2basename("../media_plugins/libvlc/" + self.args['configuration'], - "media_plugin_libvlc.dylib") - - # copy LibVLC dynamic libraries - with self.prefix(src=relpkgdir, dst="lib"): - self.path( "libvlc*.dylib*" ) - # copy LibVLC plugins folder - with self.prefix(src='plugins', dst=""): - self.path( "*.dylib" ) - self.path( "plugins.dat" ) + self.path("secondlife.icns") + + with self.prefix(src=relpkgdir, dst=""): + self.path("libndofdev.dylib") + self.path("libhunspell-1.3.0.dylib") + + with self.prefix("cursors_mac"): + self.path("*.tif") + + self.path("licenses-mac.txt", dst="licenses.txt") + self.path("featuretable_mac.txt") + self.path("SecondLife.nib") + + with self.prefix(src=pkgdir,dst=""): + self.path("ca-bundle.crt") + + self.path("SecondLife.nib") + + # Translations + self.path("English.lproj/language.txt") + self.replace_in(src="English.lproj/InfoPlist.strings", + dst="English.lproj/InfoPlist.strings", + searchdict={'%%VERSION%%':'.'.join(self.args['version'])} + ) + self.path("German.lproj") + self.path("Japanese.lproj") + self.path("Korean.lproj") + self.path("da.lproj") + self.path("es.lproj") + self.path("fr.lproj") + self.path("hu.lproj") + self.path("it.lproj") + self.path("nl.lproj") + self.path("pl.lproj") + self.path("pt.lproj") + self.path("ru.lproj") + self.path("tr.lproj") + self.path("uk.lproj") + self.path("zh-Hans.lproj") + + def path_optional(src, dst): + """ + For a number of our self.path() calls, not only do we want + to deal with the absence of src, we also want to remember + which were present. Return either an empty list (absent) + or a list containing dst (present). Concatenate these + return values to get a list of all libs that are present. + """ + # This was simple before we started needing to pass + # wildcards. Fortunately, self.path() ends up appending a + # (source, dest) pair to self.file_list for every expanded + # file processed. Remember its size before the call. + oldlen = len(self.file_list) + self.path(src, dst) + # The dest appended to self.file_list has been prepended + # with self.get_dst_prefix(). Strip it off again. + added = [os.path.relpath(d, self.get_dst_prefix()) + for s, d in self.file_list[oldlen:]] + if not added: + print "Skipping %s" % dst + return added + + # dylibs is a list of all the .dylib files we expect to need + # in our bundled sub-apps. For each of these we'll create a + # symlink from sub-app/Contents/Resources to the real .dylib. + # Need to get the llcommon dll from any of the build directories as well. + libfile_parent = self.get_dst_prefix() + libfile = "libllcommon.dylib" + dylibs = path_optional(self.find_existing_file(os.path.join(os.pardir, + "llcommon", + self.args['configuration'], + libfile), + os.path.join(relpkgdir, libfile)), + dst=libfile) + + for libfile in ( + "libapr-1.0.dylib", + "libaprutil-1.0.dylib", + "libcollada14dom.dylib", + "libexpat.1.dylib", + "libexception_handler.dylib", + "libGLOD.dylib", + # libnghttp2.dylib is a symlink to + # libnghttp2.major.dylib, which is a symlink to + # libnghttp2.version.dylib. Get all of them. + "libnghttp2.*dylib", + ): + dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) + + # SLVoice and vivox lols, no symlinks needed + for libfile in ( + 'libortp.dylib', + 'libsndfile.dylib', + 'libvivoxoal.dylib', + 'libvivoxsdk.dylib', + 'libvivoxplatform.dylib', + 'SLVoice', + ): + self.path2basename(relpkgdir, libfile) + + # dylibs that vary based on configuration + if self.args['configuration'].lower() == 'debug': + for libfile in ( + "libfmodexL.dylib", + ): + dylibs += path_optional(os.path.join(debpkgdir, libfile), libfile) + else: + for libfile in ( + "libfmodex.dylib", + ): + dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) + + # our apps + executable_path = {} + for app_bld_dir, app in (("mac_crash_logger", "mac-crash-logger.app"), + # plugin launcher + (os.path.join("llplugin", "slplugin"), "SLPlugin.app"), + ): + self.path2basename(os.path.join(os.pardir, + app_bld_dir, self.args['configuration']), + app) + executable_path[app] = \ + self.dst_path_of(os.path.join(app, "Contents", "MacOS")) + + # our apps dependencies on shared libs + # for each app, for each dylib we collected in dylibs, + # create a symlink to the real copy of the dylib. + with self.prefix(dst=os.path.join(app, "Contents", "Resources")): + for libfile in dylibs: + self.relsymlinkf(os.path.join(libfile_parent, libfile)) + + # Dullahan helper apps go inside SLPlugin.app + with self.prefix(dst=os.path.join( + "SLPlugin.app", "Contents", "Frameworks")): + + frameworkname = 'Chromium Embedded Framework' + + # This code constructs a relative symlink from the + # target framework folder back to the real CEF framework. + # It needs to be relative so that the symlink still works when + # (as is normal) the user moves the app bundle out of the DMG + # and into the /Applications folder. Note we pass catch=False, + # letting the uncaught exception terminate the process, since + # without this symlink, Second Life web media can't possibly work. + + # It might seem simpler just to symlink Frameworks back to + # the parent of Chromimum Embedded Framework.framework. But + # that would create a symlink cycle, which breaks our + # packaging step. So make a symlink from Chromium Embedded + # Framework.framework to the directory of the same name, which + # is NOT an ancestor of the symlink. + + # from SLPlugin.app/Contents/Frameworks/Chromium Embedded + # Framework.framework back to + # $viewer_app/Contents/Frameworks/Chromium Embedded Framework.framework + SLPlugin_framework = self.relsymlinkf(CEF_framework, catch=False) + + # copy DullahanHelper.app + self.path2basename(relpkgdir, 'DullahanHelper.app') + + # and fix that up with a Frameworks/CEF symlink too + with self.prefix(dst=os.path.join( + 'DullahanHelper.app', 'Contents', 'Frameworks')): + # from Dullahan Helper.app/Contents/Frameworks/Chromium Embedded + # Framework.framework back to + # SLPlugin.app/Contents/Frameworks/Chromium Embedded Framework.framework + # Since SLPlugin_framework is itself a + # symlink, don't let relsymlinkf() resolve -- + # explicitly call relpath(symlink=True) and + # create that symlink here. + DullahanHelper_framework = \ + self.symlinkf(self.relpath(SLPlugin_framework, symlink=True), + catch=False) + + # change_command includes install_name_tool, the + # -change subcommand and the old framework rpath + # stamped into the executable. To use it with + # run_command(), we must still append the new + # framework path and the pathname of the + # executable to change. + change_command = [ + 'install_name_tool', '-change', + '@rpath/Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework'] + + with self.prefix(dst=os.path.join( + 'DullahanHelper.app', 'Contents', 'MacOS')): + # Now self.get_dst_prefix() is, at runtime, + # @executable_path. Locate the helper app + # framework (which is a symlink) from here. + newpath = os.path.join( + '@executable_path', + self.relpath(DullahanHelper_framework, symlink=True), + frameworkname) + # and restamp the DullahanHelper executable + self.run_command( + change_command + + [newpath, self.dst_path_of('DullahanHelper')]) + + # SLPlugin plugins + with self.prefix(dst="llplugin"): + dylibexecutable = 'media_plugin_cef.dylib' + self.path2basename("../media_plugins/cef/" + self.args['configuration'], + dylibexecutable) + + # Do this install_name_tool *after* media plugin is copied over. + # Locate the framework lib executable -- relative to + # SLPlugin.app/Contents/MacOS, which will be our + # @executable_path at runtime! + newpath = os.path.join( + '@executable_path', + self.relpath(SLPlugin_framework, executable_path["SLPlugin.app"], + symlink=True), + frameworkname) + # restamp media_plugin_cef.dylib + self.run_command( + change_command + + [newpath, self.dst_path_of(dylibexecutable)]) + + # copy LibVLC plugin itself + self.path2basename("../media_plugins/libvlc/" + self.args['configuration'], + "media_plugin_libvlc.dylib") + + # copy LibVLC dynamic libraries + with self.prefix(src=relpkgdir, dst="lib"): + self.path( "libvlc*.dylib*" ) + # copy LibVLC plugins folder + with self.prefix(src='plugins', dst=""): + self.path( "*.dylib" ) + self.path( "plugins.dat" ) def package_finish(self): global CHANNEL_VENDOR_BASE -- cgit v1.2.3 From a74b3691aff94dfbd0fbfdce05f8a03168328ca7 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sun, 9 Sep 2018 09:22:06 -0400 Subject: DRTVWR-474, MAINT-9047: Make viewer_manifest use same bundle name. --- indra/newview/viewer_manifest.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 14ff2c194e..bddacf357d 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -871,6 +871,9 @@ class Windows_x86_64_Manifest(WindowsManifest): class DarwinManifest(ViewerManifest): build_data_json_platform = 'mac' + def app_bundle(self): + return self.app_name() + ".app" + def finish_build_data_dict(self, build_data_dict): build_data_dict.update({'Bundle Id':self.args['bundleid']}) return build_data_dict @@ -881,7 +884,10 @@ class DarwinManifest(ViewerManifest): def construct(self): # copy over the build result (this is a no-op if run within the xcode script) - self.path(os.path.join(self.args['configuration'], "Second Life.app"), dst="") + # Second Life.app is what CMake / Xcode builds + # self.app_bundle() is what we ultimately expect to sign and package + self.path(os.path.join(self.args['configuration'], "Second Life.app"), + dst=self.app_bundle()) pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") @@ -930,8 +936,6 @@ class DarwinManifest(ViewerManifest): with self.prefix(src=pkgdir,dst=""): self.path("ca-bundle.crt") - self.path("SecondLife.nib") - # Translations self.path("English.lproj/language.txt") self.replace_in(src="English.lproj/InfoPlist.strings", @@ -1180,8 +1184,6 @@ class DarwinManifest(ViewerManifest): # Copy everything in to the mounted .dmg - app_name = self.app_name() - # Hack: # Because there is no easy way to coerce the Finder into positioning # the app bundle in the same place with different app names, we are @@ -1195,7 +1197,7 @@ class DarwinManifest(ViewerManifest): if not os.path.exists (self.src_path_of(dmg_template)): dmg_template = os.path.join ('installers', 'darwin', 'release-dmg') - for s,d in {self.get_dst_prefix():app_name + ".app", + for s,d in {self.get_dst_prefix(): self.app_bundle(), os.path.join(dmg_template, "_VolumeIcon.icns"): ".VolumeIcon.icns", os.path.join(dmg_template, "background.jpg"): "background.jpg", os.path.join(dmg_template, "_DS_Store"): ".DS_Store"}.items(): @@ -1238,7 +1240,7 @@ class DarwinManifest(ViewerManifest): # the signature are preserved; moving the files using python will leave them behind # and invalidate the signatures. if 'signature' in self.args: - app_in_dmg=os.path.join(volpath,self.app_name()+".app") + app_in_dmg=os.path.join(volpath,self.app_bundle()) print "Attempting to sign '%s'" % app_in_dmg identity = self.args['signature'] if identity == '': @@ -1293,9 +1295,6 @@ class DarwinManifest(ViewerManifest): raise self.run_command(['spctl', '-a', '-texec', '-vv', app_in_dmg]) - imagename="SecondLife_" + '_'.join(self.args['version']) - - finally: # Unmount the image even if exceptions from any of the above self.run_command(['hdiutil', 'detach', '-force', devfile]) -- cgit v1.2.3 From 299d4807ab6bc35c3643134a142fb59d5931bed9 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 10 Sep 2018 12:23:42 -0400 Subject: DRTVWR-474, MAINT-9047: Back out changeset 2ed01671b974. We'll try to address the Mac app bundle name discrepancy a different way. --- indra/newview/viewer_manifest.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index bddacf357d..14ff2c194e 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -871,9 +871,6 @@ class Windows_x86_64_Manifest(WindowsManifest): class DarwinManifest(ViewerManifest): build_data_json_platform = 'mac' - def app_bundle(self): - return self.app_name() + ".app" - def finish_build_data_dict(self, build_data_dict): build_data_dict.update({'Bundle Id':self.args['bundleid']}) return build_data_dict @@ -884,10 +881,7 @@ class DarwinManifest(ViewerManifest): def construct(self): # copy over the build result (this is a no-op if run within the xcode script) - # Second Life.app is what CMake / Xcode builds - # self.app_bundle() is what we ultimately expect to sign and package - self.path(os.path.join(self.args['configuration'], "Second Life.app"), - dst=self.app_bundle()) + self.path(os.path.join(self.args['configuration'], "Second Life.app"), dst="") pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") @@ -936,6 +930,8 @@ class DarwinManifest(ViewerManifest): with self.prefix(src=pkgdir,dst=""): self.path("ca-bundle.crt") + self.path("SecondLife.nib") + # Translations self.path("English.lproj/language.txt") self.replace_in(src="English.lproj/InfoPlist.strings", @@ -1184,6 +1180,8 @@ class DarwinManifest(ViewerManifest): # Copy everything in to the mounted .dmg + app_name = self.app_name() + # Hack: # Because there is no easy way to coerce the Finder into positioning # the app bundle in the same place with different app names, we are @@ -1197,7 +1195,7 @@ class DarwinManifest(ViewerManifest): if not os.path.exists (self.src_path_of(dmg_template)): dmg_template = os.path.join ('installers', 'darwin', 'release-dmg') - for s,d in {self.get_dst_prefix(): self.app_bundle(), + for s,d in {self.get_dst_prefix():app_name + ".app", os.path.join(dmg_template, "_VolumeIcon.icns"): ".VolumeIcon.icns", os.path.join(dmg_template, "background.jpg"): "background.jpg", os.path.join(dmg_template, "_DS_Store"): ".DS_Store"}.items(): @@ -1240,7 +1238,7 @@ class DarwinManifest(ViewerManifest): # the signature are preserved; moving the files using python will leave them behind # and invalidate the signatures. if 'signature' in self.args: - app_in_dmg=os.path.join(volpath,self.app_bundle()) + app_in_dmg=os.path.join(volpath,self.app_name()+".app") print "Attempting to sign '%s'" % app_in_dmg identity = self.args['signature'] if identity == '': @@ -1295,6 +1293,9 @@ class DarwinManifest(ViewerManifest): raise self.run_command(['spctl', '-a', '-texec', '-vv', app_in_dmg]) + imagename="SecondLife_" + '_'.join(self.args['version']) + + finally: # Unmount the image even if exceptions from any of the above self.run_command(['hdiutil', 'detach', '-force', devfile]) -- cgit v1.2.3 From 298a52f96a92f4368b3c5d955eab6b37a58f4931 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 10 Sep 2018 17:01:53 -0400 Subject: DRTVWR-474, MAINT-9047: Try *not* copying the viewer built by CMake. The start of viewer_manifest.DarwinManifest.construct() is a path() call to copy the whole viewer tree from where CMake constructs it. The comment is: "(this is a no-op if run within the xcode script)." Unfortunately, for unclear reasons, this has recently started nesting Second Life.app within the Second Life.app directory, and even to multiple levels. When that happens, copying the outermost .app directory to the sparseimage in order to convert to dmg runs out of room because we're trying to pack multiple copies of the whole viewer tree into the fixed-size sparseimage. But if it works to simply skip that entire initial copy operation, so much the better. --- indra/newview/viewer_manifest.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 14ff2c194e..d16b5d9a7c 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -880,8 +880,8 @@ class DarwinManifest(ViewerManifest): return True def construct(self): - # copy over the build result (this is a no-op if run within the xcode script) - self.path(os.path.join(self.args['configuration'], "Second Life.app"), dst="") +## # copy over the build result (this is a no-op if run within the xcode script) +## self.path(os.path.join(self.args['configuration'], "Second Life.app"), dst="") pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") @@ -1238,6 +1238,11 @@ class DarwinManifest(ViewerManifest): # the signature are preserved; moving the files using python will leave them behind # and invalidate the signatures. if 'signature' in self.args: + print 72*'=' + print 'In {}:'.format(volpath) + for f in os.listdir(volpath): + print ' {}'.format(f) + print 72*'=' app_in_dmg=os.path.join(volpath,self.app_name()+".app") print "Attempting to sign '%s'" % app_in_dmg identity = self.args['signature'] -- cgit v1.2.3 From e0467f506136dd1fa044da130c7ffd3e817acc07 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 11 Sep 2018 09:18:56 -0400 Subject: DRTVWR-474, MAINT-9047: Must copy CMake-built viewer for EDU. --- indra/newview/viewer_manifest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index d16b5d9a7c..4e6c112cda 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -880,8 +880,8 @@ class DarwinManifest(ViewerManifest): return True def construct(self): -## # copy over the build result (this is a no-op if run within the xcode script) -## self.path(os.path.join(self.args['configuration'], "Second Life.app"), dst="") + # copy over the build result (this is a no-op if run within the xcode script) + self.path(os.path.join(self.args['configuration'], "Second Life.app"), dst="") pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") -- cgit v1.2.3 From c6865bcd366379028029a24281812cf320de8aff Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 11 Sep 2018 13:56:21 -0400 Subject: DRTVWR-474, MAINT-9047: Make failing spctl command more verbose. --- indra/newview/viewer_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 4e6c112cda..de296bec75 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1296,7 +1296,7 @@ class DarwinManifest(ViewerManifest): else: print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" raise - self.run_command(['spctl', '-a', '-texec', '-vv', app_in_dmg]) + self.run_command(['spctl', '-a', '-texec', '-vvvv', app_in_dmg]) imagename="SecondLife_" + '_'.join(self.args['version']) -- cgit v1.2.3 From 517e1605e9feb203c9ccd9a115a21cae9bbc704b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 11 Sep 2018 16:04:33 -0400 Subject: DRTVWR-474, MAINT-9047: Display top-level app bundle in sparseimage. codesign claims to succeed, but spctl says: /Volumes/Second Life Installer/Second Life Test.app: rejected (the code is valid but does not seem to be an app) Why not? Display what's in Second Life.app/Contents on the mounted sparseimage: show Info.plist, list Frameworks, MacOS, Resources. --- indra/newview/viewer_manifest.py | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index de296bec75..5078f323ae 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1238,11 +1238,6 @@ class DarwinManifest(ViewerManifest): # the signature are preserved; moving the files using python will leave them behind # and invalidate the signatures. if 'signature' in self.args: - print 72*'=' - print 'In {}:'.format(volpath) - for f in os.listdir(volpath): - print ' {}'.format(f) - print 72*'=' app_in_dmg=os.path.join(volpath,self.app_name()+".app") print "Attempting to sign '%s'" % app_in_dmg identity = self.args['signature'] @@ -1296,11 +1291,36 @@ class DarwinManifest(ViewerManifest): else: print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" raise + print 72*'=' + import stat + print app_in_dmg + # Second Life.app + for sub0 in os.listdir(app_in_dmg): + print '--{}'.format(sub0) + path0 = os.path.join(app_in_dmg, sub0) + if os.path.isfile(path0): + # shouldn't be any file here + with open(path0) as inf: + for line in inf: + print ' {}'.format(line.rstrip()) + elif os.path.isdir(path0): + # Contents + for sub1 in os.listdir(path0): + print '----{}'.format(sub1) + path1 = os.path.join(path0, sub1) + if os.path.isfile(path1): + # Info.plist, PkgInfo + with open(path1) as inf: + for line in inf: + print ' {}'.format(line.rstrip()) + elif os.path.isdir(path1): + # Frameworks, MacOS, Resources + for sub2 in os.listdir(path1): + path2 = os.path.join(path1, sub2) + print ' {:04o} {}'.format(stat.S_IMODE(os.stat(path2).st_mode), sub2) + print 72*'=' self.run_command(['spctl', '-a', '-texec', '-vvvv', app_in_dmg]) - imagename="SecondLife_" + '_'.join(self.args['version']) - - finally: # Unmount the image even if exceptions from any of the above self.run_command(['hdiutil', 'detach', '-force', devfile]) -- cgit v1.2.3 From e3d16dcb70da26c7952b45252b74716b1a632b97 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 11 Sep 2018 19:57:42 -0400 Subject: DRTVWR-474: Remove nag about SL_Launcher. --- indra/newview/llappviewer.cpp | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 687b76c224..dd1d4cea39 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1083,26 +1083,6 @@ bool LLAppViewer::init() } } -// don't nag developers who need to run the executable directly -#if LL_RELEASE_FOR_DOWNLOAD - // MAINT-8305: If we're processing a SLURL, skip the launcher check. - if (gSavedSettings.getString("CmdLineLoginLocation").empty()) - { - const char* PARENT = getenv("PARENT"); - if (! (PARENT && std::string(PARENT) == "SL_Launcher")) - { - // Don't directly run this executable. Please run the launcher, which - // will run the viewer itself. - // Naturally we do not consider this bulletproof. The point is to - // gently remind a user who *inadvertently* finds him/herself in this - // situation to do things the Right Way. Anyone who intentionally - // bypasses this mechanism needs no reminder that s/he's shooting - // him/herself in the foot. - LLNotificationsUtil::add("RunLauncher"); - } - } -#endif - #if LL_WINDOWS if (gGLManager.mGLVersion < LLFeatureManager::getInstance()->getExpectedGLVersion()) { -- cgit v1.2.3 From aaf45f0f63a1c79393e6316e04f78476d2a2af6e Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 11 Sep 2018 19:59:03 -0400 Subject: DRTVWR-474, MAINT-9047: Set viewer name in Info.plist, not launcher. --- indra/newview/CMakeLists.txt | 8 +------- indra/newview/Info-SecondLife.plist | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 2fc722d4c3..212677717e 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2056,13 +2056,7 @@ endif (LINUX) if (DARWIN) # These all get set with PROPERTIES set(product "Second Life") - # this is the setting for the Python wrapper, see SL-322 and WRAPPER line in Info-SecondLife.plist - if (PACKAGE) - set(MACOSX_WRAPPER_EXECUTABLE_NAME "SL_Launcher") - else (PACKAGE) - # force the name of the actual executable to allow running it within Xcode for debugging - set(MACOSX_WRAPPER_EXECUTABLE_NAME "../Resources/Second Life Viewer.app/Contents/MacOS/Second Life") - endif (PACKAGE) + set(MACOSX_EXECUTABLE_NAME "Second Life") set(MACOSX_BUNDLE_INFO_STRING "Second Life Viewer") set(MACOSX_BUNDLE_ICON_FILE "secondlife.icns") set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer") diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index af4cf26ac6..31b4201f47 100644 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleExecutable - ${MACOSX_WRAPPER_EXECUTABLE_NAME} + ${MACOSX_EXECUTABLE_NAME} CFBundleGetInfoString ${MACOSX_BUNDLE_INFO_STRING} CFBundleIconFile -- cgit v1.2.3 From 2081b8a654fa78c4414ec2619522c8ef461a1881 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 12 Sep 2018 12:15:41 -0400 Subject: DRTVWR-474: Make NSIS run new updater.exe after install. But change shortcuts and registry entries and everything else back to the real viewer executable, so that every subsequent run directly launches the viewer. Eliminate SL_Launcher references from viewer_manifest.py. --- .../installers/windows/installer_template.nsi | 41 ++++++++++++++-------- indra/newview/viewer_manifest.py | 9 +++-- 2 files changed, 31 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 14c8dba39f..c53d7989fc 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -299,7 +299,7 @@ StrCpy $SHORTCUT_LANG_PARAM "--set InstallLanguage $(LanguageCode)" CreateDirectory "$SMPROGRAMS\$INSTSHORTCUT" SetOutPath "$INSTDIR" CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT.lnk" \ - "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" + "$INSTDIR\$VIEWER_EXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Create Account.url" \ @@ -317,9 +317,9 @@ CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\Uninstall $INSTSHORTCUT.lnk" \ # Other shortcuts SetOutPath "$INSTDIR" CreateShortCut "$DESKTOP\$INSTSHORTCUT.lnk" \ - "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" + "$INSTDIR\$VIEWER_EXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" CreateShortCut "$INSTDIR\$INSTSHORTCUT.lnk" \ - "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" + "$INSTDIR\$VIEWER_EXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \ '"$INSTDIR\uninst.exe"' '' @@ -327,7 +327,7 @@ CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \ WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" "$INSTDIR" WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version" "${VERSION_LONG}" WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Shortcut" "$INSTSHORTCUT" -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" "$INSTEXE" +WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" "$VIEWER_EXE" WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "Publisher" "Linden Research, Inc." WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "URLInfoAbout" "http://secondlife.com/whatis/" WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "URLUpdateInfo" "http://secondlife.com/support/downloads/" @@ -338,10 +338,10 @@ WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninst WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "EstimatedSize" "0x0001D500" # ~117 MB # from FS:Ansariel -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayIcon" '"$INSTDIR\$INSTEXE"' +WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayIcon" '"$INSTDIR\$VIEWER_EXE"' # BUG-2707 Disable SEHOP for installed viewer. -WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$INSTEXE" "DisableExceptionChainValidation" 1 +WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$VIEWER_EXE" "DisableExceptionChainValidation" 1 # Write URL registry info WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "(default)" "URL:Second Life" @@ -358,9 +358,8 @@ WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info\DefaultIcon" "" '"$INSTDIR\$ # URL param must be last item passed to viewer, it ignores subsequent params to avoid parameter injection attacks. WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"' -# Only allow Launcher to be the icon -WriteRegStr HKEY_CLASSES_ROOT "Applications\$INSTEXE" "IsHostApp" "" -WriteRegStr HKEY_CLASSES_ROOT "Applications\${VIEWER_EXE}" "NoStartPage" "" +WriteRegStr HKEY_CLASSES_ROOT "Applications\$VIEWER_EXE" "IsHostApp" "" +##WriteRegStr HKEY_CLASSES_ROOT "Applications\${VIEWER_EXE}" "NoStartPage" "" # Write out uninstaller WriteUninstaller "$INSTDIR\uninst.exe" @@ -398,8 +397,8 @@ Call un.CloseSecondLife DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" # BUG-2707 Remove entry that disabled SEHOP -DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$INSTEXE" -DeleteRegKey HKEY_CLASSES_ROOT "Applications\$INSTEXE" +DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$VIEWER_EXE" +##DeleteRegKey HKEY_CLASSES_ROOT "Applications\$INSTEXE" DeleteRegKey HKEY_CLASSES_ROOT "Applications\${VIEWER_EXE}" # Clean up shortcuts @@ -537,6 +536,7 @@ Function RemoveProgFilesOnInst # Remove old SecondLife.exe to invalidate any old shortcuts to it that may be in non-standard locations. See MAINT-3575 Delete "$INSTDIR\$INSTEXE" +Delete "$INSTDIR\$VIEWER_EXE" # Remove old shader files first so fallbacks will work. See DEV-5663 RMDir /r "$INSTDIR\app_settings\shaders" @@ -673,7 +673,7 @@ FunctionEnd ;; After install completes, launch app ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function .onInstSuccess -Call CheckWindowsServPack # Warn if not on the latest SP before asking to launch. + Call CheckWindowsServPack # Warn if not on the latest SP before asking to launch. Push $R0 Push $0 ;; MAINT-7812: Only write nsis.winstall file with /marker switch @@ -694,8 +694,21 @@ Call CheckWindowsServPack # Warn if not on the latest SP before asking to launc Pop $R0 Push $R0 # Option value, unused# StrCmp $SKIP_AUTORUN "true" +2; -# Assumes SetOutPath $INSTDIR - Exec '"$WINDIR\explorer.exe" "$INSTDIR\$INSTSHORTCUT.lnk"' + # Assumes SetOutPath $INSTDIR + # Run INSTEXE (our updater), passing VIEWER_EXE plus the command-line + # arguments built into our shortcuts. This gives the updater a chance + # to verify that the viewer we just installed is appropriate for the + # running system -- or, if not, to download and install a different + # viewer. For instance, if a user running 32-bit Windows installs a + # 64-bit viewer, it cannot run on this system. But since the updater + # is a 32-bit executable even in the 64-bit viewer package, the + # updater can detect the problem and adapt accordingly. + # Once everything is in order, the updater will run the specified + # viewer with the specified params. + # Quote the updater executable and the viewer executable because each + # must be a distinct command-line token, but DO NOT quote the language + # string because it must decompose into separate command-line tokens. + Exec '"$INSTDIR\$INSTEXE" "$INSTDIR\VIEWER_EXE" $SHORTCUT_LANG_PARAM' Pop $R0 # FunctionEnd diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 5078f323ae..6540aa9f6b 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -490,7 +490,7 @@ class WindowsManifest(ViewerManifest): with self.prefix(src=os.path.join(pkgdir, "VMP"), dst=""): # include the compiled launcher scripts so that it gets included in the file_list - self.path('SL_Launcher.exe') + self.path('updater.exe') #IUM is not normally executed directly, just imported. No exe needed. self.path("InstallerUserMessage.py") @@ -768,7 +768,7 @@ class WindowsManifest(ViewerManifest): substitution_strings['installer_file'] = installer_file version_vars = """ - !define INSTEXE "SL_Launcher.exe" + !define INSTEXE "updater.exe" !define VERSION "%(version_short)s" !define VERSION_LONG "%(version)s" !define VERSION_DASHES "%(version_dashes)s" @@ -812,7 +812,7 @@ class WindowsManifest(ViewerManifest): # note that the enclosing setup exe is signed later, after the makensis makes it. # Unlike the viewer binary, the VMP filenames are invariant with respect to version, os, etc. for exe in ( - "SL_Launcher.exe", + "updater.exe", ): self.sign(exe) @@ -1376,7 +1376,6 @@ class LinuxManifest(ViewerManifest): self.path2basename("../llplugin/slplugin", "SLPlugin") #this copies over the python wrapper script, associated utilities and required libraries, see SL-321, SL-322 and SL-323 with self.prefix(src="../viewer_components/manager", dst=""): - self.path("SL_Launcher") self.path("*.py") with self.prefix(src=os.path.join("lib", "python", "llbase"), dst="llbase"): self.path("*.py") @@ -1455,7 +1454,7 @@ class LinuxManifest(ViewerManifest): self.run_command( ["find"] + [os.path.join(self.get_dst_prefix(), dir) for dir in ('bin', 'lib')] + - ['-type', 'f', '!', '-name', '*.py', '!', '-name', 'SL_Launcher', + ['-type', 'f', '!', '-name', '*.py', '!', '-name', 'update_install', '-exec', 'strip', '-S', '{}', ';']) class Linux_i686_Manifest(LinuxManifest): -- cgit v1.2.3 From d41245f252442d91432f06b039abea81831cc083 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 12 Sep 2018 20:13:53 -0400 Subject: DRTVWR-474: $VIEWER_EXE, rather than plain VIEWER_EXE --- indra/newview/installers/windows/installer_template.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index c53d7989fc..3117cf6b85 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -708,7 +708,7 @@ Function .onInstSuccess # Quote the updater executable and the viewer executable because each # must be a distinct command-line token, but DO NOT quote the language # string because it must decompose into separate command-line tokens. - Exec '"$INSTDIR\$INSTEXE" "$INSTDIR\VIEWER_EXE" $SHORTCUT_LANG_PARAM' + Exec '"$INSTDIR\$INSTEXE" "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' Pop $R0 # FunctionEnd -- cgit v1.2.3 From 289813994eb492d16e3af0fa30835e2b26a84ced Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 13 Sep 2018 16:20:05 -0400 Subject: DRTVWR-474: Clean up use of LLDir::getAppRODataDir(), esp. on Mac. Clearly it's not obvious to maintainers that on the Mac, getAppRODataDir() returns the app's Resources directory: in a number of places the code starts with the executable directory and appends "../Resources" to find that. --- indra/newview/llstartup.cpp | 3 +-- indra/newview/llvoicevivox.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 7a4c41779a..4c51873715 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -479,8 +479,7 @@ bool idle_startup() if (!found_template) { message_template_path = - gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, - "../Resources/app_settings", + gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "message_template.msg"); found_template = LLFile::fopen(message_template_path.c_str(), "r"); /* Flawfinder: ignore */ } diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index b90e09b739..88d17a31a4 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -770,14 +770,13 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon() { #ifndef VIVOXDAEMON_REMOTEHOST // Launch the voice daemon - std::string exe_path = gDirUtilp->getExecutableDir(); - exe_path += gDirUtilp->getDirDelimiter(); + std::string exe_path = gDirUtilp->getAppRODataDir(); #if LL_WINDOWS - exe_path += "SLVoice.exe"; + gDirUtilp->append(exe_path, "SLVoice.exe"); #elif LL_DARWIN - exe_path += "../Resources/SLVoice"; + gDirUtilp->append(exe_path, "SLVoice"); #else - exe_path += "SLVoice"; + gDirUtilp->append(exe_path, "SLVoice"); #endif // See if the vivox executable exists llstat s; -- cgit v1.2.3 From 83b40329fd822277ff5b47e6f36a7897c85e6260 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 13 Sep 2018 16:22:38 -0400 Subject: DRTVWR-474: Make NSIS installer invoke updater precheck subcommand. --- indra/newview/installers/windows/installer_template.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 3117cf6b85..76187b49a5 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -708,7 +708,7 @@ Function .onInstSuccess # Quote the updater executable and the viewer executable because each # must be a distinct command-line token, but DO NOT quote the language # string because it must decompose into separate command-line tokens. - Exec '"$INSTDIR\$INSTEXE" "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' + Exec '"$INSTDIR\$INSTEXE" precheck "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' Pop $R0 # FunctionEnd -- cgit v1.2.3 From cc99cd65cf0355f201157d8f71743899af6f2ade Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 13 Sep 2018 16:23:45 -0400 Subject: DRTVWR-474: Copy updater and its icons into Mac app's Resources. --- indra/newview/viewer_manifest.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 6540aa9f6b..32ff7f6ea8 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -470,7 +470,7 @@ class WindowsManifest(ViewerManifest): pass except NoMatchingAssemblyException as err: pass - + self.ccopy(src,dst) else: raise Exception("Directories are not supported by test_CRT_and_copy_action()") @@ -916,6 +916,15 @@ class DarwinManifest(ViewerManifest): with self.prefix(src=self.icon_path(), dst="") : self.path("secondlife.icns") + # Copy in the updater script and helper modules + self.path(src=os.path.join(pkgdir, 'VMP'), dst="updater") + + with self.prefix(src="", dst=os.path.join("updater", "icons")): + self.path2basename(os.path.join(self.icon_path(), "secondlife.ico")) + with self.prefix(src="vmp_icons", dst=""): + self.path("*.png") + self.path("*.gif") + with self.prefix(src=relpkgdir, dst=""): self.path("libndofdev.dylib") self.path("libhunspell-1.3.0.dylib") -- cgit v1.2.3 From a6e2201d2cff8fe03c83a75a2766d1ab71d35a21 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 13 Sep 2018 16:24:53 -0400 Subject: DRTVWR-474: Run the new updater in LEAP mode. --- indra/newview/llappviewer.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index dd1d4cea39..68bb20386a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1130,6 +1130,21 @@ bool LLAppViewer::init() gGLActive = FALSE; +#if LL_WINDOWS + std::string updater( + "\"" + gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe") + "\""); +#elif LL_DARWIN + std::string updater( + "python \"" + gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py") + "\""); +#else + std::string updater( + "\"" + gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater") + "\""); +#endif + + // Run the updater, specifying LEAP mode. An exception from the updater + // should bother us. + LLLeap::create("updater process", (updater + " leap"), true); + // Iterate over --leap command-line options. But this is a bit tricky: if // there's only one, it won't be an array at all. LLSD LeapCommand(gSavedSettings.getLLSD("LeapCommand")); -- cgit v1.2.3 From e00a8dee3f9675296df5c614b4483509c2ff55bb Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 13 Sep 2018 20:26:21 -0400 Subject: DRTVWR-474: Fix path2basename("secondlife.ico") call. --- indra/newview/viewer_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 32ff7f6ea8..4f0f4b17d9 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -920,7 +920,7 @@ class DarwinManifest(ViewerManifest): self.path(src=os.path.join(pkgdir, 'VMP'), dst="updater") with self.prefix(src="", dst=os.path.join("updater", "icons")): - self.path2basename(os.path.join(self.icon_path(), "secondlife.ico")) + self.path2basename(self.icon_path(), "secondlife.ico") with self.prefix(src="vmp_icons", dst=""): self.path("*.png") self.path("*.gif") -- cgit v1.2.3 From 807992adca4708bd2050b1fee8074d3e4521dd30 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 13 Sep 2018 20:55:05 -0400 Subject: DRTVWR-474: Pass updater cmd to LLLeap::create() as vector. This avoids having to tokenize a single string, avoiding swallowing backslashes in Windows pathnames in the mistaken belief they're escape characters. Alternatively, it avoids us having to double-escape them or convert them to forward slashes or whatever. --- indra/newview/llappviewer.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 68bb20386a..c0fcdd7c79 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1131,19 +1131,21 @@ bool LLAppViewer::init() gGLActive = FALSE; #if LL_WINDOWS - std::string updater( - "\"" + gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe") + "\""); + std::vector updater + { gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe") }; #elif LL_DARWIN - std::string updater( - "python \"" + gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py") + "\""); + // explicitly run the system Python interpreter on updater.py + std::vector updater + { "python", gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py") }; #else - std::string updater( - "\"" + gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater") + "\""); + std::vector updater + { gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater") }; #endif + // add LEAP mode command-line argument to whichever of these we selected + updater.push_back("leap"); - // Run the updater, specifying LEAP mode. An exception from the updater - // should bother us. - LLLeap::create("updater process", (updater + " leap"), true); + // Run the updater. An exception from the updater should bother us. + LLLeap::create("updater process", updater, true); // Iterate over --leap command-line options. But this is a bit tricky: if // there's only one, it won't be an array at all. -- cgit v1.2.3 From 8761e87ac526034f7a601eee5fdb667eba6eefda Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 24 Sep 2018 14:02:23 -0400 Subject: DRTVWR-474: Remove Python autobuild packages and references to them. We expect the viewer-manager package to be self-contained: we expect it to bring with it any Python packages it requires. We no longer force developers to wrap third-party Python packages as autobuild packages. --- indra/newview/CMakeLists.txt | 2 -- indra/newview/viewer_manifest.py | 8 -------- 2 files changed, 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 212677717e..e7111ebe54 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -16,7 +16,6 @@ include(GLOD) include(Hunspell) include(JsonCpp) include(LLAppearance) -include(LLBase) include(LLAudio) include(LLCA) include(LLCharacter) @@ -44,7 +43,6 @@ include(OPENAL) include(OpenGL) include(OpenSSL) include(PNG) -include(Requests) include(TemplateCheck) include(UI) include(UnixInstall) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 4f0f4b17d9..57da87a3ee 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -502,11 +502,6 @@ class WindowsManifest(ViewerManifest): self.path("*.png") self.path("*.gif") - #before, we only needed llbase at build time. With VMP, we need it at run time. - with self.prefix(src=os.path.join(pkgdir, "lib", "python", "llbase"), dst="llbase"): - self.path("*.py") - self.path("_cllsd.so") - # Plugin host application self.path2basename(os.path.join(os.pardir, 'llplugin', 'slplugin', self.args['configuration']), @@ -1386,9 +1381,6 @@ class LinuxManifest(ViewerManifest): #this copies over the python wrapper script, associated utilities and required libraries, see SL-321, SL-322 and SL-323 with self.prefix(src="../viewer_components/manager", dst=""): self.path("*.py") - with self.prefix(src=os.path.join("lib", "python", "llbase"), dst="llbase"): - self.path("*.py") - self.path("_cllsd.so") # recurses, packaged again self.path("res-sdl") -- cgit v1.2.3