Find file
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (49 sloc) 4.85 KB

This project/solution is designed to be built in Microsoft Visual Studio 2008 (or 2008 express) or later,
and has a few build-time dependencies.
Some dependencies are internal/bundled:
- fart.exe, a GPLv2 file search-replace tool used for pre-build "ComponentResourceManager" replacement
- ILRepack.exe, an Apache 2.0 assembly-merging tool for post-build merging into a single assembly for command-line and demo projects
- LinqBridge, a collection-handling convenience library for .Net 2.0 under Visual Studio 2008, released under a BSD-style license
- NDesk.Options, a command-line-option-parsing library released under a MIT/X11-style license
- NUnit (including UI runner assemblies for plugin-free debugging) for the tests project
Some are additional external dependencies for different components of the solution:
- Robert Giesecke's Unmanaged Exports technique, used in the Notepad++ plugin project, does not work in Express versions of Visual Studio
- The SSMS plugin installer and Winmerge plugin installer projects are not supported in Express versions of Visual Studio
- The Winmerge Plugin requires VB6 (eg Visual Studio 6), to expose a COM object properly to WinMerge's plugin-loading framework - instructions below
- The SSMS Plugin project by default points to SSMS 2008 in the x86 program files folder, for debugging. This can be changed to an available copy of SSMS as required by editing the project properties.
The formatting library and commandline utility have been compiled under Mono (a long time ago - not recently attempted), and
should theoretically work fine. The WinForms app, however, does not (or did not the last time I tried): the "WebBrowser"
implementation was simply not close enough to the microsoft one for it to work. I may come back to this over the coming months.
To manually deploy the SSMS Add-In (eg when using an Express edition of Visual Studio), the process will
depend on which version of SSMS you are deploying to:
- For SSMS 2005-2008R2, full or Express, you need:
- The Add-In assembly to be exposed as a COM object (this should happen automatically as part of the build)
- To add a registry key pointing to the "PoorMansTSqlFormatterSSMSAddIn.AddinConnector" COM object:
- for SSMS 2005 Express: HKLM\Software\Microsoft\Microsoft SQL Server\100\Tools\ShellSEM\Addins\PoorMansTSqlFormatterSSMSAddIn.AddinConnector
- for SSMS 2005 Full: HKLM\Software\Microsoft\Microsoft SQL Server\100\Tools\Shell\Addins\PoorMansTSqlFormatterSSMSAddIn.AddinConnector
- for SSMS 2008 Express: HKLM\Software\Microsoft\Microsoft SQL Server\90\Tools\ShellSEM\Addins\PoorMansTSqlFormatterSSMSAddIn.AddinConnector
- for SSMS 2008 Full: HKLM\Software\Microsoft\Microsoft SQL Server\90\Tools\Shell\Addins\PoorMansTSqlFormatterSSMSAddIn.AddinConnector
- In the registry key, add a value "LoadBehavior", of type "Integer", with value "1".
- For SSMS 2012, full or Express, you need to
- copy the "PoorMansTSqlFormatterSSMSAddIn.AddIn" file to a "Microsoft\MSEnvShared\AddIns" subfolder of All Users Documents
- EG on windows 7, the target folder is normally: "C:\Users\Public\Documents\Microsoft\MSEnvShared\AddIns"
- edit the "PoorMansTSqlFormatterSSMSAddIn.AddIn" file so that the "Assembly" element points to the "PoorMansTSqlFormatterSSMSAddIn.dll" assembly.
The WinMerge Plugin preparation is reasonably complex/painful, especially on a recent (Vista/Win7 x64) dev machine:
- Open a command prompt as administrator
- Navigate to the "PoorMansTSqlFormatterWinMergePlugin" folder in the command prompt
- Run the "Initialize_GetLibAsCOM.bat" file; this should give you a warning but succeed
- Open the VB6 project
- Check that the "PoorMansTSqlFormatterLib.tlb" reference does not show up as "MISSING" (if it does, review previous steps and/or remove and add the reference again)
- In VB6, "Make" the "TSqlFormatWMPlugin.dll" file.
- This will probably spit out an error like "Error accessing the system registry", which can be ignored, as the DLL was created (the error concerns the COM registrtion, which we will do later in the .Net setup project anyway)
- In VS2008, "Rebuild" the WinMerge Plugin Setup project.
The packaging and release process is currently completely manual:
- Ensure AssemblyInfo versions are updated, including versions of setup packages
- Rebuild solution in Release mode, and additionally manually rebuild the two setup projects
- Copy Binaries for simple executables and setup files into dedicated folders, zip them up and version-number the zip files.
- Upload the archives to website
- Change website to reference the new archives
- Update Notepad++ plugin manager admin site to reflect the new version (in staging - actual live publishing is done by site administrator)
If you encounter any issues building this project, please don't hesitate to contact me: my email address starts with tao, and is
hosted at klerks dot biz.