From 23a8e9fded0e9b9acdcb427384d38b0bbff9a78e Mon Sep 17 00:00:00 2001 From: "kairo%kairo.at" Date: Tue, 10 Jan 2006 19:14:16 +0000 Subject: [PATCH] For finding the user profile, try %APPDATA% first, use %USERPROFILE% only as fallback, as that approach also works on localized Windows versions, r=Chase --- tools/tinderbox/build-seamonkey-util.pl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/tinderbox/build-seamonkey-util.pl b/tools/tinderbox/build-seamonkey-util.pl index 1e96ce7f3767..a0981fa09406 100644 --- a/tools/tinderbox/build-seamonkey-util.pl +++ b/tools/tinderbox/build-seamonkey-util.pl @@ -24,7 +24,7 @@ use Config; # for $Config{sig_name} and $Config{sig_num} use File::Find (); use File::Copy; -$::UtilsVersion = '$Revision: 1.305 $ '; +$::UtilsVersion = '$Revision: 1.306 $ '; package TinderUtils; @@ -1119,12 +1119,16 @@ sub get_profile_dir { if ($Settings::OS =~ /^WIN9/) { # 98 [but what does uname say on Me?] $profile_dir = $ENV{winbootdir} || $ENV{windir} || "C:\\WINDOWS"; $profile_dir .= "\\Application Data"; - } elsif ($Settings::OS =~ /^WINNT/) { # NT 4, 2K, XP(?) - # afaict, %USERPROFILE% should always be there, NT 4.0 and up - if ($ENV{USERPROFILE}) { + } elsif ($Settings::OS =~ /^WINNT/) { # NT 4, 2K, XP + # try %APPDATA% first as it works even on localized OS versions + if ($ENV{APPDATA}) { + $profile_dir = $ENV{APPDATA}; + } + elsif ($ENV{USERPROFILE}) { + # afaict, %USERPROFILE% should always be there, NT 4.0 and up $profile_dir = $ENV{USERPROFILE} . "\\Application Data"; - } else { # use %APPDATA% as a fallback (or prepare to fail) - $profile_dir = $ENV{APPDATA} || "C:\\_UNKNOWN_"; + } else { # prepare to fail + $profile_dir = "C:\\_UNKNOWN_"; } } if ($Settings::VendorName) {