Corrected the removing of address maps. Fixed the list headers and footers where

it was not handling 32bit/64bit correctly.
This commit is contained in:
peter 2012-05-02 14:55:05 +10:00
parent ce6ac03441
commit c66050c25f

View file

@ -341,7 +341,7 @@ Public Class MailEnable
Dim map As New WebsitePanel.Providers.Mail.MailEnableAddressMap Dim map As New WebsitePanel.Providers.Mail.MailEnableAddressMap
ResetAddressMap(map) ResetAddressMap(map)
map.Account = domainName map.Account = domainName
map.RemoveAddressMap() map.RemoveAddressMap(True)
'delete all the blacklists 'delete all the blacklists
Dim blacklist As New WebsitePanel.Providers.Mail.MailEnableDomainBlacklist Dim blacklist As New WebsitePanel.Providers.Mail.MailEnableDomainBlacklist
@ -541,7 +541,7 @@ Public Class MailEnable
ResetAddressMap(map) ResetAddressMap(map)
map.Account = domainName map.Account = domainName
map.SourceAddress = "[SMTP:*@" + aliasName + "]" map.SourceAddress = "[SMTP:*@" + aliasName + "]"
map.RemoveAddressMap() map.RemoveAddressMap(True)
'delete all the blacklists 'delete all the blacklists
Dim blacklist As New WebsitePanel.Providers.Mail.MailEnableDomainBlacklist Dim blacklist As New WebsitePanel.Providers.Mail.MailEnableDomainBlacklist
@ -1930,19 +1930,23 @@ Public Class MailEnable
End Function End Function
Private Function GetAnnotationPath(ByVal postOfficeName As String) As String Private Function GetAnnotationPath(ByVal postOfficeName As String) As String
'the annotation paths are in the configuration directory
Dim programPath As String = "" Dim programPath As String = ""
Dim key32bit As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Mail Enable\Mail Enable") Dim key As RegistryKey
If (key32bit Is Nothing) Then
Dim key64bit As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Wow6432Node\Mail Enable\Mail Enable") If IntPtr.Size > 4 Then
If (key64bit Is Nothing) Then key = Registry.LocalMachine.OpenSubKey("SOFTWARE\Wow6432Node\Mail Enable\Mail Enable")
Else
key = Registry.LocalMachine.OpenSubKey("SOFTWARE\Mail Enable\Mail Enable")
End If
If (key Is Nothing) Then
Return String.Empty Return String.Empty
Else Else
programPath = CStr(key64bit.GetValue("Data Directory")) programPath = CStr(key.GetValue("Configuration Directory"))
Return Path.Combine(programPath, String.Format("Config\Postoffices\{0}\ANNOTATIONS", postOfficeName)) Return Path.Combine(programPath, String.Format("Postoffices\{0}\ANNOTATIONS", postOfficeName))
End If
Else
programPath = CStr(key32bit.GetValue("Data Directory"))
Return Path.Combine(programPath, String.Format("Config\Postoffices\{0}\ANNOTATIONS", postOfficeName))
End If End If
End Function End Function
@ -1964,16 +1968,18 @@ Public Class MailEnable
Private Function GetLoggingPath() As String Private Function GetLoggingPath() As String
Dim programPath As String = "" Dim programPath As String = ""
Dim key32bit As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Mail Enable\Mail Enable") Dim key As RegistryKey
If (key32bit Is Nothing) Then
Dim key64bit As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Wow6432Node\Mail Enable\Mail Enable") If IntPtr.Size > 4 Then
If (key64bit Is Nothing) Then key = Registry.LocalMachine.OpenSubKey("SOFTWARE\Wow6432Node\Mail Enable\Mail Enable")
Else
key = Registry.LocalMachine.OpenSubKey("SOFTWARE\Mail Enable\Mail Enable")
End If
If (key Is Nothing) Then
Return String.Empty Return String.Empty
Else Else
Return CStr(key64bit.GetValue("W3C Logging Directory")) Return CStr(key.GetValue("W3C Logging Directory"))
End If
Else
Return CStr(key32bit.GetValue("W3C Logging Directory"))
End If End If
End Function End Function