Saturday, July 28, 2007

Making Open Contacts portable

It is easy to make Open Contacts be accessible through PortableApps Start Menu by copying program files and data files under [PortableAppsRoot]\PortableApps\OpenContacts. Open Contacts by default will use the program (target) directory as working directory if working directory is not specified. However, PortableApps somehow would list fbclient.dll in the start menu. As this visual effect is obviously undesirable, we had made a distribution package optimized for PortableApps.

When being launched from a portable device, the INI file has better to have setting "DisableCOM=1", then Open Contacts will not respond to COM client call, as in general practices, a portable program has better not to be a COM server. And actually the memory footprint is around 250KB less with this condition.

The proxy program "Open Contacts.exe" basically have only one statement:

ShellExecute(0, PChar('open'), PChar( ExePath+'app\program\OpenContacts.exe'), '', PChar(ExePath+'data'), 1);