A long time ago ( in internet years ) Digital Fusion published their method of using an installer to update FileMaker plugins. This was part of Craig Saunders presentation at the FileMaker Developer Conference 2010 in San Diego.

Although I’ve previously published methods for updating plugins via FileMaker Server, I’ve been meaning to look at the Digital Fusion method for a while, and build a sample file for doing this using our new free open source BaseElements plugin.

Well I finally had a concrete need for an plugin update mechanism in RefreshFM and because RefreshFM doesn’t work on the server, it needed to be all local. As well, with the distribution version of RefreshFM is going to be in use by users who may know nothing of plugins it needed to be as simple as possible. So the idea of using this installer method really appealed to me.

Tweaks

I made a couple of changes to the process that Craig and Stephen outlined in their sample files.

Firstly, on windows, I elected to use InnoSetup instead of Install Creator. InnoSetup is free and has all of the features I needed, and I was already familiar with using it on other projects. But in theory you could use any installer builder software.

Secondly, on the Mac, the DF guys are exporting an XML plist file to do version comparisons with. I considered this overkill for what I wanted, and I was happy with just using the ability to check this detail inside FileMaker and then installing as required. This gives you a little more flexibility with where you install and also made the actual options in the installer simpler.

And finally, I also wanted the ability to re-open the database that you’d started with. I was sure from the demo or what I’d seen before that this was included with the demo materials, but I couldn’t find it and the online demo files didn’t show this ( or at least as far as I could see ). So I added some code to the post install scripts to open the RefreshFM file after the install is complete. It is mentioned in their slideshow from the DevCons session as an option for windows, so I assume they’ve at least considered it on the mac too.

Demo Files

The attached demo files contain a working copy of everything I’ve included in RefreshFM. There is the main PluginUpdates.fp7 file which contains a copy of the installers as well as the code to export and open them.

The .pmdoc file is the PackageMaker file. You need to download Apple’s Developer tools to get access to this. XCode is available on the App Store, and is also available for people who have developer accounts with Apple.

The .iss file is the installer setup file on Windows, you need a copy of InnoSetup to open this, but it’s free software.

Mac Installer Bug

There is a bug with the installer on the mac, where the settings I’ve used default to the User’s Library folder. So when the installer comes up, there is only one choice ( Install for current user ) which appears to be selected ( it’s got a blue highlight ) but the continue button is greyed out. You need to click on the “Install for current user” option to make it active ( which doesn’t change the highlight ), and then the continue button becomes active and everything works.

I’ve left this as is in my sample files, so the issue is still present. The DF guys have got a workaround in their version of the installer, where they install to the temp folder, but into a link that points to the actual user’s folder. So the installer doesn’t present the dodgy dialog. However, that option requires Administrator privileges, which not all users will have.

I’m not sure that either solution is perfect, and I’ve spent a lot of time fiddling with settings or options in the installer to try to alleviate the issue, to no avail. If you have a perfect solution, I’d love to hear about it.

Caveats

And what solution wouldn’t exist without caveats : Currently there is no way within FileMaker Pro that I’m aware of to systematically enable a plugin that is inactive. So if the user has the plugin installed, but inactive, this process will update it and leave it inactive, so it will essentially fail. I think this it is reasonable to assume that those using this process will not be making plugins inactive, but it needs to be noted that this is an issue.

Thanks

Thanks to Craig and Stephen for putting the work into this idea originally, and hopefully someone will find my minor additions and alterations useful.