Skip to content

Commit

Permalink
Merge pull request #22 from newrelic/feature/add_windows_msi_support
Browse files Browse the repository at this point in the history
Feature/add windows msi support
  • Loading branch information
camdencheek authored Nov 13, 2019
2 parents 5216290 + 8c25105 commit 447ba2b
Show file tree
Hide file tree
Showing 11 changed files with 533 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
_obj
_test
bin
obj

# Architecture specific extensions/prefixes
*.[568vq]
Expand All @@ -24,7 +25,10 @@ _testmain.go
*.test
*.prof
*.DS_STORE
*.syso
*.wxs

versioninfo.json
/integrations/*/bin/
coverage.xml
target/
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 2.0.2 - 2019-10-22
- Windows installer packaging

## 2.0.1 - 2019-07-23
- Removed unneeded JMX dependency

Expand Down
22 changes: 22 additions & 0 deletions f5-win-definition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: com.newrelic.f5
description: Reports status and metrics for F5 service
protocol_version: 1
os: windows

commands:
all_data:
command:
- .\bin\nr-f5.exe
prefix: config/f5
interval: 15
metrics:
command:
- .\bin\nr-f5.exe
- --metrics
interval: 15
inventory:
command:
- .\bin\nr-f5.exe
- --inventory
prefix: config/f5
interval: 15
96 changes: 96 additions & 0 deletions pkg/windows/nri-386-installer/Product.wxs.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define Version = "{IntegrationVersion}" ?>
<?define ProductId = "*" ?>
<?define UpgradeCode = "{73d03306-78f5-4b3b-a444-fa87381ddadc}" ?>

<Product Id="$(var.ProductId)"
Name="New Relic Infrastructure Integration, nri-{IntegrationName}"
Language="1033"
Version="$(var.Version)"
Manufacturer="New Relic, Inc."
UpgradeCode="$(var.UpgradeCode)">
<Package Id="*"
InstallerVersion="200"
Compressed="yes"
InstallScope="perMachine"
Platform="x86"
Manufacturer="New Relic, Inc."
Comments="(c) {Year} New Relic, Inc."
Keywords="infrastructure,MSI,on-host,{IntegrationName}"/>

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed."/>
<MediaTemplate EmbedCab="yes"/>

<Feature Id="ProductFeature" Title="New Relic Infrastructure Integration, nri-{IntegrationName}" Level="1">
<ComponentRef Id="CMP_V1_PLUGIN_CONFIGS"/>
<ComponentRef Id="CMP_V1_CUSTOM_PLUGINS"/>
<ComponentRef Id="CMP_V1_CUSTOM_PLUGINS_BIN"/>
<ComponentGroupRef Id="CustomPluginsBinComponent"/>
<ComponentGroupRef Id="CustomPluginsComponent"/>
<ComponentGroupRef Id="PluginConfigsComponent"/>
</Feature>
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="CompanyFolder" Name="New Relic">
<Directory Id="AgentBinaryFolder" Name="newrelic-infra">
<Directory Id="PluginConfigsFolder" Name="integrations.d"/>
<Directory Id="CustomPluginsFolder" Name="newrelic-integrations">
<Directory Id="CustomPluginsBinFolder" Name="bin"/>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>

<Fragment>
<DirectoryRef Id="PluginConfigsFolder">
<Component Id="CMP_V1_PLUGIN_CONFIGS" Guid="803C978C-B2A1-47C7-BB17-A2DE9E6D3145" KeyPath="yes">
<CreateFolder/>
</Component>
</DirectoryRef>
<DirectoryRef Id="CustomPluginsFolder">
<Component Id="CMP_V1_CUSTOM_PLUGINS" Guid="0EE4AAF4-9923-499C-A1D0-FF55B205A76C" KeyPath="yes">
<CreateFolder/>
</Component>
</DirectoryRef>
<DirectoryRef Id="CustomPluginsBinFolder">
<Component Id="CMP_V1_CUSTOM_PLUGINS_BIN" Guid="e4509a7a-409e-4a38-8705-37de9cf0d72d" KeyPath="yes">
<CreateFolder/>
</Component>
</DirectoryRef>
</Fragment>

<Fragment>
<ComponentGroup Id="CustomPluginsBinComponent" Directory="CustomPluginsBinFolder">
<Component Id="CMP_NRI_{IntegrationName}_EXE" Guid="ee588d29-c9d4-4e12-bb72-d26cad377588" Win64="no">
<File Id="FILE_NRI_{IntegrationName}_EXE"
Source="$(var.BinariesPath){IntegrationExe}"
KeyPath="yes"/>
</Component>
</ComponentGroup>
<ComponentGroup Id="CustomPluginsComponent" Directory="CustomPluginsFolder">
<Component Id="CMP_NRI_{IntegrationName}_DEFINITION_YML" Guid="acc7e790-80c7-4960-834a-ffe12f369316" Win64="no"
NeverOverwrite="yes" Permanent="yes">
<File Id="FILE_NRI_{IntegrationName}_DEFINITION_YML"
Name="{IntegrationName}-definition.yml"
Source="$(var.ProjectRootPath){IntegrationName}-win-definition.yml"
KeyPath="yes"/>
</Component>
</ComponentGroup>
<ComponentGroup Id="PluginConfigsComponent" Directory="PluginConfigsFolder">
<Component Id="CMP_NRI_{IntegrationName}_CONFIG_YML" Guid="cd9eb557-bbe7-4100-a9c1-a6274d77a9af" Win64="no"
NeverOverwrite="yes" Permanent="yes">
<File Id="FILE_NRI_{IntegrationName}_CONFIG_YML"
Name="{IntegrationName}-config.yml.sample"
Source="$(var.ProjectRootPath){IntegrationName}-config.yml.sample"
KeyPath="yes"/>
</Component>
</ComponentGroup>
</Fragment>

</Wix>
41 changes: 41 additions & 0 deletions pkg/windows/nri-386-installer/nri-installer.wixproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.10</ProductVersion>
<ProjectGuid>3cbbb016-6054-4d00-bd1d-e735a349d8e7</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>$(integration)-386</OutputName>
<OutputType>Package</OutputType>
<SignToolPath>C:\Program Files (x86)\Windows Kits\10\bin\x64\</SignToolPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<Name>newrelic-$(integration)-installer</Name>
<DefineSolutionProperties>false</DefineSolutionProperties>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug;ProjectRootPath=..\..\..\;BinariesPath=..\..\..\target\bin\windows_386\</DefineConstants>
<SuppressAllWarnings>True</SuppressAllWarnings>
<Pedantic>False</Pedantic>
<CompilerAdditionalOptions>-arch x86</CompilerAdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug;ProjectRootPath=..\..\..\;BinariesPath=..\..\..\target\bin\windows_386\</DefineConstants>
<CompilerAdditionalOptions>-arch x86</CompilerAdditionalOptions>
</PropertyGroup>
<ItemGroup>
<Compile Include="Product.wxs"/>
</ItemGroup>
<Import Project="$(WixTargetsPath)"/>
<Target Name="SignInstaller">
<Exec Command="&quot;$(SignToolPath)signtool.exe&quot; sign /d &quot;New Relic Infrastructure Integration, $(integration)&quot; /a &quot;$(OutputPath)$(OutputName).msi&quot;"/>
<Copy SourceFiles="$(OutputPath)$(OutputName).msi" DestinationFiles="$(OutputPath)$(OutputName).x.y.z.msi"/>
<!-- <Delete Files="$(OutputPath)$(OutputName).msi" /> -->
</Target>
<Target Name="AfterBuild" DependsOnTargets="SignInstaller"/>
</Project>
96 changes: 96 additions & 0 deletions pkg/windows/nri-amd64-installer/Product.wxs.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define Version = "{IntegrationVersion}" ?>
<?define ProductId = "*" ?>
<?define UpgradeCode = "{73d03306-78f5-4b3b-a444-fa87381ddadc}" ?>

<Product Id="$(var.ProductId)"
Name="New Relic Infrastructure Integration, nri-{IntegrationName}"
Language="1033"
Version="$(var.Version)"
Manufacturer="New Relic, Inc."
UpgradeCode="$(var.UpgradeCode)">
<Package Id="*"
InstallerVersion="200"
Compressed="yes"
InstallScope="perMachine"
Platform="x64"
Manufacturer="New Relic, Inc."
Comments="(c) {Year} New Relic, Inc."
Keywords="infrastructure,MSI,on-host,{IntegrationName}"/>

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed."/>
<MediaTemplate EmbedCab="yes"/>

<Feature Id="ProductFeature" Title="New Relic Infrastructure Integration, nri-{IntegrationName}" Level="1">
<ComponentRef Id="CMP_V1_PLUGIN_CONFIGS"/>
<ComponentRef Id="CMP_V1_CUSTOM_PLUGINS"/>
<ComponentRef Id="CMP_V1_CUSTOM_PLUGINS_BIN"/>
<ComponentGroupRef Id="CustomPluginsBinComponent"/>
<ComponentGroupRef Id="CustomPluginsComponent"/>
<ComponentGroupRef Id="PluginConfigsComponent"/>
</Feature>
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="CompanyFolder" Name="New Relic">
<Directory Id="AgentBinaryFolder" Name="newrelic-infra">
<Directory Id="PluginConfigsFolder" Name="integrations.d"/>
<Directory Id="CustomPluginsFolder" Name="newrelic-integrations">
<Directory Id="CustomPluginsBinFolder" Name="bin"/>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>

<Fragment>
<DirectoryRef Id="PluginConfigsFolder">
<Component Id="CMP_V1_PLUGIN_CONFIGS" Guid="803C978C-B2A1-47C7-BB17-A2DE9E6D3145" KeyPath="yes">
<CreateFolder/>
</Component>
</DirectoryRef>
<DirectoryRef Id="CustomPluginsFolder">
<Component Id="CMP_V1_CUSTOM_PLUGINS" Guid="0EE4AAF4-9923-499C-A1D0-FF55B205A76C" KeyPath="yes">
<CreateFolder/>
</Component>
</DirectoryRef>
<DirectoryRef Id="CustomPluginsBinFolder">
<Component Id="CMP_V1_CUSTOM_PLUGINS_BIN" Guid="e4509a7a-409e-4a38-8705-37de9cf0d72d" KeyPath="yes">
<CreateFolder/>
</Component>
</DirectoryRef>
</Fragment>

<Fragment>
<ComponentGroup Id="CustomPluginsBinComponent" Directory="CustomPluginsBinFolder">
<Component Id="CMP_NRI_{IntegrationName}_EXE" Guid="ee588d29-c9d4-4e12-bb72-d26cad377588" Win64="yes">
<File Id="FILE_NRI_{IntegrationName}_EXE"
Source="$(var.BinariesPath){IntegrationExe}"
KeyPath="yes"/>
</Component>
</ComponentGroup>
<ComponentGroup Id="CustomPluginsComponent" Directory="CustomPluginsFolder">
<Component Id="CMP_NRI_{IntegrationName}_DEFINITION_YML" Guid="acc7e790-80c7-4960-834a-ffe12f369316" Win64="yes"
NeverOverwrite="yes" Permanent="yes">
<File Id="FILE_NRI_{IntegrationName}_DEFINITION_YML"
Name="{IntegrationName}-definition.yml"
Source="$(var.ProjectRootPath){IntegrationName}-win-definition.yml"
KeyPath="yes"/>
</Component>
</ComponentGroup>
<ComponentGroup Id="PluginConfigsComponent" Directory="PluginConfigsFolder">
<Component Id="CMP_NRI_{IntegrationName}_CONFIG_YML" Guid="cd9eb557-bbe7-4100-a9c1-a6274d77a9af" Win64="yes"
NeverOverwrite="yes" Permanent="yes">
<File Id="FILE_NRI_{IntegrationName}_CONFIG_YML"
Name="{IntegrationName}-config.yml.sample"
Source="$(var.ProjectRootPath){IntegrationName}-config.yml.sample"
KeyPath="yes"/>
</Component>
</ComponentGroup>
</Fragment>

</Wix>
41 changes: 41 additions & 0 deletions pkg/windows/nri-amd64-installer/nri-installer.wixproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.10</ProductVersion>
<ProjectGuid>3cbbb016-6054-4d00-bd1d-e735a349d8e7</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>$(integration)-amd64</OutputName>
<OutputType>Package</OutputType>
<SignToolPath>C:\Program Files (x86)\Windows Kits\10\bin\x64\</SignToolPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<Name>newrelic-$(integration)-installer</Name>
<DefineSolutionProperties>false</DefineSolutionProperties>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug;ProjectRootPath=..\..\..\;BinariesPath=..\..\..\target\bin\windows_amd64\</DefineConstants>
<SuppressAllWarnings>True</SuppressAllWarnings>
<Pedantic>False</Pedantic>
<CompilerAdditionalOptions>-arch x64</CompilerAdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug;ProjectRootPath=..\..\..\;BinariesPath=..\..\..\target\bin\windows_amd64\</DefineConstants>
<CompilerAdditionalOptions>-arch x64</CompilerAdditionalOptions>
</PropertyGroup>
<ItemGroup>
<Compile Include="Product.wxs"/>
</ItemGroup>
<Import Project="$(WixTargetsPath)"/>
<Target Name="SignInstaller">
<Exec Command="&quot;$(SignToolPath)signtool.exe&quot; sign /d &quot;New Relic Infrastructure Integration, $(integration)&quot; /a &quot;$(OutputPath)$(OutputName).msi&quot;"/>
<Copy SourceFiles="$(OutputPath)$(OutputName).msi" DestinationFiles="$(OutputPath)$(OutputName).x.y.z.msi"/>
<!-- <Delete Files="$(OutputPath)$(OutputName).msi" /> -->
</Target>
<Target Name="AfterBuild" DependsOnTargets="SignInstaller"/>
</Project>
3 changes: 2 additions & 1 deletion src/f5.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:generate goversioninfo
package main

import (
Expand All @@ -14,7 +15,7 @@ import (

const (
integrationName = "com.newrelic.f5"
integrationVersion = "2.0.0"
integrationVersion = "2.0.2"
)

var (
Expand Down
44 changes: 44 additions & 0 deletions versioninfo.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"FixedFileInfo":
{
"FileVersion": {
"Major": {MajorVersion},
"Minor": {MinorVersion},
"Patch": {PatchVersion},
"Build": {BuildVersion}
},
"ProductVersion": {
"Major": {MajorVersion},
"Minor": {MinorVersion},
"Patch": {PatchVersion},
"Build": {BuildVersion}
},
"FileFlagsMask": "3f",
"FileFlags ": "00",
"FileOS": "040004",
"FileType": "01",
"FileSubType": "00"
},
"StringFileInfo":
{
"Comments": "(c) {Year} New Relic, Inc.",
"CompanyName": "New Relic, Inc.",
"FileDescription": "",
"FileVersion": "{MajorVersion}.{MinorVersion}.{PatchVersion}.{BuildVersion}",
"InternalName": "{Integration}",
"LegalCopyright": "(c) {Year} New Relic, Inc.",
"LegalTrademarks": "",
"OriginalFilename": "{IntegrationExe}",
"PrivateBuild": "",
"ProductName": "New Relic Infrastructure Integration, {Integration}",
"ProductVersion": "{MajorVersion}.{MinorVersion}.{PatchVersion}.{BuildVersion}",
"SpecialBuild": ""
},
"VarFileInfo":
{
"Translation": {
"LangID": "0409",
"CharsetID": "04B0"
}
}
}
Loading

0 comments on commit 447ba2b

Please sign in to comment.