Commits

Anonymous committed bf79cd2

INTEGRATION: CWS kendy21 (1.6.10); FILE MERGED
2008/09/01 12:39:02 kendy 1.6.10.2: #i93332#
Make oowintool recognize MSVC 2008 Express.
2008/09/01 12:38:27 kendy 1.6.10.1: #i93332#
Support for MSVC 2005 (not Express).

Comments (0)

Files changed (1)

config_office/oowintool

 
 sub print_psdk_home()
 {
-    my $value;
+    my ($value, $key);
     $value = reg_get_value ('HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v6.1/InstallationFolder');
     if (!defined $value)
     {
-		$value = reg_get_value ('HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/Directories/Install Dir');
-		if (!defined $value)
-		{
-			$key = reg_find_key ('HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install Dir');
-			$value = reg_get_value ($key);
-		}
+        $value = reg_get_value ('HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/CurrentInstallFolder');
 	}
+    if (!defined $value)
+    {
+	    $value = reg_get_value ('HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/Directories/Install Dir');
+	}
+    if (!defined $value)
+    {
+	    $key = reg_find_key ('HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install Dir');
+	    $value = reg_get_value ($key);
+	}
+    if (!defined $value)
+    {
+        my $dir = cygpath (find_msvc()->{'product_dir'}, 'w', $output_format);
+		$value = `/bin/find "$dir" -iname platformsdk | head -n 1`;
+    }
+
     defined $value || die "psdk not found";
 
     print cygpath ($value, 'w', $output_format);
     'dll_path' => '../SDK/v2.0/Bin',
     'dll_suffix' => '80'
 );
+my %msvs_2005 = (
+    'ver' => '8.0',
+    'key' => 'Microsoft/VisualStudio/8.0/Setup/VS/ProductDir',
+    'instmsi_path' => 'SDK/v2.0/BootStrapper/Packages/InstMSI',
+    'dll_path' => 'Visual Studio .NET Professional 2005 - English',
+    'dll_suffix' => '80'
+);
+my %msvc_2005 = (
+    'ver' => '8.0',
+    'key' => 'Microsoft/VisualStudio/8.0/Setup/VC/ProductDir',
+    'instmsi_path' => '../SDK/v2.0/BootStrapper/Packages/InstMSI',
+    'dll_path' => '../SDK/v2.0/Bin',
+    'dll_suffix' => '80'
+);
 my %msvs_2008 = (
     'ver' => '9.0',
     'key' => 'Microsoft/VisualStudio/9.0/Setup/VS/ProductDir',
     'dll_path' => 'redist/x86/Microsoft.VC90.CRT',
     'dll_suffix' => '90'
 );
+my %msvs_express_2008 = (
+    'ver' => '9.0',
+    'key' => 'Microsoft/VCExpress/9.0/Setup/VS/ProductDir',
+    'instmsi_path' => '?',
+    'dll_path' => 'VC/redist/x86/Microsoft.VC90.CRT',
+    'dll_suffix' => '90'
+);
+my %msvc_express_2008 = (
+    'ver' => '9.0',
+    'key' => 'Microsoft/VCExpress/9.0/Setup/VC/ProductDir',
+    'instmsi_path' => '?',
+    'dll_path' => 'redist/x86/Microsoft.VC90.CRT',
+    'dll_suffix' => '90'
+);
 
 sub find_msvs()
 {
-    my @ms_versions = ( \%msvs_2008, \%msvs_express_2005, \%msvs_net_2003_ea, \%msvs_net_2003 );
+    my @ms_versions = ( \%msvs_2008, \%msvs_express_2008, \%msvs_2005, \%msvs_express_2005, \%msvs_net_2003_ea, \%msvs_net_2003 );
 
     for $ver (@ms_versions)
     {
 
 sub find_msvc()
 {
-    my @ms_versions = ( \%msvc_2008, \%msvc_express_2005, \%msvc_net_2003 );
+    my @ms_versions = ( \%msvc_2008, \%msvc_express_2008, \%msvc_2005, \%msvc_express_2005, \%msvc_net_2003 );
 
     for $ver (@ms_versions)
     {
 
 sub print_csc_compiler_dir()
 {
-    my $dir = reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/InstallRoot");
-    $dir .= "v2.0.50727"; # lame, but...
-    print cygpath ($dir, 'w', $output_format);
+    my $dir = cygpath (reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/InstallRoot"), 'w', $output_format);
+    my $csc_exe = `/bin/find "$dir" -iname csc.exe | grep "v2\." | head -n 1`;
+    print `dirname $csc_exe`;
 }
 
 sub print_dotnetsdk_dir()
 {
-    my $dir = reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/sdkInstallRootv2.0");
+    my $dir = 
+          reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/sdkInstallRootv1.1") ||
+          reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/sdkInstallRootv2.0");
     print cygpath ($dir, 'w', $output_format);
 }
 
 {
     my $dir =
 	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.5/JavaHome") ||
-	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.4/JavaHome");
+	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.4/JavaHome") ||
+	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.3/JavaHome");
     print cygpath($dir, 'w', $output_format); 
 }