Installer for Word plugin

102 views
Skip to first unread message

Rintze Zelle

unread,
Sep 3, 2007, 10:33:56 AM9/3/07
to zotero-dev
I was wondering whether I could help with writing an installer for the
Word plugin for Windows (ticket #512)? I don't have previous
experience writing installers, but I did a little research on what
would have to be done:

1) Available installer software: I haven't come across suitable cross-
platform installers (except some Java-based ones, but these require a
Java Runtime Environment to be installed). This might not be a big
problem as the Word plugin will only be available on two platforms
(Mac and Windows), and if I understood correctly from the ticket a
MacOS X-installer might be produced rather easily anyway. A installer
for Windows could be based on NSIS, a rather popular installer system
which is both free and open source.

2) Detecting the Startup folder path. The most difficult part of the
installer will be determining the correct place to put the Zotero.dot
file. Microsoft made a bit of a mess of things, but if I understand
correctly, the correct folder is the one specified under
Tools>Options>File locations>Startup directory in Word, which has a
default setting of a folder in the application data folder ("$APPDATA
\Microsoft\Word\Startup" where $APPDATA is something like "C:\Windows
\Profiles\user name\Application Data"). Microsoft suggests that you
should first check for a registry key that is created when the user
specifies a different Startup Folder, and, if that key doesn't exist,
to fall back on the default folder location. So the installer would
have to include the following steps:
a) Check whether Word is installed (this can be looked up in the
registry)
b) Look up the registry key to check whether a non-default Startup
Folder has been specified
c) If in b no key is found, use default folder location to install
Zotero.dot. If a key has been found, install Zotero.dot in that
folder.

3) Zotero.dot naming. Currently the plugin is named just Zotero.dot. A
naming scheme that would incorporate a version-identifier might be
handy if the installer is to check whether an older version of the
plugin is already installed. Alternatively you could just name all
versions of the plugin "Zotero.dot" and set the installer to overwrite
any existing Zotero.dot-file by default. This (easy) solution however
doesn't prevent users from installing older versions of the plugin
over newer versions.

Some useful sites I came across with info on where to look for the
startup-folder:
http://support.microsoft.com/kb/210860/en-us
http://www.primeconsulting.com/faqs/faq6400.html

Concludingly, I would like to know whether I can help. If so, I can
probably mash up an installer this week using NSIS. This software
includes wizards to create installers, so the only custom code that
has to be written would be steps a to c (see point 2).

Dan Stillman

unread,
Sep 3, 2007, 3:49:31 PM9/3/07
to zoter...@googlegroups.com
On 9/3/07 10:33 AM, Rintze Zelle wrote:
> I was wondering whether I could help with writing an installer for the
> Word plugin for Windows (ticket #512)?

By all means.

> I haven't come across suitable cross-
> platform installers (except some Java-based ones, but these require a
> Java Runtime Environment to be installed). This might not be a big
> problem as the Word plugin will only be available on two platforms
> (Mac and Windows), and if I understood correctly from the ticket a
> MacOS X-installer might be produced rather easily anyway. A installer
> for Windows could be based on NSIS, a rather popular installer system
> which is both free and open source.

A Windows-only installer isn't a problem, since the Mac version will
probably just use a disk image with a custom background and an aliased
drop folder. The Nullsoft installer should be fine.

> 2) Detecting the Startup folder path. The most difficult part of the
> installer will be determining the correct place to put the Zotero.dot
> file. Microsoft made a bit of a mess of things, but if I understand
> correctly, the correct folder is the one specified under
> Tools>Options>File locations>Startup directory in Word, which has a
> default setting of a folder in the application data folder ("$APPDATA
> \Microsoft\Word\Startup" where $APPDATA is something like "C:\Windows
> \Profiles\user name\Application Data").

For XP it's usually C:\Documents and Settings rather than
C:\Windows\Profiles\, but, yeah, that's right.

> Microsoft suggests that you
> should first check for a registry key that is created when the user
> specifies a different Startup Folder, and, if that key doesn't exist,
> to fall back on the default folder location. So the installer would
> have to include the following steps:
> a) Check whether Word is installed (this can be looked up in the
> registry)
> b) Look up the registry key to check whether a non-default Startup
> Folder has been specified
> c) If in b no key is found, use default folder location to install
> Zotero.dot. If a key has been found, install Zotero.dot in that
> folder.

Sounds good.

> 3) Zotero.dot naming. Currently the plugin is named just Zotero.dot. A
> naming scheme that would incorporate a version-identifier might be
> handy if the installer is to check whether an older version of the
> plugin is already installed. Alternatively you could just name all
> versions of the plugin "Zotero.dot" and set the installer to overwrite
> any existing Zotero.dot-file by default. This (easy) solution however
> doesn't prevent users from installing older versions of the plugin
> over newer versions.

I'm not too concerned about version detection in the installer. If
Zotero and the plugin are on incompatible versions, an alert will pop up
advising the user to download the latest versions of each from
zotero.org, so using "Zotero.dot" should be fine.

> Concludingly, I would like to know whether I can help. If so, I can
> probably mash up an installer this week using NSIS.

Yes, that'd be great.

At some point we might consider whether we have any interest in doing
this within Zotero itself, since we do have access to the Windows
registry within Firefox
(http://developer.mozilla.org/en/docs/Accessing_the_Windows_Registry_Using_XPCOM)
and could create an installer in the preferences (similar to what we do
now with the PDF tools). But it'd take considerably longer to develop
that, it wouldn't happen in time for 1.0, and it might be more
appropriate as part of a more general architecture for installing
option/platform-specific add-ons, so I think we should go with NSIS for
now for the Windows installer.

Let us know if you have any questions or need any assistance. Thanks
very much for your help.

- Dan

Rintze Zelle

unread,
Sep 4, 2007, 8:17:48 AM9/4/07
to zotero-dev
I've written an initial version of the installer. I've uploaded both
the script and the compiled installer to the file area of this Google
group (http://groups.google.com/group/zotero-dev/files).

Some notes:

- I've written the installer in Eclipse using the NSIS-plugin that is
available for this IDE (http://eclipsensis.sourceforge.net/
index.shtml). It is quite an easy platform to code installers.
- The code to detect the correct folder for the Zotero.dot file only
works for Word 2000 to 2007. I read on the forum that apparently Word
97 also works with the plugin, but I haven't come across any
documentation yet describing how I can find the plugin-folder (this is
by default C:\Program Files\Microsoft Office\Office\STARTUP\). If a
registry key exists support for Word 97 is easily implementable.
- The code most likely only works for Windows 2000 and up (this
further includes XP and Vista).
- The behavior of the installer is now to always overwrite the
existing Zotero.dot without asking for confirmation.
- The current installer is quite skinny. It doesn't show a Zotero
logo, a license or anything else. It also doesn't enter anything in
the registry or start menu, and doesn't provide an uninstaller.
- The installer only supports English right now. Apparently the
interface of the NSIS-software is already translated in a great number
of languages, so localization would only require the translation of a
couple of strings that I've written myself.

It works on my computer (XP SP2 with Word 2007), but a few more tests
are most welcome. Please let me know where you think improvements are
necessary.

Rintze Zelle

unread,
Sep 14, 2007, 7:48:37 AM9/14/07
to zotero-dev
For those who wish to test the current installer, a few extra tips:

- ZoteroWordPluginInstaller0.3.zip contains version 1.0a3 of the Word
plugin
- I zipped the installer as Google Groups doesn't allow .exe uploads
- The installer checks for the presence of Word, and if a copy is
found, it copies the plugin-file (Zotero.dot) to the startup-folder of
Word. The path of this startup-folder is shown during the installation
process. The plugin can be uninstalled by manually deleting the
Zotero.dot-file.

Rintze Zelle

unread,
Sep 19, 2007, 1:11:13 PM9/19/07
to zotero-dev
I just updated the installer to 0.4 (available again in the files
section of this Google Group). I uncovered a bug for which the
installer wouldn't install in the right folder (in case of Word 97 to
2003 and a customized templates folder).

Rintze Zelle

unread,
Sep 27, 2007, 10:48:42 AM9/27/07
to zotero-dev
I think the installer can be made available on the Zotero web page. I
rewrote the installation-section of http://www.zotero.org/documentation/microsoft_word_integration
to reflect positive user reports on the versions of Word and Windows
with which the plugin works. I also updated the info regarding
installing the plugin by hand:

http://docs.google.com/Doc?id=dg6h9k72_47ftj3wf

Dan Stillman

unread,
Oct 3, 2007, 2:40:13 PM10/3/07
to zoter...@googlegroups.com
On 9/27/07 10:48 AM, Rintze Zelle wrote:
> I think the installer can be made available on the Zotero web page. I
> rewrote the installation-section of http://www.zotero.org/documentation/microsoft_word_integration
> to reflect positive user reports on the versions of Word and Windows
> with which the plugin works. I also updated the info regarding
> installing the plugin by hand

The Word plugin installer and updated documentation are up at
http://www.zotero.org/documentation/microsoft_word_integration. I made a
few small changes to the versions Rintze posted here (including an icon
for the installer, though only at 32x32px).

Rintze, thanks for all your help with this.

mdel...@gmail.com

unread,
Oct 4, 2007, 9:46:56 AM10/4/07
to zotero-dev
It didn't work for me on Vista 64-bit with Word 2007. I always use
the Administrator account so maybe that has something to do with it
but the output file goes to C:\Users\Administrator\AppData\Roaming
\Microsoft\Word\Startup. I've been using that plugin quite a lot
lately and it seems to work pretty well with one exception (and
unrelated to the installer). I don't know if its a character limit or
an actual reference limit but that plugin won't let me add in more
than about 100 references. After that point I just get a Visual Basic
overflow error everytime I want to insert a reference. I can't
remember the error code right now, maybe 1599 or something like
that...

Marcello

On Oct 3, 1:40 pm, Dan Stillman <dstill...@zotero.org> wrote:
> On 9/27/07 10:48 AM, Rintze Zelle wrote:
>
> > I think the installer can be made available on the Zotero web page. I

> > rewrote the installation-section ofhttp://www.zotero.org/documentation/microsoft_word_integration


> > to reflect positive user reports on the versions of Word and Windows
> > with which the plugin works. I also updated the info regarding
> > installing the plugin by hand
>

> The Word plugin installer and updated documentation are up athttp://www.zotero.org/documentation/microsoft_word_integration. I made a

Rintze Zelle

unread,
Oct 4, 2007, 10:09:03 AM10/4/07
to zotero-dev
Could you supply a bit more information on how exactly the
installation process is failing? Do I understand correctly that after
installation you don't see the icons of the plugin appear in Word?

Perhaps you can tell me the path of the correct startup folder? You
can find this in Word 2007 under Word Options > Advanced > General >
File Locations. The path of the startup folder should be listed there.

mdel...@gmail.com

unread,
Oct 5, 2007, 9:21:09 AM10/5/07
to zotero-dev
Scratch my first message. Your installer did work on my 64-bit Vista
OS. What happened was that I'm used to getting a unknown macro
warning from MS Word asking if it should disable the .dot file every
time I launch the program because I kept it in the C:\Program Files
(x86)\Microsoft Office\Office12\STARTUP directory. With your
installer I didn't get the macro warning that I'm used to getting all
the time and I overlooked the fact that the zotero add-in was there
the whole time. Sorry about that. Thanks for the installer too
because now I don't have to deal with that annoying macro warning!

Marcello

Rintze Zelle

unread,
Oct 5, 2007, 10:16:32 AM10/5/07
to zotero-dev
Word apparently shows some erratic behaviour. There is some redundancy
with regard to the startup folder(s). I read somewhere that the files

in the "C:\Program Files (x86)\Microsoft Office\Office12\STARTUP"
aren't automatically 'trusted', which would explain the unknown macro
warning, whereas those in the other directory you mentioned earlier
are.

I'm happy to hear that the installer worked after all.

Rintze Zelle

Reply all
Reply to author
Forward
0 new messages