Jump to content

PIM/MS Windows: Difference between revisions

From KDE Community Wiki
< PIM
Jstaniek (talk | contribs)
Aheinecke (talk | contribs)
Take over this outdated page and rewrite it for the current status
Line 1: Line 1:
This page covers topics related to the MS Windows port of the KDE PIM suite.
This page covers topics related to the KDE PIM Suite on MS Windows NT.


{{Note|This page is work in progress started by [[User:Jstaniek|jstaniek]].}}
==Building==


==Building==
To build KDE PIM for Windows use [Getting_Started/Build/KDE4/Windows/emerge emerge]]
Build base KDE libraries for Windows with required dependencies, preferable using ''emerge'' tool (because it tracks dependencies for you):
#install ''emerge'' and its dependencies as described [[Getting_Started/Build/KDE4/Windows/emerge|here]]
#either [[#Build_SASL_by_hand|build SASL by hand]] or [[#Download_SASL_for_mingw_and_msvc|download precompiled version for mingw and msvc]], and install it (if you skip this step you will not have SSL/TLS support in your apps)
#unpack gpgme-1.1.4-3-lib.zip and gpgme-1.1.4-3-bin.zip from http://www.winkde.org/pub/kde/ports/win32/repository/win32libs/ to your KDEDIR
#from the cmd.exe command line, enter <pre>emerge kdepimlibs</pre> - that will  also build ''qt'', ''kdesupport'' (part of it), ''soprano'', ''strigi'', ''kdelibs'', ''kdebase''
#enter <pre>emerge libassuan</pre> - this is an optional dependency of ''kdepim''
#finally, enter <pre>emerge kdepim</pre>


Notes:
You should be able to get executables just by calling emerge kdepim.
*Temporary fix for [http://bugs.kde.org/show_bug.cgi?id=160881 Bug 160881: PGP encryption of mails results in empty MIME-part] in kdepim can be enabled if you add -DKLEO_SYNCHRONOUS_API_HOTFIX:BOOL=ON to your cmake call.


== Problem points ==
== Problem points ==
=== The Checklist ===
{| class="sortable" border="1" cellpadding="5" cellspacing="0" style="border: gray solid 1px; border-collapse: collapse; text-align: left; width: 100%;"
{| class="sortable" border="1" cellpadding="5" cellspacing="0" style="border: gray solid 1px; border-collapse: collapse; text-align: left; width: 100%;"
|- style="background: #ececec; white-space:nowrap;"
|- style="background: #ececec; white-space:nowrap;"
! Status !! Feature !! Description !! Contact
! Status !! Feature !! Description !! Contact
{{FeatureDone|[[#Maildir_implementation_in_KMail|Maildir implementation]]|make maildir standard work with Windows filesystems |jstaniek}}
 
{{FeatureDone|[[#Folder_Indices|Folder Indices]]|so called "mmap mode"|jstaniek}}
{{FeatureTodo | [[#Documentation_of_KDE|Documentation of KDE]] | Due to meinproc4 crashes documentation build is turned off from all kde projects. | }}
{{FeatureDone|[[#SASL support|SASL support]]|security|KDE PIM Team}}
 
{{FeatureInProgress|[[#Registry_settings_for_default_apps_and_services|Registry settings for default apps and services]]|Integration: Setting KMail as default e-mail client, KOrganizer as defaule windows calendaring app, etc. See [[#KDE-related_notes|the notes]].|jstaniek}}
{{FeatureTodo|[[#LDAP_Support|LDAP Support]]| Enabling KLdap |aheinecke@intevation.de| Andre Heinecke }}
{{FeatureDone|[[#Drag.26drop_support|Drag&Drop support]]|Integration: D&D files onto the message composer|jstaniek}}
 
{{FeatureInProgress|[[#Copy.26paste_support|Copy&Paste support]]|Integration|jstaniek}}
{{FeatureTodo|[[#Search|Search]]|Provide a search backend| }}
{{FeatureDone|[http://intevation.de/roundup/kolab/issue2646 Use the standard Windows filedialogs]|Integration|jstaniek}}
 
{{FeatureDone|[[#Crashes_in_KDED|Fixes for Start Menu entries]]|Integration: avoid crashes and conflicts of kwinstartmenu KDED plugin with Start Menu entries added by hand in 3rd-party installers|jstaniek}}
{{FeatureTodo|[[#Nepomuk|Nepomuk]]|Provide a working Nepomuk| }}
{{FeatureInProgress|[[#.22Locked.22_dbus-daemon|"Locked" dbus-daemon]]; see also [[#Alternative_solution|Alternative solution]]|Unique KDE applications lock DBUS daemon on crash|KDE PIM Team}}
 
{{FeatureDone|Usability: activate previous instances of unique apps|When another instance of unique appliaction is started, activate previous instance. This is what users expect.<br/>Moreover, if standalone application is running, e.g. KMail, and user clicked on "e-mail" component of Kontact, window of the standalone application is activated. ([http://websvn.kde.org/?view&#61;rev&revision&#61;827268 827268])|jstaniek}}
{{FeatureDone|Printing emails|Printing emails did not work ([https://www.intevation.de/roundup/kolab/issue2647 issue2647])|jstaniek}}
{{FeatureDone|Native "Open With" dialog on Windows|Native "Open With" dialog should be displayed on Windows by default. ([http://intevation.de/roundup/kolab/issue2766 issue2766])|jstaniek}}
{{FeatureDone|Windows mesage boxes take ages to come up|Some dialogs need a lot of time to pop up completly the first time. ([http://intevation.de/roundup/kolab/issue2708 issue2708], [http://intevation.de/roundup/kolab/issue2695 issue2695]); removed the delay by disabling KNotify use in message boxes (not very much used feature currently on Windows anyway).|jstaniek}}
|}
|}


=== Maildir implementation in KMail ===
===Documentation of KDE ===
The implementation based strictly on the original maildir specification in kmail does not work on Windows' file system, since it uses the ":" (forbidden on windows) character in file names. It also relies (as does maildir in general) on the atomicity of making a hardlink and then unlinking the original, to implement an atomic move. The implementation used by akonadi (kdepim/maildir) relies on QFile in that regard, but it's unclear if rename is atomic on all platforms.
Currently as of 22.2.2010 in all KDE builds for Windows Documentation build is turned off because of [https://bugs.kde.org/show_bug.cgi?id=263828 BUG263828] Meinproc4 crashes.
*[[User:Jstaniek|jstaniek]] 12:50, 7 January 2008 (CET): Hard/soft links could be handled on Windows by altering the source code so that the "link" file is a text file itself and contains the target path. If we need atomic renames, '''Windows apparently lacks them''', I have found a pre-Vista [http://blogs.msdn.com/adioltean/archive/2005/12/28/507866.aspx blog] which contains description on how to perform them in a messy but honest way (look at the very last "Write process (on Foo.txt)" version). There's also a way to recover from application/system crash during the pseudo-atomic operations (see the very last "Recovery from a crash during write" checklist).
*[[User:Jstaniek|jstaniek]] 12:42, 24 January 2008 (CET): We will most probably benefit from ''maildir'' suport on Windows as Thunderbird (ver. <3) apparently lacks support for this storage, despite [https://bugzilla.mozilla.org/show_bug.cgi?id=58308 many wishes] and [http://wiki.mozilla.org/Thunderbird/Feature_Brainstorming#Storage_folder plans].
*[[User:Jstaniek|jstaniek]] 12:42, 24 January 2008 (CET): regarding replacing ":" character on windows:
** We cannot use ":" in any way ([http://en.wikipedia.org/wiki/Maildir#Windows_software Wikipedia note]), so we have to rename it to something other:
*** The proposed replace character is "!". Not "-" (see [https://bugzilla.mozilla.org/show_bug.cgi?id=58308#c77 this] for explanation).
*** We may want to add support for user-defined character, to allow reuse maildirs of apps like mutt (which uses "-"), but it should be clearly noted in the handbook that the setting is only for integration with existing maildirs.
*** '''The rename makes the implementation incompatible''' with the [http://cr.yp.to/proto/maildir.html specification] (which is informal anyway and says nothing about the replacement character).
** '''The ability of sharing a single maildir''' structure on dual boot machines (e.g., using the [http://www.fs-driver.org/ IFS Ext2 driver] or [http://ext2fsd.sourceforge.net/projects/projects.htm#ext2fsd Ext2fsd: way less crashy than IFS Ext2 (no blue screen of the death) and actively maintained]) is affected by the problem with ":" character.
*** '''Windows FS layer''' apparently returns "file not found" error for files having the ":"  character on a linux filesystem. So if there is a need for storing the maildir at linux side, ":" should be renamed even if Linux itself does work with ":".
*** Conversely, '''if the maildir has to be stored at windows side''', ":" characters have to be renamed, do Linux build of KMail (and KDE-PIM in general) should support this rename too in order to access the storage.


===Folder Indices===
The current suspicion is that this is due to errors in Libxml2 or even Iconv since meinproc is just an XSLT parser for KDE. So this might hit KDEPIM also on a runtime level.
There are issues with locking index files for KMail folders and mmap()/munmap() operations on Windows. Therefore, SQLite-based indices are in development. [[PIM/MS Windows/SQLite Folder Indices|More info...]]
For more on this issue see the mailing list:
http://mail.kde.org/pipermail/kde-windows/2011-February/005690.html
 
===LDAP Support===
OpenLDAP does not build well for Windows on Windows, for this reason there is no working OpenLDAP-src target in emerge, if you want LDAP Support you have to manually install OpenLDAP into your KDE Enviornment before building kdepimlibs.
 
Since Windows has native LDAP support with winldap it is easily possible to use that, an Obstacle for this is that also kdepimlibs is built with -DUNICODE it expects all system LDAP calls to return ASCII so you would have to do some conversions mappings there. A bit code for that is already in kdepimlibs/kldap/w32ldaphelp.h but it is only finished for WinCE not for WinNT.
 
===Search===
Strigideamon does not compile for Windows NT at the moment, so apart from Virtuoso/Nepomuk there is no Search for KDE PIM Software available.
 
===Nepomuk===
Nepomuk only supports Virtuoso as Database backend. Virtuoso can not be installed through the KDE-Windows installer, so Nepomuk is currently not availabe for Windows with a working backend.
 
 
==Some notes from the original porting project==


===Integration into the Windows Explorer & Desktop===
===Integration into the Windows Explorer & Desktop===
Line 84: Line 76:
*A general rule of KDE/win: not to duplicate registry settings in any rc file and use default applications if possible, to avoid changing behaviour expected by users.
*A general rule of KDE/win: not to duplicate registry settings in any rc file and use default applications if possible, to avoid changing behaviour expected by users.
*[[User:Jstaniek|jstaniek]] 12:06, 18 June 2008 (CEST): Before LinuxTag I've performed some tests of setting default clients, and looks like it's is not possible to set onlt writing registry entries. Some API calls may be needed, especially because locked at least one registry key is locked for writing during the session.
*[[User:Jstaniek|jstaniek]] 12:06, 18 June 2008 (CEST): Before LinuxTag I've performed some tests of setting default clients, and looks like it's is not possible to set onlt writing registry entries. Some API calls may be needed, especially because locked at least one registry key is locked for writing during the session.
====Drag&drop support====
Support drag&drop from/to composer and from received mails into the file system (Windows Explorer and the Desktop)
====Copy&paste support====
Support pasting files copied (in Windows Explorer or the Desktop) as attachments.
===Profile migration===
*[http://kb.mozillazine.org/Profile_folder Mozilla profile directories]
===SASL support===
{{Note|SASL should be available '''before''' building kdepimlibs. When you build kdepimlibs, it should display message like "SASL Found" during configure stage.}}
====Build SASL by hand====
[http://asg.web.cmu.edu/sasl/ Cyrus SASL] is used on Windows for SSL/TLS, so we use the same source code plus wrapper functions that are a part of the Cyrus distribution (the result is a native Windows library, do not confuse with Cygwin!).
Two Mozilla's [http://wiki.mozilla.org/LDAP_C_SDK_SASL_Windows patches] have to be applied for msvc.
Cyrus SASL functionality is based on plugins. For KDEpimlibs we have set the paths for plugins and configuration to KDEROOT/lib/sasl2/ and KDEROOT/share/config/sasl2/, respectively. The configuration capatibilities are apparently not used for now. ([[User:Jstaniek|jstaniek]] February 3 2008)
The following parts of KDEpimlibs depend on sasl2: kldap, kioslave/{sieve|imap4|smtp|pop3}.
'''Limitations:''' Currently all plugins but KerberosV4 (kerberos4.c) and PASSDSS (passdss.c) can be built on Windows. ([http://www.sendmail.org/~ca/email/cyrus2/windows.html more info])
'''See also:'''
*[http://negotiateauth.mozdev.org/ Negotiateauth] Mozilla plugin and [http://sourceforge.net/projects/modauthkerb/ Mod_auth_kerb] Apache module for Kerberos support.
*[http://mailman.mit.edu/pipermail/kerberos/2004-April/005152.html this] [http://mailman.mit.edu/pipermail/kerberos/2004-April/005155.html thread]
<nowiki>Insert non-formatted text here</nowiki>
====Download SASL for mingw and msvc====
Download SASL library and plugins for mingw and msvc. Here's link, this time uploaded to the wiki (TODO move it to the kde windows server): http://kexi-project.org/download/cyrus-sasl2-2008-04.zip. The archive provides directory structure, so you'll know where to unpack these files.
===Hot fixes to apply===
Please apply these fixes in order to avoid crashes in related KDE componenets.
====Crashes in korgac====
Update: this step is not needed since r806657.
<strike>KOrganizer's reminder daemon (korgac) crashes on Windows because of recent commit. A quick fix is to go to kdelibs/ source directory and type:
<tt>svn up -r 795533 kdeui/util/ksystemtrayicon.cpp</tt>
Then compile and install the kdelibs.</strike>
====Crashes in KDED====
We sometimes need to disable creation and automatic maintenance of the KDE menu entry in the Start Menu. To do this, we can add these lines to the $KDEROOT/share/config/kwinstartmenurc file on deployment:
<code>
[General]
Enabled=false
</code>
Tip: just download the file: [https://www.intevation.de/roundup/kolab/file799/kwinstartmenurc kwinstartmenurc] and save it to the $KDEROOT/share/config/ directory.
===="Locked" dbus-daemon====
History:
*[[User:Jstaniek|jstaniek]] 18:12, 27 May 2008 (CEST): initial version for enterprise4 branch; emerge package: kdepim-branch
*[[User:Jstaniek|jstaniek]] 19:03, 28 May 2008 (CEST): update for David's commit r813498 "Ported Kontact::UniqueAppHandler to DBUS"
Introduction: upon application crash (for whatever reason), dbus-daemon (happens on Windows only) does not unregister unused service(s). Subsequent execution of the same application causes ''KUniqueApplication: Can't setup D-Bus service. Probably already running'' error and immediate exit with no visible feedback.
Reported as http://intevation.de/roundup/kolab/issue2639
Past workaround: manual killing dbus-daemon.
Rationale for the new workaround: make KDEPIM more suitable for demonstrating, without executing cryptic commands.
Workaround: If registering dbus service for KUniqueApplication (e.g. "org.kde.kmail") failed, do not exit immediately but instead:
# look if there's a process with the same name (e.g. kmail) running, if so exit with no action
# if there's no process with the same name, kill dbus-daemon (first, using SIGTERM, then SIGKILL), then restart the application with exactly the same arguments and the same current working directory.
Recipe: apply [http://www.intevation.de/roundup/kolab/file806/kuniqueapplication.patch kuniqueapplication.patch] in kdelibs and rebuild and install kdeui; this will make KUniqueApplication::start() return with false value instead of exiting().
=====Alternative solution=====
*[[User:Jstaniek|jstaniek]] 19:45, 24 June 2008 (CEST) '''patched windbus allowing to release unused service resources after client's crash''':
**in progress, testing
**changes commited to kdelibs-branch and kdepim-branch (reverts the ''"Locked" dbus-daemon'' workaround)
**windbus patch: to be published
===Other TODOs===
*KMFolderTree::cleanupConfigFile() removes kmailrc sections for nonexisting folders but the changes are not writen back ([[User:Jstaniek|jstaniek]] 11:07, 14 May 2008 (CEST))
== Notes ==
* '''The branches/work/kdab-post-4.0 branch''' ([http://websvn.kde.org/branches/work/kdab-post-4.0/kdepim/ kdepimlibs], [http://websvn.kde.org/branches/work/kdab-post-4.0/kdepim/ kdepim] modules) '''have been closed and merged into [http://websvn.kde.org/trunk/KDE/ trunk]'''. <strike>KDE PIM for Windows development happens in trunk again now.</strike>
* KDE PIM for Windows development happens in branches/kdepim/enterprise4 now.


== Links ==
== Links ==
* [[Projects/KDE_on_Windows|The KDE on Windows]] Project
* [[Projects/KDE_on_Windows|The KDE on Windows]] Project
* [[Projects/KDE on Windows/Missing features of kdelibs|Missing features of kdelibs on Windows]] - KDE PIM may depend on them
* [[Projects/KDE on Windows/Missing features of kdelibs|Missing features of kdelibs on Windows]] - KDE PIM may depend on them
== External Links ==
*Find out how others have managed to port their software to Windows:
**[http://cs.senecac.on.ca/~david.humphrey/writing/firefox-win32-build.html Building Firefox on Windows using msvc]
**[http://wiki.mozilla.org/LDAP_C_SDK_SASL_Windows Building Cyrus SASL on Windows]


[[Category:PIM]]
[[Category:PIM]]
[[Category:MS Windows]]
[[Category:MS Windows]]

Revision as of 14:54, 22 February 2011

This page covers topics related to the KDE PIM Suite on MS Windows NT.

Building

To build KDE PIM for Windows use [Getting_Started/Build/KDE4/Windows/emerge emerge]]

You should be able to get executables just by calling emerge kdepim.

Problem points

Status Feature Description Contact
TO DO Documentation of KDE Due to meinproc4 crashes documentation build is turned off from all kde projects.


TO DO LDAP Support Enabling KLdap Andre Heinecke <[email protected]>


TO DO Search Provide a search backend


TO DO Nepomuk Provide a working Nepomuk


Documentation of KDE

Currently as of 22.2.2010 in all KDE builds for Windows Documentation build is turned off because of BUG263828 Meinproc4 crashes.

The current suspicion is that this is due to errors in Libxml2 or even Iconv since meinproc is just an XSLT parser for KDE. So this might hit KDEPIM also on a runtime level. For more on this issue see the mailing list: http://mail.kde.org/pipermail/kde-windows/2011-February/005690.html

LDAP Support

OpenLDAP does not build well for Windows on Windows, for this reason there is no working OpenLDAP-src target in emerge, if you want LDAP Support you have to manually install OpenLDAP into your KDE Enviornment before building kdepimlibs.

Since Windows has native LDAP support with winldap it is easily possible to use that, an Obstacle for this is that also kdepimlibs is built with -DUNICODE it expects all system LDAP calls to return ASCII so you would have to do some conversions mappings there. A bit code for that is already in kdepimlibs/kldap/w32ldaphelp.h but it is only finished for WinCE not for WinNT.

Search

Strigideamon does not compile for Windows NT at the moment, so apart from Virtuoso/Nepomuk there is no Search for KDE PIM Software available.

Nepomuk

Nepomuk only supports Virtuoso as Database backend. Virtuoso can not be installed through the KDE-Windows installer, so Nepomuk is currently not availabe for Windows with a working backend.


Some notes from the original porting project

Integration into the Windows Explorer & Desktop

Note

jstaniek 22:01, 14 January 2008 (CET): TortoiseSVN is GPLed SVN client which is nicely integrated with Windows Explorer. Perhaps we can use its source code as a reference...


Registry settings for default apps and services

Introduction: We can detect whether KMail is the default e-mail client. If set as default, KMail should act as a default mailer, and thus be invoked automatically for actions like RMB "Send To -> E-mail Recipient". This shall be also reused by others for KOrganizer and Konqueror. The solution is relatively simple modifications to the Windows Registry. See Mozilla's solution.

First, we can use HKLM node for system-global settings or HKCU node for current-user-only settings. If the attempt to set the value in HKLM fails, usually because of unsufficient permissions, HKCU should be used. As expected, HKCU overrides HKLM settings. See KB297878. Below we'll use HKCU.

  • HKCU\Software\Clients\StartMenuInternet key is used to specify default web browser; could be set to Konqueror
  • HKCU\Software\Clients\StartMenuInternet\app.exe\shell\open\command key is used for "Internet" start menu shortcut, can be set to Konqueror. Note from the KB - "The command might open the browser on the users home page, for example. However, it might launch some other introductory user interface that the ISV feels is appropriate." So this is not the same as 'default browser' setting.
  • HKCU\Software\Clients\Mail\Appname - registered email client, there can be more entries within the 'Mail' node. Adding KMail here makes it available for users to select as a default browser using 'Set Default Programs' system window.
  • HKCU\Software\Clients\Mail - default email client, 'Windows Mail' by default; could be set to KMail.
  • HKCU\Software\Clients\Calendar\Appname - registered calendar application, there can be more entries within the 'Calendar' node. See the note for HKCU\Software\Clients\Mail\Appname.
  • HKCU\Software\Clients\Calendar - default calendar application, 'Windows Calendar' on Vista; could be set to KOrganizer.
  • HKCU\Software\Clients\Contacts\Appname - registered contacts client, there can be more entries within the 'Contacts' node. See the note for HKCU\Software\Clients\Mail\Appname.
  • HKCU\Software\Clients\Contacts - default contacts application, 'Address Book' by default; could be set to KAddressBook.
  • HKCU\Software\Clients\News\Appname - registered newsgroup client, there can be more entries within the 'News' node. See the note for HKCU\Software\Clients\Mail\Appname.
  • HKCU\Software\Clients\News - default newsgroup application, 'Windows Mail' by default; could be set to KNode.

From the KB: After updating the registry keys, the application broadcasts the WM_SETTINGCHANGE message with wParam = 0 and lParam pointing to the null-terminated string "Software\Clients\StartMenuInternet" to notify the operating system that the default client has changed.

Using MAPI

HKLM\Software\Clients\AppName\DllPath points to a dll implementing MAPI interface. Internet Explorer uses Windows Messaging by default to invoke a mailer on a mailto: link. Only if the MAPI install is misconfigured will it resort to directly accessing the mailto association key.[1] Example implementation of MAPI services is Thundebird's mozMapi32.dll (the key is usualle equal to C:\Program Files\Mozilla Thunderbird\mozMapi32.dll).

KDE-related notes
  • KDElibs execute default web browser or email client for protocols like http(s): and mailto: via QDesktopServices::openUrl(), which in turn uses ShellExecute(). openUrl() is widely used in Qt e.g. for hyperlinks in text boxes and label widgets.
  • A general rule of KDE/win: not to duplicate registry settings in any rc file and use default applications if possible, to avoid changing behaviour expected by users.
  • jstaniek 12:06, 18 June 2008 (CEST): Before LinuxTag I've performed some tests of setting default clients, and looks like it's is not possible to set onlt writing registry entries. Some API calls may be needed, especially because locked at least one registry key is locked for writing during the session.

Links