A Custom SyntaxHighlighter 2.0 brush for INNO Setup

Using the SyntaxHighlighter Evolved Plugin (version 2.x) for WordPress has really given the code on this site more curb appeal. As many brushes that come with the plugin and searching through the third-party brushes throughout the Internet, I could not track down a brush for INNO Setup scripts. After a couple of hours and many attempts at this, I have created a plugin for INNO Setup.

You can see this plugin in action on this site by looking at the INNO Scripts sub-category on this site, however here is an example:

[Setup]
AppName=Beyond Compare
AppVerName=Beyond Compare Version 2.5
AppPublisher=Scooter Software
AppPublisherURL=http://www.scootersoftware.com
AppVersion=2.5.3.253
AppCopyright=Copyright © 2008 Scooter Software, Inc.
VersionInfoVersion=2.5.3.253
;SetupIconFile=embedded\bc2.ico
DefaultDirName={pf}\Beyond Compare 2
OutputBaseFilename=bc25en
Compression=lzma/max
SolidCompression=yes
LicenseFile=embedded\License.rtf
InfoBeforeFile=embedded\InfoBefore.rtf
WizardImageFile=embedded\WizardImage.bmp
WizardSmallImageFile=embedded\WizardSmallImage.bmp
DefaultGroupName=Beyond Compare 2
AllowNoIcons=Yes

You can also refer to how to implement this brush here.

/**
* INNO Brush
* http://www.jrsoftware.org/isinfo.php
*
* @copyright
* Copyright (C) 2013 Paul Combs.
*
* @author
* Paul Combs (it.megocollector.com).
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;

function Brush()
{
var directives = 'AllowCancelDuringInstall AllowNoIcons AllowRootDirectory AllowUNCPath AlwaysCreateUninstallIcon AlwaysRestart ' +
'AlwaysShowComponentsList AlwaysShowDirOnReadyPage AlwaysShowGroupOnReadyPage AlwaysUsePersonalGroup AppComments ' +
'AppContact AppCopyright AppendDefaultDirName AppendDefaultGroupName AppId AppModifyPath AppMutex AppName AppPublisher ' +
'AppPublisherURL AppReadmeFile AppSupportPhone AppSupportURL AppUpdatesURL AppVerName AppVersion ArchitecturesAllowed ' +
'ArchitecturesInstallIn64BitMode BackColor BackColor2 BackColorDirection BackSolid ChangesAssociations  ' +
'ChangesEnvironment Compression CompressionThreads CreateAppDir CreateUninstallRegKey DefaultDialogFontName ' +
'DefaultDirName DefaultGroupName DefaultUserInfoName DefaultUserInfoOrg DefaultUserInfoSerial DirExistsWarning ' +
'DisableAppendDir DisableDirPage DisableFinishedPage DisableProgramGroupPage DisableReadyMemo DisableReadyPage ' +
'DisableStartupPrompt DisableWelcomePage DiskClusterSize DiskSliceSize DiskSpanning DontMergeDuplicateFiles  ' +
'EnableDirDoesntExistWarning Encryption ExtraDiskSpaceRequired FlatComponentsList InfoAfterFile InfoBeforeFile ' +
'InternalCompressLevel LanguageDetectionMethod LicenseFile LZMAAlgorithm LZMABlockSize LZMADictionarySize LZMAMatchFinder ' +
'LZMANumBlockThreads LZMANumFastBytes LZMAUseSeparateProcess MergeDuplicateFiles MessagesFile MinVersion OnlyBelowVersion ' +
'OutputBaseFilename OutputDir OutputManifestFile Password PrivilegesRequired ReserveBytes RestartIfNeededByRun SetupIconFile ' +
'SetupLogging ShowComponentSizes ShowLanguageDialog ShowTasksTreeLines ShowUndisplayableLanguages SignedUninstaller ' +
'SignedUninstallerDir SignTool SlicesPerDisk SolidCompression SourceDir TerminalServicesAware TimeStampRounding ' +
'TimeStampsInUTC TouchDate TouchTime Uninstallable UninstallDisplayIcon UninstallDisplayName UninstallDisplaySize  ' +
'UninstallFilesDir UninstallIconFile UninstallIconName UninstallLogMode UninstallRestartComputer UninstallStyle ' +
'UpdateUninstallLogAppName UsePreviousAppDir UsePreviousGroup UsePreviousLanguage UsePreviousSetupType UsePreviousTasks ' +
'UsePreviousUserInfo UserInfoPage UseSetupLdr VersionInfoCompany VersionInfoCopyright VersionInfoDescription VersionInfoProductName ' +
'VersionInfoProductTextVersion VersionInfoProductVersion VersionInfoTextVersion VersionInfoVersion WindowResizable WindowShowCaption ' +
'WindowStartMaximized WindowVisible WizardImageBackColor WizardImageFile WizardImageStretch WizardSmallImageBackColor ' +
'WizardSmallImageFile WizardStyle Name Description Flags Types EtraDiskSpaceRequired GroupDescription Components ' +
'Attribs Permissions Source DestDir DestName Excludes ExternalSize CopyMode FontInstall StrongAssemblyName Filename ' +
'Parameters WorkingDir HotKey Comment IconFilename IconIndex AppUserModelID Section Key Key MessagesFile LicenseFile ' +
'InfoBeforeFile InfoAfterFile LanguageName LanguageID LanguageCodePage DialogFontName DialogFontSize WelcomeFontName WelcomeFontSize ' + 'TitleFontName StatusMsg WorkingDir RunOnceId TitleFontSize CopyrightFontName CopyrightFontSize RightToLeft Root Subkey ' +
'ValueType ValueName ValueData Verb Type Tasks';

var r = SyntaxHighlighter.regexLib;

this.regexList = [
{ regex: /(^;).*$/gmi,			                          css: 'comments' },   // [x] green
{ regex: /{(?!$)[\s\S]*?}/gm,								css: 'color2' },   // [x] purple, multiline comments { }
{ regex: /(^\[).*$/gmi,								      css: 'bold' },   // [x] black, bold, one line begins with [
{ regex: new RegExp(this.getKeywords(directives), 'gm'),   css: 'string' }    // [x] blue
];

this.forHtmlScript(r.scriptScriptTags);
};

Brush.prototype   = new SyntaxHighlighter.Highlighter();
Brush.aliases   = ['iss', 'inno'];
Brush.aliases   = ['inno', 'inno'];

SyntaxHighlighter.brushes.Autoit = Brush;

// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();