summaryrefslogtreecommitdiff
path: root/indra/mac_updater/mac_updater.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2010-11-04 18:09:35 -0700
committerMerov Linden <merov@lindenlab.com>2010-11-04 18:09:35 -0700
commitba3307b8d0f2ceb40454174a6593f3f98ce98b65 (patch)
tree7c016ab72795543361d206de5344b34a6a823fdf /indra/mac_updater/mac_updater.cpp
parentdac53830f1a67c8657ced9c39eccedbadf149bd9 (diff)
parent40979589afc5c91cab977307a1e400315b1c8a8f (diff)
merge with STORM-105
Diffstat (limited to 'indra/mac_updater/mac_updater.cpp')
-rw-r--r--indra/mac_updater/mac_updater.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/mac_updater/mac_updater.cpp b/indra/mac_updater/mac_updater.cpp
index e4d100d1ec..23980ffac2 100644
--- a/indra/mac_updater/mac_updater.cpp
+++ b/indra/mac_updater/mac_updater.cpp
@@ -61,6 +61,7 @@ Boolean gCancelled = false;
const char *gUpdateURL;
const char *gProductName;
+const char *gBundleID;
void *updatethreadproc(void*);
@@ -329,6 +330,10 @@ int parse_args(int argc, char **argv)
{
gProductName = argv[j];
}
+ else if ((!strcmp(argv[j], "-bundleid")) && (++j < argc))
+ {
+ gBundleID = argv[j];
+ }
}
return 0;
@@ -355,6 +360,7 @@ int main(int argc, char **argv)
//
gUpdateURL = NULL;
gProductName = NULL;
+ gBundleID = NULL;
parse_args(argc, argv);
if (!gUpdateURL)
{
@@ -372,6 +378,14 @@ int main(int argc, char **argv)
{
gProductName = "Second Life";
}
+ if (gBundleID)
+ {
+ llinfos << "Bundle ID is: " << gBundleID << llendl;
+ }
+ else
+ {
+ gBundleID = "com.secondlife.indra.viewer";
+ }
}
llinfos << "Starting " << gProductName << " Updater" << llendl;
@@ -592,7 +606,8 @@ static bool isFSRefViewerBundle(FSRef *targetRef)
CFURLRef targetURL = NULL;
CFBundleRef targetBundle = NULL;
CFStringRef targetBundleID = NULL;
-
+ CFStringRef sourceBundleID = NULL;
+
targetURL = CFURLCreateFromFSRef(NULL, targetRef);
if(targetURL == NULL)
@@ -619,7 +634,8 @@ static bool isFSRefViewerBundle(FSRef *targetRef)
}
else
{
- if(CFStringCompare(targetBundleID, CFSTR("com.secondlife.indra.viewer"), 0) == kCFCompareEqualTo)
+ sourceBundleID = CFStringCreateWithCString(NULL, gBundleID, kCFStringEncodingUTF8);
+ if(CFStringCompare(sourceBundleID, targetBundleID, 0) == kCFCompareEqualTo)
{
// This is the bundle we're looking for.
result = true;