Skip to content

Commit 47aaf0c

Browse files
author
Steve Salas
committed
Removes nested installer
1 parent 7dc056f commit 47aaf0c

File tree

13 files changed

+199
-101
lines changed

13 files changed

+199
-101
lines changed

appveyor.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 1.2.{build}
22
image: Visual Studio 2017
33
clone_folder: C:\CodePulse
44
build_script:
5-
- cmd: powershell -file C:\CodePulse\installers\build.ps1 -version %APPVEYOR_BUILD_VERSION%
5+
- cmd: powershell -file C:\CodePulse\installers\build.ps1 -version %APPVEYOR_BUILD_VERSION% -versionForDotNetTracerWindowsDownloadUrl %APPVEYOR_JOB_ID%
66
before_test:
77
- cmd: >-
88
C:\Windows\System32\regsvr32.exe C:\CodePulse\dotnet-tracer\main\bin\Release\x64\OpenCover.Profiler.dll /s
@@ -30,5 +30,11 @@ after_test:
3030
3131
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", "C:\CodePulse\OpenCover.Test.Profiler.x64.xml")
3232
artifacts:
33-
- path: installers\Windows\CodePulse.Installer.Win64\bin\Release\CodePulse.Win64.msi
34-
name: CodePulse.Win64.msi (Release)
33+
- path: installers\CodePulse-$(APPVEYOR_BUILD_VERSION)-Linux-x64.zip
34+
name: Code Pulse Linux
35+
- path: installers\CodePulse-$(APPVEYOR_BUILD_VERSION)-macOS-x64.zip
36+
name: Code Pulse Mac
37+
- path: installers\CodePulse-$(APPVEYOR_BUILD_VERSION)-Windows-x64.zip
38+
name: Code Pulse Windows
39+
- path: installers\CodePulse-DotNetTracer-$(APPVEYOR_BUILD_VERSION)-Windows.zip
40+
name: Code Pulse .NET Tracer

installers/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ ASALocalRun/
324324

325325

326326
CodePulse-*-*.zip
327+
/DotNet-Tracer/Files
327328
/Windows/Files
328329
/macOS/Files
329330
/Linux/Files

installers/DotNet-Tracer/build.ps1

Lines changed: 93 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
# This script creates the Windows Code Pulse .NET Tracer package
33
#
44
param (
5-
[switch] $skipBuildInit,
6-
[switch] $skipTests,
7-
$version='1.0.0.0'
5+
[switch] $skipBuildInit=$true,
6+
[switch] $skipTests=$true,
7+
[switch] $signOutput,
8+
[string] $dotNetTracerWindowsDownloadUrl,
9+
[string] $version='1.0.0'
810
)
911

1012
Set-PSDebug -Strict
@@ -15,6 +17,30 @@ Push-Location $PSScriptRoot
1517

1618
. ..\Scripts\common.ps1
1719

20+
$filesFolderPath = join-path $PSScriptRoot 'Files\codepulse'
21+
$filesDownloadFolderPath = join-path $PSScriptRoot 'Files\codepulse-download'
22+
$filesDownloadFolderImgPath = join-path $filesDownloadFolderPath 'img'
23+
24+
$filesFolderPath,$filesDownloadFolderPath,$filesDownloadFolderImgPath | % {
25+
if (test-path -PathType Container $_) {
26+
write-verbose "Removing folder $_..."
27+
Remove-Item -Path $_ -Recurse -Force
28+
}
29+
write-verbose "Creating folder $_..."
30+
New-Item -Path $_ -ItemType Directory | Out-Null
31+
}
32+
33+
$downloadPagePath = '.\download-files\CodePulse.DotNet.Tracer.Installer.html'
34+
35+
write-verbose 'Copying .NET Tracer download files...'
36+
copy-item $downloadPagePath $filesDownloadFolderPath
37+
copy-item '.\download-files\img\*.*' $filesDownloadFolderImgPath
38+
39+
$downloadPageDestinationPath = join-path $filesDownloadFolderPath 'CodePulse.DotNet.Tracer.Installer.html'
40+
41+
write-verbose "Editing $downloadPageDestinationPath for URL $dotNetTracerWindowsDownloadUrl..."
42+
Set-TextContent $downloadPageDestinationPath ((gc $downloadPagePath ) | % { $_ -replace 'DOWNLOAD_HREF',$dotNetTracerWindowsDownloadUrl })
43+
1844
if (-not (Test-MsBuild)) {
1945
exit 1
2046
}
@@ -84,6 +110,18 @@ if ($lastexitcode -ne 0) {
84110
exit $lastexitcode
85111
}
86112

113+
write-verbose "Restoring original '$assemblyInfoPath' contents..."
114+
Set-TextContent $assemblyInfoPath $assemblyInfo
115+
116+
write-verbose "Restoring original '$bundlePath' contents..."
117+
Set-TextContent $bundlePath $bundle
118+
119+
write-verbose "Restoring original '$product32Path' contents..."
120+
Set-TextContent $product32Path $product32
121+
122+
write-verbose "Restoring original '$product64Path' contents..."
123+
Set-TextContent $product64Path $product64
124+
87125
if (-not $skipTests) {
88126
write-verbose "Building CodePulse.Client.Test ($buildConfiguration)..."
89127
& $msbuildPath /p:Configuration=$buildConfiguration /p:SolutionDir=..\ CodePulse.Client.Test
@@ -112,16 +150,60 @@ if (-not $skipTests) {
112150
}
113151
}
114152

115-
write-verbose "Restoring original '$assemblyInfoPath' contents..."
116-
Set-TextContent $assemblyInfoPath $assemblyInfo
153+
if ($signOutput) {
117154

118-
write-verbose "Restoring original '$bundlePath' contents..."
119-
Set-TextContent $bundlePath $bundle
155+
$signingInstructions = @'
120156
121-
write-verbose "Restoring original '$product32Path' contents..."
122-
Set-TextContent $product32Path $product32
157+
Use signtool.exe and insignia.exe to sign CodePulse.DotNet.Tracer.Installer.exe:
123158
124-
write-verbose "Restoring original '$product64Path' contents..."
125-
Set-TextContent $product64Path $product64
159+
Step 1: Extract engine.exe from CodePulse.DotNet.Tracer.Installer.exe
160+
161+
"C:\Program Files (x86)\WiX Toolset v3.11\bin\insignia.exe" -ib CodePulse.DotNet.Tracer.Installer.exe -o engine.exe
162+
163+
164+
Step 2: Sign engine.exe
165+
166+
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86\signtool.exe" sign /v /f <path-to-pfx-file> /p <pfx-file-password> /t http://timestamp.verisign.com/scripts/timstamp.dll engine.exe
167+
168+
169+
Step 3: Reattach engine.exe to CodePulse.DotNet.Tracer.Installer.exe
170+
171+
"C:\Program Files (x86)\WiX Toolset v3.11\bin\insignia.exe" -ab engine.exe CodePulse.DotNet.Tracer.Installer.exe -o CodePulse.DotNet.Tracer.Installer.exe
172+
173+
174+
Step 4: Sign CodePulse.DotNet.Tracer.Installer.exe
175+
176+
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86\signtool.exe" sign /v /f <path-to-pfx-file> /p <pfx-file-password> /t http://timestamp.verisign.com/scripts/timstamp.dll CodePulse.DotNet.Tracer.Installer.exe
177+
178+
179+
Press Enter *after* you have signed the bundle...
180+
181+
'@
182+
Write-Host $signingInstructions; Read-Host
183+
184+
$bundlePath = join-path $dotNetTracerMainPath "CodePulse.Bundle\bin\$buildConfiguration\CodePulse.DotNet.Tracer.Installer.exe"
185+
186+
Write-Verbose 'Verifying that the bundle is signed...'
187+
signtool.exe verify /pa /tw $bundlePath
188+
if ($lastexitcode -ne 0) {
189+
Write-Verbose 'Cannot continue because the bundle is not signed.'
190+
exit $lastexitcode
191+
}
192+
}
193+
194+
write-verbose 'Removing extra installer file(s)...'
195+
$outputFolder = join-path (get-location) "CodePulse.Bundle\bin\$buildConfiguration"
196+
dir $outputFolder -Exclude CodePulse.DotNet.Tracer.Installer.exe | % { remove-item $_.FullName -Force }
197+
198+
write-verbose 'Copying bundle to Files\codepulse...'
199+
copy "CodePulse.Bundle\bin\$buildConfiguration\CodePulse.DotNet.Tracer.Installer.exe" $filesFolderPath
200+
201+
Invoke-CodePulseZip `
202+
$PSScriptRoot `
203+
'CodePulse-DotNetTracer' `
204+
'Windows' `
205+
$version `
206+
$zipFilePath `
207+
'Files\codepulse'
126208

127209
Pop-Location
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<html>
2+
<head>
3+
<title>Code Pulse .NET Tracer Installation</title>
4+
<style>
5+
body {
6+
font-family: Helvetica;
7+
text-align: center
8+
}
9+
10+
div {
11+
margin-top: 20px;
12+
}
13+
14+
button {
15+
border-radius: 25px;
16+
moz-border-radius: 25px;
17+
webkit-border-radius: 25px;
18+
height: 35px;
19+
width: 120px;
20+
border: 0;
21+
cursor: pointer;
22+
color: white;
23+
background-color: #555555
24+
}
25+
</style>
26+
</head>
27+
<body>
28+
<div>
29+
<a href="DOWNLOAD_HREF">
30+
<img src="./img/icon.png" alt="Code Pulse Icon" />
31+
</a>
32+
<div>
33+
<h3>Download the Code Pulse .NET Tracer Installer</h3>
34+
<button onclick="window.location.href='DOWNLOAD_HREF'">
35+
Download
36+
</button>
37+
</div>
38+
</div>
39+
</body>
40+
</html>
16.9 KB
Loading
4.74 KB
Loading

installers/Linux/build.ps1

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
# This script creates the Linux Code Pulse package
33
#
44
param (
5-
[switch] $forceTracerRebuild,
6-
$version='1.0.0.0',
7-
$releaseDate=([DateTime]::Now.ToShortDateString())
5+
[string] $version='1.0.0',
6+
[string] $releaseDate=([DateTime]::Now.ToShortDateString())
87
)
98

109
Set-PSDebug -Strict
@@ -15,13 +14,10 @@ Push-Location $PSScriptRoot
1514

1615
. ..\Scripts\common.ps1
1716

18-
if ($forceTracerRebuild -or (-not (Test-DotNetTracer $codePulsePath $buildConfiguration)))
17+
if (-not (Test-DotNetTracer $codePulsePath $buildConfiguration))
1918
{
20-
if (-not (Test-MsBuild)) {
21-
exit 1
22-
}
23-
24-
& "$codePulsePath\installers\DotNet-Tracer\build.ps1"
19+
Write-Error 'Code Pulse .NET Tracer does not exist. Run installers\dotnet-tracers\build.ps1 first'
20+
exit 1
2521
}
2622

2723
Invoke-CodePulsePackaging `
@@ -39,7 +35,7 @@ Invoke-CodePulsePackaging `
3935

4036
Invoke-CodePulseZip `
4137
$PSScriptRoot `
42-
'Linux' `
38+
'CodePulse' `
4339
'Linux-x64' `
4440
$version `
4541
$zipFilePath `

installers/Scripts/common.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ function Invoke-CodePulsePackaging(
4545
$filesFolderCodePulsePath = join-path $filesFolderPath 'codepulse'
4646
$filesFolderJavaTracerPath = join-path $filesFolderCodePulsePath 'tracers\java'
4747
$filesFolderDotNetTracerPath = join-path $filesFolderCodePulsePath 'tracers\dotnet'
48+
$filesFolderDotNetTracerImgPath = join-path $filesFolderDotNetTracerPath 'img'
4849

4950
New-Item -Path $filesFolderPath -ItemType Directory | Out-Null
5051
New-Item -Path $filesFolderJavaTracerPath -ItemType Directory | Out-Null
5152
New-Item -Path $filesFolderDotNetTracerPath -ItemType Directory | Out-Null
53+
New-Item -Path $filesFolderDotNetTracerImgPath -ItemType Directory | Out-Null
5254

5355
Push-Location $codePulsePath
5456

@@ -102,24 +104,25 @@ function Invoke-CodePulsePackaging(
102104

103105
Pop-Location; Push-Location $scriptRoot
104106

105-
write-verbose 'Copying .NET Tracer...'
106-
copy-item "..\..\dotnet-tracer\main\CodePulse.Bundle\bin\$buildConfiguration\CodePulse.DotNet.Tracer.Installer.exe" $filesFolderDotNetTracerPath
107+
write-verbose 'Copying .NET Tracer download files...'
108+
copy-item "..\DotNet-Tracer\Files\codepulse-download\CodePulse.DotNet.Tracer.Installer.html" $filesFolderDotNetTracerPath
109+
copy-item "..\DotNet-Tracer\Files\codepulse-download\img\*.*" $filesFolderDotNetTracerImgPath
107110

108111
Pop-Location
109112
}
110113

111114
function Invoke-CodePulseZip(
112115
[string] $scriptRoot,
113-
[string] $osName,
116+
[string] $packageName,
114117
[string] $osDescription,
115118
[string] $codePulseVersion,
116119
[string] $zipFilePath,
117120
[string] $scriptRootRelativePath)
118121
{
119122
Push-Location $scriptRoot
120123

121-
write-verbose "Zipping Code Pulse package ($osName)..."
122-
$outputFile = join-path $scriptRoot "..\CodePulse-$codePulseVersion-$osDescription.zip"
124+
write-verbose "Zipping Code Pulse package ($packageName-$codePulseVersion-$osDescription.zip)..."
125+
$outputFile = join-path $scriptRoot "..\$packageName-$codePulseVersion-$osDescription.zip"
123126
if (test-path $outputFile -Type Leaf) {
124127
write-verbose "Deleting outdated output file $outputFile"
125128
remove-item $outputFile -Force

installers/Windows/CodePulse.Installer.Win64/Win64CodePulse.wxs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,8 +861,8 @@
861861
<Component Id="cmp36050222B1DE60CD7DCE84B75E2E531C" Directory="dir4AA12460D3F5A5059B5F53D9A515C913" Guid="*">
862862
<File Id="fil4AB79B89690D573B2C7E608BBF1160D0" KeyPath="yes" Source="$(var.CodePulseWin64SourceFolder)\backend\webapps\root\WEB-INF\lib\cdi-api-2.0.jar" />
863863
</Component>
864-
<Component Id="cmpE73F6D3B74D9BB9744FEFFE3EC057D85" Directory="dir4AA12460D3F5A5059B5F53D9A515C913" Guid="*">
865-
<File Id="fil1735D604882FAD9EE4C652AD179EDB85" KeyPath="yes" Source="$(var.CodePulseWin64SourceFolder)\backend\webapps\root\WEB-INF\lib\CodePulse-2.0.0.0-webapp-classes.jar" />
864+
<Component Id="cmp7D456B59E13775B7716A849E679BBEBC" Directory="dir4AA12460D3F5A5059B5F53D9A515C913" Guid="*">
865+
<File Id="fil6856530236DA2D3E02B0BB78AC663B0E" KeyPath="yes" Source="$(var.CodePulseWin64SourceFolder)\backend\webapps\root\WEB-INF\lib\CodePulse-2.0.0-webapp-classes.jar" />
866866
</Component>
867867
<Component Id="cmp65EB9CA567BCE9D6B665546AF4D27735" Directory="dir4AA12460D3F5A5059B5F53D9A515C913" Guid="*">
868868
<File Id="fil30B8981337A059102AB200BF46B2AF2E" KeyPath="yes" Source="$(var.CodePulseWin64SourceFolder)\backend\webapps\root\WEB-INF\lib\commons-codec-1.6.jar" />

installers/Windows/CodePulse.Installer.Win64/Win64Tracers.wxs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@
88
</Fragment>
99
<Fragment>
1010
<ComponentGroup Id="Tracers">
11-
<Component Id="cmp5F4BF9F3FB3B12EB821F8409BC17873B" Directory="dir7415E8BC643AF6D21E1EB5173B15D68F" Guid="*">
12-
<File Id="fil89E8A6BE9DE5B06C2B965A94B8BC53E2" KeyPath="yes" Source="$(var.TracersWin64SourceFolder)\dotnet\CodePulse.DotNet.Tracer.Installer.exe" />
11+
<Component Id="cmpBC54D614809FFA8B0EA9918ACAEF8243" Directory="dir7415E8BC643AF6D21E1EB5173B15D68F" Guid="*">
12+
<File Id="fil5253A467A9E0FD3FD99E4D7005EC1E1C" KeyPath="yes" Source="$(var.TracersWin64SourceFolder)\dotnet\CodePulse.DotNet.Tracer.Installer.html" />
13+
</Component>
14+
<Component Id="cmpB1CDA33B9AF6A2BE1484F90221B6DCDC" Directory="dirD950C6731FD9FF9FABF8E19EA953FF38" Guid="*">
15+
<File Id="fil2FEEA9209CA27D068F28521FF90E7EC0" KeyPath="yes" Source="$(var.TracersWin64SourceFolder)\dotnet\img\CodePulse.DotNet.Tracer.Installer.Setup.png" />
16+
</Component>
17+
<Component Id="cmpFE3DDD1A3D976133F5B1C680ABEEE0FC" Directory="dirD950C6731FD9FF9FABF8E19EA953FF38" Guid="*">
18+
<File Id="fil57686115801872730A62BBDAB4D4110F" KeyPath="yes" Source="$(var.TracersWin64SourceFolder)\dotnet\img\icon.png" />
1319
</Component>
1420
<Component Id="cmp79DDE8B86EF01A8CA5C4972287965C4F" Directory="dirBD36B0B3BC81A30E46ED205BA3B8ECD2" Guid="*">
1521
<File Id="fil4F19EF22B82575CD1093661E44F432A4" KeyPath="yes" Source="$(var.TracersWin64SourceFolder)\java\agent.jar" />
@@ -26,4 +32,9 @@
2632
<Directory Id="dirBD36B0B3BC81A30E46ED205BA3B8ECD2" Name="java" />
2733
</DirectoryRef>
2834
</Fragment>
35+
<Fragment>
36+
<DirectoryRef Id="dir7415E8BC643AF6D21E1EB5173B15D68F">
37+
<Directory Id="dirD950C6731FD9FF9FABF8E19EA953FF38" Name="img" />
38+
</DirectoryRef>
39+
</Fragment>
2940
</Wix>

0 commit comments

Comments
 (0)