diff options
-rwxr-xr-x | indra/newview/CMakeLists.txt | 16 | ||||
-rwxr-xr-x | indra/newview/installers/windows/installer_template.nsi | 10 | ||||
-rwxr-xr-x | indra/newview/viewer_manifest.py | 4 | ||||
-rwxr-xr-x | indra/viewer_components/manager/SL_Launcher | 40 |
4 files changed, 55 insertions, 15 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 3056b5d749..c81de43068 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1782,6 +1782,22 @@ if (WINDOWS) ${SHARED_LIB_STAGING_DIR}/Debug/fmodexL.dll ) endif (FMODEX) + + get_filename_component(PYTHON_DIRECTORY ${PYTHON_EXECUTABLE} DIRECTORY) + + # http://pythonhosted.org/PyInstaller/#options + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/SL_Launcher.exe + COMMAND ${PYTHON_DIRECTORY}/Scripts/pyinstaller.exe + ARGS + --onefile + --log-level WARN + --distpath ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} + ${CMAKE_SOURCE_DIR}/viewer_components/manager/SL_Launcher + COMMENT "Performing pyinstaller compile of SL_Launcher" + ) + + add_custom_target(compile_w_viewer_launcher ALL DEPENDS ${CMAKE_CFG_INTDIR}/SL_Launcher.exe) add_custom_command( OUTPUT ${CMAKE_CFG_INTDIR}/copy_touched.bat diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index b8677fd9e4..d833af8742 100755 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -276,7 +276,7 @@ StrCpy $SHORTCUT_LANG_PARAM "--set InstallLanguage $(LanguageCode)" CreateDirectory "$SMPROGRAMS\$INSTSHORTCUT"
SetOutPath "$INSTDIR"
CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT.lnk" \
- "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM"
+ "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" "%%SOURCE%%\icons\release\secondlife.ico"
WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Create Account.url" \
@@ -294,15 +294,15 @@ CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\Uninstall $INSTSHORTCUT.lnk" \ # Other shortcuts
SetOutPath "$INSTDIR"
CreateShortCut "$DESKTOP\$INSTSHORTCUT.lnk" \
- "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM"
+ "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" "%%SOURCE%%\icons\release\secondlife.ico"
CreateShortCut "$INSTDIR\$INSTSHORTCUT.lnk" \
- "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM"
+ "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" "%%SOURCE%%\icons\release\secondlife.ico"
CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \
'"$INSTDIR\uninst.exe"' ''
-# Create *.bat file to specify lang params on first run from installer - see MAINT-5259
+# Create *.bat file to specify lang params on first run from installer - see MAINT-5259S
FileOpen $9 "$INSTDIR\autorun.bat" w
-FileWrite $9 'start "$INSTDIR\$INSTEXE" "$INSTDIR\$INSTEXE" $SHORTCUT_LANG_PARAM$\r$\n'
+FileWrite $9 'start "$INSTDIR\$INSTEXE" /d "$INSTDIR" "$INSTDIR\$INSTEXE" $SHORTCUT_LANG_PARAM$\r$\n'
FileClose $9
# Write registry
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 60042706e4..f56dcd3f34 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -338,6 +338,8 @@ class Windows_i686_Manifest(ViewerManifest): if self.is_packaging_viewer(): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe()) + # include the compiled launcher script so that it gets included in the file_list + self.path(src='%s/SL_Launcher.exe' % self.args['configuration'], dst="SL_Launcher.exe") # Plugin host application self.path2basename(os.path.join(os.pardir, @@ -611,7 +613,7 @@ class Windows_i686_Manifest(ViewerManifest): substitution_strings['installer_file'] = installer_file version_vars = """ - !define INSTEXE "%(final_exe)s" + !define INSTEXE "SL_Launcher.exe" !define VERSION "%(version_short)s" !define VERSION_LONG "%(version)s" !define VERSION_DASHES "%(version_dashes)s" diff --git a/indra/viewer_components/manager/SL_Launcher b/indra/viewer_components/manager/SL_Launcher index 3c5d45d6e5..fb07d3b991 100755 --- a/indra/viewer_components/manager/SL_Launcher +++ b/indra/viewer_components/manager/SL_Launcher @@ -22,7 +22,36 @@ import sys import subprocess import Tkinter as tk -viewer_binary = os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])),"Second Life") +parser = argparse.ArgumentParser() +#parser.add_argument('--f', action='store_const', const=42) +args = parser.parse_known_args(sys.argv) +args_list_to_pass = args[1][1:] +args_list_to_pass.insert(0,viewer_binary) +#print "COYOT: arrrrrghs to pass", args_list_to_pass + +cwd = os.path.dirname(os.path.realpath(__file__)) + +executable_name = "" +if sys.platform.startswith('darwin'): + executable_name = "Second Life" +elif sys.platform.startswith("win") or sys.platform.startswith("cyg"): + if os.path.isfile(os.path.join(cwd,"SecondLifeViewer.exe")): + executable_name = "SecondLifeViewer.exe" + elif os.path.isfile(os.path.join(cwd,"SecondLifeTest.exe")): + executable_name = "SecondLifeTest.exe" + else: + #unsupported by prototypeS + sys.exit("Can't find Windows viewer binary") +elif sys.platform.startswith("linux"): + executable_name = "secondlife" +else: + #SL doesn't run on VMS or punch cards + sys.exit("Unsupported platform") + +#print "COYOT: executable name ", executable_name +#print "COYOT: path ", os.path.dirname(os.path.abspath(sys.argv[0])) + +viewer_binary = os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])),executable_name) #to prove we are launching from the script, launch a Tkinter window first root = tk.Tk() @@ -31,11 +60,4 @@ w.pack() root.after(10000, lambda: root.destroy()) # Destroy the widget after 10 seconds root.mainloop() -parser = argparse.ArgumentParser() -#parser.add_argument('--f', action='store_const', const=42) -args = parser.parse_known_args(sys.argv) -args_list_to_pass = args[1][1:] -args_list_to_pass.insert(0,viewer_binary) -#print args_list_to_pass - -viewer_process = subprocess.Popen(args_list_to_pass)
\ No newline at end of file +viewer_process = subprocess.Popen(args_list_to_pass) |