Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added prep2013.cmd to lists after prep2012

Table of Contents
maxLevel3
outlinetrue

Building the FireBreath Plugin

See Also: FireBreath Tips: Working with Source Control

See Also: Prep Scripts

Requirements

Get the source

First thing is first; get the source code. We haven't done any official releases yet (though we should have a windows-only release by the end of January 2010), so you'll have to get the source from Mercurial on google gode.

To get a copy of the source, run the following command:

Code Block

hg clone https://firebreath.googlecode.com/hg/ firebreath

see the download page.

32 bit vs 64 bit builds

The normal prep scripts (e.g. prep2010.cmd) build 32-bit plugins - There are also prep scripts, ending in x64, which build 64-bit plugins.
Windows doesn't support universal binaries and most windows browsers are 32 bit and can only load 32-bit plugins.
Unless you know that you specifically need to build a 64-bit plugin, use the normal scripts.
The normal (non-64-bit) scripts work fine on 64-bit Windows, as do the resulting 32-bit plugins.

Generate the example project files

To generate the example project files, there are two use these batch files that can be used:

  • prep2005.cmd examples - Generate example project files for Visual Studio 2005
  • prep2008.cmd examples - Generate example project files for Visual Studio 2008
  • prep2010.cmd examples - Generate example project files for Visual Studio 2010
  • prep2012.cmd examples - Generate example project files for Visual Studio 2012
  • prep2013.cmd examples - Generate example project files for Visual Studio 2013

The project files will all be generated into the buildex/ directory under the project root.

...

To generate the project files, there are two these batch files that can be used:

  • prep2005.cmd - Generate project files for Visual Studio 2005
  • prep2008.cmd - Generate project files for Visual Studio 2008
  • prep2010.cmd  - Generate project files for Visual Studio 2010
  • prep2012.cmd - Generate project files for Visual Studio 2012
  • prep2013.cmd - Generate project files for Visual Studio 2013

The project files will all be generated into the build/ directory under the project root.

...

The DLL for the example project will be built in: buildex/bin/Debug/ (replace Debug with the configuration type you use to build)

register Register this DLL with regsvr32.exe:

Code Block

regsvr32 npPluginTemplate.dll

Note that this installs for all browsers -- not just IE.

Open in your browser and play with it

...

Open the file buildex/projects/FireBreathWin/gen/FBControl.htm (We'll move this to a better location later)

Most of the links are currently broken; we're working on coming up with a good test plugin and page, but we'll get back to you on it.

...

A few JS commands to try:

Code Block

plugin().returnStringecho("ThisPlease is a test stringecho back")
"ThisPlease isecho aback"
testEchoing: string"
Please echo back
Code Block

plugin().intToStringasString(372)
"372"
Code Block

plugin().valid
true

Attaching a debugger

...

For more debugging tips, see the Debugging Plugins section

MSI Distributable

If you already have WiX installed on your machine, building the project files will automatically create a re-distributable MSI (Microsoft Installer) package for your plug-in.  This allows for quick installation of your plug-in on other websites without the end-user needing to know how to manually register a DLL.  The MSI file itself will be located in: build/bin/Debug/ (replace Debug with the configuration type you use to build).

For more information, see WiX Installer Help

Install WiX

If you don't have WiX already, you can download the Wix Toolset for free from CodePlex.