From 10bcd510b59fe73bf9e948de3dce9cea6d7d8b93 Mon Sep 17 00:00:00 2001
From: Callum Prentice <callum@gmail.com>
Date: Fri, 10 Mar 2017 15:11:44 -0800
Subject: MAINT-6998 [Project Alex Ivy] 64bit viewer installs to Program Files
 (x86) by default.

---
 indra/newview/installers/windows/installer_template.nsi | 2 +-
 indra/newview/viewer_manifest.py                        | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

(limited to 'indra')

diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi
index 89317f2793..42f8e0ce1f 100644
--- a/indra/newview/installers/windows/installer_template.nsi
+++ b/indra/newview/installers/windows/installer_template.nsi
@@ -90,7 +90,7 @@ InstProgressFlags smooth colored		# New colored smooth look
 SetOverwrite on							# Overwrite files by default
 AutoCloseWindow true					# After all files install, close window
 
-InstallDir "$PROGRAMFILES\${INSTNAME}"
+InstallDir "%%$PROGRAMFILES%%\${INSTNAME}"
 InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" ""
 UninstallText $(UninstallTextMsg)
 DirText $(DirectoryChooseTitle) $(DirectoryChooseSetup)
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 2d868c407d..1b2c502729 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -631,6 +631,11 @@ class WindowsManifest(ViewerManifest):
             Caption "%(caption)s"
             """
 
+        if(self.args['arch'].lower() == 'x86_64'):
+            program_files="$PROGRAMFILES64"
+        else:
+            program_files="$PROGRAMFILES32"
+
         tempfile = "secondlife_setup_tmp.nsi"
         # the following replaces strings in the nsi template
         # it also does python-style % substitution
@@ -639,6 +644,7 @@ class WindowsManifest(ViewerManifest):
                 "%%SOURCE%%":self.get_src_prefix(),
                 "%%INST_VARS%%":inst_vars_template % substitution_strings,
                 "%%INSTALL_FILES%%":self.nsi_file_commands(True),
+                "%%$PROGRAMFILES%%":program_files,
                 "%%DELETE_FILES%%":self.nsi_file_commands(False)})
 
         # We use the Unicode version of NSIS, available from
-- 
cgit v1.2.3