Debugging Overlay Icons
How it works
The installer will install a COM component that holds an Explorer plugin (
ShellExtensionHandler) to display overlay icons. Once installed, it will listen on a named pipe. Once a client connects, it will inquire about the state of the icon.
I don't see icons. What do I do?
- Check if you didn't unselect the overlay icons during installation
- Check if the ownCloud Desktop Client is running and is properly set up
- Try to restart explorer.
- Download ShExtView and check for entries such as
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers. It should contain entries starting in
OCOKSharedall with spaces in front).
- Check for keys
If 5. and 6. do not exist, start an elevated
cmd.exe (right click, "Run as Administrator"). and type
regsvr32 "C:\Program Files (x86)\ownCloud\shellext_x64\OCOverlays.dll" (on 64 bit Windows) or
regsvr32 "C:\Program Files (x86)\ownCloud\shellext\OCOverlays_x86.dll"'(on 32 bit Windows).
If you have several software products installed which use overlay icons, you might be running into the issue that Windows is using only the first 15, here is a description how to change the order and fix this: https://www.garethjmsaunders.co.uk/2015/03/22/managing-overlay-icons-for-dropbox-and-tortoisesvn-and-tortoisegit/ (Feedback welcome!)
Mac OS X (>=10.10 FinderSync version)
- Open shell_integration/MacOSX/OwnCloud.xcworkspace
- Make sure that the FinderSyncExt scheme is selected at the top (SyncStateFinder is for the <10.10 extension)
- Press play in XCode and select Finder as the app to run
- Make sure that your client is running
The default XCode build settings are to be used with a development ownCloud client
The OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX User-Defined build setting of the FinderSyncExt target should match the one set for the client through cmake. By default both are empty, allowing you to load the extension without a Deverloper ID certificate. This however means that you can't mix the official build's client and extension binaries. You have to build both yourself and if you changed it in cmake, you need to change it manually in XCode as the normal build process passes this information through xcodebuild.
If you sometimes don't see overlay icons when running the XCode project
Pressing the play button involves registering the built plugin and telling Finder to load it. This however doesn't always work well after running a few times in a row. In case of issue you can try:
- Option-Right-Click on Finder and select
Relaunchbefore pressing play usually helps
- Make sure that your extension is listed and enabled in the Preferences / Extensions pane.
pluginkitcommand line can be used to force the registration of the extension if you built it outside of XCode. XCode should however already take care of that step. The extension will run in a
ownCloud Extensionssecondary process, so killing that process can also help if killing Finder wasn't enough.
- Use a different "app to run" than Finder (for example TextEdit) and test that the icons work properly through the application's Open dialog. This allows you to restart the application each time at least.
- Watch the Console for any error if it still doesn't work. The main break issue when dealing with codesigning is usually the NSConnection::connectionWithRegisteredName call, so put some debug output or a breakpoint in the failure case if you need to investigate further.
- On macOS Sierra activate private log to make sure you expose all
sudo log config --mode "private_data:on"
Enabling overlay icons day-to-day when developing the ownCloud client (no XCode)
You can't have both the production ownCloud running and a development version at the same time with their respective overlay icons because of the mismatching TEAM_IDENTIFIER and signature, the Finder plugin won't be allowed to connect by the sandbox. A way to have both working is to always develop using the testpilotcloud theme so that the installed FinderSync extension has a different bundle identifier.
- Configure your client with
make, the FinderSync plugin XCode project will be built with the rest
make installto make sure that the plug-in is copied in the client's .app bundle (pkd requires this, at least on 10.12). This is just required if you changed something in the plugin, a non-installed client can still be used with it.
pluginkit -a install/testpilotcloud.app/Contents/PlugIns/FinderSyncExt.appexto add the plugin to the database
- Make sure it is enabled in System Preferences / Extensions
Mac OS X (<10.10 SyncStateFinder version)
- Disable the FinderSync version in Preferences/Extensions
- Build ownCloud on the command line as usual and start the client
sudo cp -r <build_dir>/shell_integration/MacOSX/Release/SyncStateFinder.osax /Library/ScriptingAdditions/
- Relaunch Finder (
killall Finderon the command line, or Alt-RightClick on the Finder dock icon and select
- If on OS X >= 10.10, tell Finder to load the extension manually, since the client won't trigger this automatically:
If on OS X >= 10.11 you will need to disable the System Integrity Protection to be allowed to send script messages to Finder, or to attach a debugger to any built-in application (e.g. Finder or TextEdit)