-
Notifications
You must be signed in to change notification settings - Fork 267
/
BUILDING.txt
61 lines (53 loc) · 5.32 KB
/
BUILDING.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
This project/solution is designed to be built in Microsoft Visual Studio 2013 Community Edition (or better),
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
- Bridge.Net, a C#-to-JS transpiler, released under the Apache license
- Microsoft.VisualStudio.Sdk.BuildTasks.14 for Visual Studio Extensibility Package compilation
Some are additional external dependencies for different components of the solution:
- Robert Giesecke's UnmanagedExports technique, used in the Notepad++ plugin project, may not work in some older versions of VS
- The Winmerge plugin installer project is not supported in Express versions of Visual Studio, and requires the "Visual Studio Installer Projects" extension
- 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 Add-In Installer and SSMS Extension Installer projects require the Wix Toolkit to be installed on the computer, and the Wix Toolset Visual Studio Extension to be installed in Visual Studio.
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/years.
To manually deploy the SSMS Add-In, 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
- 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.
- For VS 2015-2012 you need to do the same as for SSMS 2012
- For VS 2013-2017 and SSMS 2016-17 you can just double-click on the generated VSIX package file
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/installers and manual reverences in AddIn and Package definition files (multiple)
- Rebuild solution in Release mode, and additionally manually rebuild the two setup projects
- Setup project issues can be investigated with msiexec's verbose logging: msiexec /i PoorMansTSqlFormatterSSMSPackage.Setup.msi /l*v MyLogFile.txt
- 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.