Skip to content

Commit

Permalink
Add addin tooling installation build targets and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kMutagene committed May 26, 2020
1 parent 92beee2 commit b8a23ff
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 41 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,19 @@ Develop

- .NET Core SDK at of at least the version in [the global.json file](global.json)
- Node.js with npm/npx
- connections from excel to localhost need to be via https, so you need a certificate and trust it. [office-addin-dev-certs](https://www.npmjs.com/package/office-addin-dev-certs?activeTab=versions) does that for you (should be a fake target pretty soon (TM))
- You may need a loopback exemption for Edge/IE (whatever is run in your excel version)
- connections from excel to localhost need to be via https, so you need a certificate and trust it. [office-addin-dev-certs](https://www.npmjs.com/package/office-addin-dev-certs?activeTab=versions) does that for you.

you can also use the fake build target for certificate creation and installation by using `fake build -t createdevcerts`.

This will use office-addin-dev-certs to create the necessary certificates, and open the installation dialogue for you:

![File](docsrc/files/img/file.png)

installing this ca certificate under your trusted root certification authorities will enable you to use httpss via localhost.

- You may need a loopback exemption for Edge/IE (whatever is run in your excel version):

`CheckNetIsolation LoopbackExempt -a -n="microsoft.win32webviewhost_cw5n1h2txyewy"`

This project uses the [SAFE Stack](https://github.com/SAFE-Stack) to create a website that uses [office.js](https://github.com/OfficeDev/office-js) to interop with Excel.

Expand Down
28 changes: 27 additions & 1 deletion build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ open Fake.IO

Target.initEnvironment ()


let serverPath = Path.getFullName "./src/Server"
let clientPath = Path.getFullName "./src/Client"
let clientDeployPath = Path.combine clientPath "deploy"
Expand All @@ -36,6 +37,7 @@ let nodeTool = platformTool "node" "node.exe"
let npmTool = platformTool "npm" "npm.cmd"
let npxTool = platformTool "npx" "npx.cmd"


let runTool cmd args workingDir =
let arguments = args |> String.split ' ' |> Arguments.OfArgs
Command.RawCommand (cmd, arguments)
Expand All @@ -47,7 +49,7 @@ let runTool cmd args workingDir =

let runDotNet cmd workingDir =
let result =
DotNet.exec (DotNet.Options.withWorkingDirectory workingDir) cmd ""
Fake.DotNet.DotNet.exec (Fake.DotNet.DotNet.Options.withWorkingDirectory workingDir) cmd ""
if result.ExitCode <> 0 then failwithf "'dotnet %s' failed in %s" cmd workingDir

let openBrowser url =
Expand Down Expand Up @@ -136,6 +138,30 @@ Target.create "OfficeDebug" (fun _ ->
|> ignore
)

Target.create "InstallOfficeAddinTooling" (fun _ ->

printfn "Installing office addin tooling"

runTool npmTool "install -g office-dev-certs" __SOURCE_DIRECTORY__
runTool npmTool "install -g office-addin-debugging" __SOURCE_DIRECTORY__
runTool npmTool "install -g office-addin-manifest" __SOURCE_DIRECTORY__

)

Target.create "CreateDevCerts" (fun _ ->
runTool npxTool "office-addin-dev-certs install --days 365" __SOURCE_DIRECTORY__

let certPath =
Path.combine
(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile))
".office-addin-dev-certs/ca.crt"


let psi = new System.Diagnostics.ProcessStartInfo(FileName = certPath, UseShellExecute = true)
System.Diagnostics.Process.Start(psi) |> ignore

)


open Fake.Core.TargetOperators

Expand Down
Binary file added docsrc/files/img/file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 46 additions & 38 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ NUGET
FSharp.Core (>= 4.7.1)
FParsec (1.1.1)
FSharp.Core (>= 4.3.4)
FSharp.Control.Reactive (4.2)
FSharp.Core (>= 4.2.3)
System.Reactive (>= 4.0)
FSharp.Core (4.7.1)
FSharp.Control.Reactive (4.3)
FSharp.Core (>= 4.7)
System.Reactive (>= 4.3.2)
FSharp.Core (4.7.2)
Microsoft.Build (16.5)
Microsoft.Build.Framework (16.5)
System.Runtime.Serialization.Primitives (>= 4.1.1)
Expand Down Expand Up @@ -139,23 +139,23 @@ NUGET
Microsoft.Build.Utilities.Core (>= 16.4)
System.IO.Compression (>= 4.3)
Newtonsoft.Json (12.0.3)
NuGet.Common (5.5.1)
NuGet.Frameworks (>= 5.5.1)
NuGet.Common (5.6)
NuGet.Frameworks (>= 5.6)
System.Diagnostics.Process (>= 4.3)
System.Threading.Thread (>= 4.3)
NuGet.Configuration (5.5.1)
NuGet.Common (>= 5.5.1)
NuGet.Configuration (5.6)
NuGet.Common (>= 5.6)
System.Security.Cryptography.ProtectedData (>= 4.3)
NuGet.Frameworks (5.5.1)
NuGet.Packaging (5.5.1)
NuGet.Frameworks (5.6)
NuGet.Packaging (5.6)
Newtonsoft.Json (>= 9.0.1)
NuGet.Configuration (>= 5.5.1)
NuGet.Versioning (>= 5.5.1)
NuGet.Configuration (>= 5.6)
NuGet.Versioning (>= 5.6)
System.Dynamic.Runtime (>= 4.3)
NuGet.Protocol (5.5.1)
NuGet.Packaging (>= 5.5.1)
NuGet.Protocol (5.6)
NuGet.Packaging (>= 5.6)
System.Dynamic.Runtime (>= 4.3)
NuGet.Versioning (5.5.1)
NuGet.Versioning (5.6)
runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.debian.9-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
Expand Down Expand Up @@ -452,6 +452,14 @@ NUGET
System.Reflection.Primitives (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.Handles (>= 4.3)
System.Runtime.InteropServices.RuntimeInformation (4.3)
runtime.native.System (>= 4.3)
System.Reflection (>= 4.3)
System.Reflection.Extensions (>= 4.3)
System.Resources.ResourceManager (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.InteropServices (>= 4.3)
System.Threading (>= 4.3)
System.Runtime.InteropServices.WindowsRuntime (4.3)
System.Runtime (>= 4.3)
System.Runtime.Numerics (4.3)
Expand Down Expand Up @@ -649,7 +657,7 @@ NUGET
Fable.Core (>= 3.1.5)
Fable.Parsimmon (>= 4.0)
FSharp.Core (>= 4.7)
FSharp.Core (4.7.1)
FSharp.Core (4.7.2)
Fulma (2.8.1)
Fable.Core (>= 3.0)
Fable.React (>= 5.1)
Expand All @@ -676,21 +684,21 @@ STORAGE: NONE
RESTRICTION: == netcoreapp3.0
NUGET
remote: https://api.nuget.org/v3/index.json
Fable.Remoting.Giraffe (3.11.2)
Fable.Remoting.Json (>= 2.6)
Fable.Remoting.Server (>= 4.10.2)
Fable.Remoting.Giraffe (3.12)
Fable.Remoting.Json (>= 2.7)
Fable.Remoting.Server (>= 4.11)
FSharp.Core (>= 4.6.2)
Giraffe (>= 3.6)
Fable.Remoting.Json (2.6)
Fable.Remoting.Json (2.7)
FSharp.Core (>= 4.6.2)
Newtonsoft.Json (>= 12.0.2)
Fable.Remoting.Server (4.10.2)
Fable.Remoting.Json (>= 2.6)
Fable.Remoting.Server (4.11)
Fable.Remoting.Json (>= 2.7)
FSharp.Core (>= 4.6.2)
FSharp.Control.Websockets (0.2.2)
FSharp.Core (>= 4.3.4)
Microsoft.IO.RecyclableMemoryStream (>= 1.2.2)
FSharp.Core (4.7.1)
FSharp.Core (4.7.2)
Giraffe (4.1)
FSharp.Core (>= 4.7)
Microsoft.IO.RecyclableMemoryStream (>= 1.2.2)
Expand Down Expand Up @@ -997,20 +1005,20 @@ NUGET
Microsoft.Extensions.DependencyInjection.Abstractions (>= 3.1.4)
Microsoft.Extensions.Options (>= 3.1.4)
System.Text.Encodings.Web (>= 4.7.1)
Microsoft.IdentityModel.JsonWebTokens (6.5.1)
Microsoft.IdentityModel.Tokens (>= 6.5.1)
Microsoft.IdentityModel.Logging (6.5.1)
Microsoft.IdentityModel.Protocols (6.5.1)
Microsoft.IdentityModel.Logging (>= 6.5.1)
Microsoft.IdentityModel.Tokens (>= 6.5.1)
Microsoft.IdentityModel.Protocols.OpenIdConnect (6.5.1)
Microsoft.IdentityModel.Protocols (>= 6.5.1)
System.IdentityModel.Tokens.Jwt (>= 6.5.1)
Microsoft.IdentityModel.Tokens (6.5.1)
Microsoft.IdentityModel.JsonWebTokens (6.6)
Microsoft.IdentityModel.Tokens (>= 6.6)
Microsoft.IdentityModel.Logging (6.6)
Microsoft.IdentityModel.Protocols (6.6)
Microsoft.IdentityModel.Logging (>= 6.6)
Microsoft.IdentityModel.Tokens (>= 6.6)
Microsoft.IdentityModel.Protocols.OpenIdConnect (6.6)
Microsoft.IdentityModel.Protocols (>= 6.6)
System.IdentityModel.Tokens.Jwt (>= 6.6)
Microsoft.IdentityModel.Tokens (6.6)
Microsoft.CSharp (>= 4.5)
Microsoft.IdentityModel.Logging (>= 6.5.1)
Microsoft.IdentityModel.Logging (>= 6.6)
System.Security.Cryptography.Cng (>= 4.5)
Microsoft.IO.RecyclableMemoryStream (1.3.3)
Microsoft.IO.RecyclableMemoryStream (1.3.4)
Microsoft.Net.Http.Headers (2.2.8)
Microsoft.Extensions.Primitives (>= 2.2)
System.Buffers (>= 4.5)
Expand Down Expand Up @@ -1061,9 +1069,9 @@ NUGET
System.Drawing.Common (4.7)
Microsoft.NETCore.Platforms (>= 3.1)
Microsoft.Win32.SystemEvents (>= 4.7)
System.IdentityModel.Tokens.Jwt (6.5.1)
Microsoft.IdentityModel.JsonWebTokens (>= 6.5.1)
Microsoft.IdentityModel.Tokens (>= 6.5.1)
System.IdentityModel.Tokens.Jwt (6.6)
Microsoft.IdentityModel.JsonWebTokens (>= 6.6)
Microsoft.IdentityModel.Tokens (>= 6.6)
System.IO.Pipelines (4.7.2)
System.Memory (4.5.4)
System.Net.WebSockets.WebSocketProtocol (4.7.1)
Expand Down

0 comments on commit b8a23ff

Please sign in to comment.