Why you might ask? A perfectly valid and sane question, let me explain. Right now I’m setting up continuous integration for both an Azure project and an Android project. I’ve covered my struggle with the Azure project in an earlier post. But now it was time to get the Amazon EC2 Windows Server 2008 with TeamCity to build an Android project and publish the resulting apk file to a folder in sync with Dropbox. The problem is that Dropbox will only sync when started in an active desktop session, so if you log out from the server the syncing stops – this was a problem…
Why am I writing this?
As always when face with a very specific unusual problem – Internet is your friend. So I could just have left it there and allowed you to find the answer the same way I did. The thing is that the solution to my problem was a mashup of several standalone solutions presented on the web. So my idea is to summarize what I did hoping that it will help anyone facing the same problem.
What I did
So here are the steps that I took in order to get everything working. Quite a few steps but I wanted it detailed enough so that anyone could follow.
- Right click the Dropbox icon in your system tray and select Preferences
- Deselect Show desktop notifications
- Deselect Start Dropbox on system startup
- Download and install Windows Server 2003 Resource Kit Tools. It will warn you about incompatibility, but you can safely ignore this (or at least I did).
- Open the Command Console (Run –> cmd).
- Enter sc create DropboxService binPath= C:Program Files (x86)Windows Resource KitsToolssrvany.exe DisplayName= "Dropbox Service"
- Open RegEdit and navigate to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesDropboxService
- Create a new key named Parameters
- Create a string value called Application and enter the full path to your Dropbox executable. Typically C:Users****AppDataRoamingDropboxbinDropbox.exe
- Open Services (Start Menu –> Administrative Tools –> Services)
- Locate your Dropbox Service, right click and select properties.
- Set the service to Autostart
- Under the Log on tab, check Allow service to interact with desktop.
- Press Apply
- Start the service
- You will get a popup asking for permissions to display the Dropbox configuration – Accept.
- Add your user info
Well yes, I realize that this is not how Dropbox was intended to be used. But it surprised me that the only way, at least that I could find, was to hack away with toolkits, console applications and the registry. I’m not really counting on that there will be an easier way in the future. So this post is as much for me to remember how I did it, so that I won’t have to figure it out again, as for helping anyone else in a similar situation.