Skip to content

Commit 8121237

Browse files
committed
Cleanup
Signed-off-by: Dave Thaler <[email protected]>
1 parent b1a36e2 commit 8121237

File tree

6 files changed

+9
-76
lines changed

6 files changed

+9
-76
lines changed

.github/workflows/reusable-build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@ jobs:
155155
env:
156156
SOURCE_DIR: ${{github.workspace}}
157157
run: |
158-
${{github.workspace}}/scripts/create_package_data.bat
158+
${{github.workspace}}/scripts/create_package_data.bat ${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}}
159159
160160
- name: Generate the MSI release package
161161
if: matrix.configurations == 'Release' && inputs.generate_release_package == true
162162
working-directory: ${{env.GITHUB_WORKSPACE}}
163163
run: |
164-
cmake -S packaging -B package -DEBPFFORWINDOWS_PROGRAM_DATA="${{github.workspace}}\${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}}\package_data" "-DEBPFFORWINDOWS_VERSION=0.2.0" -DCPACK_GENERATOR=WIX
165-
cmake --build package --target package
164+
cmake -S tools\setup -B package -DEBPFFORWINDOWS_PROGRAM_DATA="${{github.workspace}}\${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}}\package_data" "-DEBPFFORWINDOWS_VERSION=0.2.0" -DCPACK_GENERATOR=WIX
165+
cmake --build build\setup --target package
166166
167167
- name: Locate the packages
168168
if: matrix.configurations == 'Release' && inputs.generate_release_package == true

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
/**/*_s.c
4444
/**/HelloWorld
4545
docs/html
46-
package
4746

4847
# Generated version files.
4948
.version/**/*

scripts/deploy-ebpf.ps1

+1-10
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ $build_directory=".\x64\Debug"
99
[System.Collections.ArrayList]$msi_files=@(
1010
"..\..\build\setup\ebpf-for-windows-0.2.0.msi")
1111

12-
[System.Collections.ArrayList]$setup_files=@(
13-
"..\..\build\setup\ebpf-for-windows-0.2.0.exe")
14-
1512
# The following files should be installed on all platforms.
1613
[System.Collections.ArrayList]$runtime_files=@(
1714
"bpftool.exe",
@@ -172,13 +169,12 @@ OVERVIEW:
172169
173170
Copies eBPF framework files into a temp directory on the local machine or into a VM
174171
175-
$ deploy-ebpf [-h] [-l] [-m] [-s] [-t] [--vm="..."]
172+
$ deploy-ebpf [-h] [-l] [-m] [-t] [--vm="..."]
176173
177174
OPTIONS:
178175
-h, --help Print this help message.
179176
-m, --msi Copies MSI instead of individual files
180177
-l, --local Copies files to the local temp directory instead of into a VM
181-
-s, --setup Copies setup EXE instead of individual files
182178
-t, --test Includes files needed only for testing and debugging
183179
--vm Specifies the VM name, which defaults to "Windows 10 dev environment"
184180
@@ -200,11 +196,6 @@ OPTIONS:
200196
$built_files= $msi_files
201197
break
202198
}
203-
{ @("-s", "--setup") -contains $_ }
204-
{
205-
$built_files= $setup_files
206-
break
207-
}
208199
{ @("-t", "--test") -contains $_ }
209200
{
210201
$built_files= $runtime_files + $test_files

scripts/install_ebpf.psm1

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function Unregister-eBPFComponents
4040

4141
function Register-eBPFComponents
4242
{
43-
# Uinstall previous installations (if any).
43+
# Uninstall previous installations (if any).
4444
Unregister-eBPFComponents
4545

4646
# Install drivers.
@@ -127,4 +127,4 @@ function Stop-eBPFComponents
127127
$EbpfDrivers.GetEnumerator() | ForEach-Object {
128128
Stop-Service $_.Name -ErrorAction Ignore 2>&1 | Write-Log
129129
}
130-
}
130+
}

tools/setup/CMakeLists.txt

-21
Original file line numberDiff line numberDiff line change
@@ -133,27 +133,6 @@ elseif(CPACK_GENERATOR STREQUAL "NuGet")
133133
set(CPACK_NUGET_PACKAGE_DESCRIPTION_SUMMARY "${CPACK_NUGET_PACKAGE_DESCRIPTION}")
134134
set(CPACK_NUGET_PACKAGE_RELEASE_NOTES "${CPACK_PACKAGE_HOMEPAGE_URL}/releases/tag/${CPACK_PACKAGE_VERSION}")
135135
set(CPACK_NUGET_PACKAGE_TAGS "ebpf bpf windows")
136-
137-
elseif(CPACK_GENERATOR STREQUAL "NSIS")
138-
set(CPACK_NSIS_DISPLAY_NAME "eBPF for Windows")
139-
set(CPACK_NSIS_URL_INFO_ABOUT "https://github.com/microsoft/ebpf-for-windows#readme")
140-
list (APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait 'sc create EbpfCore type=kernel start=demand binpath=%windir%\\system32\\drivers\\ebpfcore.sys'")
141-
list (APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait 'sc create NetEbpfExt type=kernel start=demand binpath=%windir%\\system32\\drivers\\netebpfext.sys'")
142-
list (APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '%windir%\\system32\\ebpfsvc.exe install'")
143-
list (APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait 'netsh add helper ebpfnetsh.dll'")
144-
list (APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait 'sc start EbpfCore'")
145-
list (APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait 'sc start NetEbpfExt'")
146-
list (APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait 'sc start ebpfsvc'")
147-
string (REPLACE ";" "\n" CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}")
148-
list (APPEND CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "ExecWait 'netsh del helper ebpfnetsh.dll'")
149-
list (APPEND CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "ExecWait 'sc stop ebpfsvc'")
150-
list (APPEND CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "ExecWait 'sc stop NetEbpfExt'")
151-
list (APPEND CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "ExecWait 'sc stop EbpfCore'")
152-
list (APPEND CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "ExecWait 'sc delete ebpfsvc'")
153-
list (APPEND CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "ExecWait 'sc delete NetEbpfExt'")
154-
list (APPEND CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "ExecWait 'sc delete EbpfCore'")
155-
string (REPLACE ";" "\n" CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}")
156-
157136
endif()
158137

159138
include(CPack)

tools/setup/drivers.xml

+3-39
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
Execute must be "rollback" for rollback, and "deferred" for everything else.
1616
-->
1717

18-
<!-- EbpfCore.sys create service -->
18+
<!-- EbpfCore.sys -->
1919

2020
<SetProperty Id="Create_EbpfCore" Before="InstallInitialize" Sequence="execute"
2121
Value='"[WindowsFolder]System32\sc.exe" create EbpfCore type=kernel start=demand binpath="[ProgramFiles64Folder]ebpf-for-windows\drivers\EbpfCore.sys"' />
@@ -47,7 +47,7 @@
4747
<CustomAction Id="Stop_EbpfCore" BinaryKey="WixCA" DllEntry="WixQuietExec"
4848
Execute="deferred" Impersonate='no' Return="ignore" />
4949

50-
<!-- NetEbpfExt.sys create service -->
50+
<!-- NetEbpfExt.sys -->
5151

5252
<SetProperty Id="Create_NetEbpfExt" Before="InstallInitialize" Sequence="execute"
5353
Value='"[WindowsFolder]System32\sc.exe" create NetEbpfExt type=kernel start=demand binpath="[ProgramFiles64Folder]ebpf-for-windows\drivers\netebpfext.sys"' />
@@ -79,7 +79,7 @@
7979
<CustomAction Id="Stop_NetEbpfExt" BinaryKey="WixCA" DllEntry="WixQuietExec"
8080
Execute="deferred" Impersonate='no' Return="ignore" />
8181

82-
<!-- EbpfSvc.exe create service -->
82+
<!-- EbpfSvc.exe -->
8383

8484
<SetProperty Id="Create_EbpfSvc" Before="InstallInitialize" Sequence="execute"
8585
Value='"[ProgramFiles64Folder]ebpf-for-windows\ebpfsvc.exe" install' />
@@ -111,33 +111,6 @@
111111
<CustomAction Id="Stop_EbpfSvc" BinaryKey="WixCA" DllEntry="WixQuietExec"
112112
Execute="deferred" Impersonate='no' Return="ignore" />
113113

114-
<!-- EbpfNetsh.dll -->
115-
116-
<SetProperty Id="Copy_EbpfNetsh" Before="InstallInitialize" Sequence="execute"
117-
Value='"[WindowsFolder]System32\xcopy.exe" "[ProgramFiles64Folder]ebpf-for-windows\ebpfnetsh.dll" "[WindowsFolder]System32"' />
118-
<CustomAction Id="Copy_EbpfNetsh" BinaryKey="WixCA" DllEntry="WixQuietExec"
119-
Execute="deferred" Impersonate='no' Return="check" />
120-
121-
<SetProperty Id="Dir_EbpfNetsh" Before="InstallInitialize" Sequence="execute"
122-
Value='"[WindowsFolder]System32\where.exe" ebpfnetsh.dll"' />
123-
<CustomAction Id="Dir_EbpfNetsh" BinaryKey="WixCA" DllEntry="WixQuietExec"
124-
Execute="deferred" Impersonate='no' Return="check" />
125-
126-
<SetProperty Id="Add_EbpfNetsh" Before="InstallInitialize" Sequence="execute"
127-
Value='"[WindowsFolder]System32\netsh.exe" add helper ebpfnetsh.dll' />
128-
<CustomAction Id="Add_EbpfNetsh" BinaryKey="WixCA" DllEntry="WixQuietExec"
129-
Execute="deferred" Impersonate='no' Return="check" />
130-
131-
<SetProperty Id="Cleanup_EbpfNetsh" Before="InstallInitialize" Sequence="execute"
132-
Value='erase "[WindowsFolder]System32\ebpfnetsh.dll"' />
133-
<CustomAction Id="Cleanup_EbpfNetsh" BinaryKey="WixCA" DllEntry="WixQuietExec"
134-
Execute="deferred" Impersonate='no' Return="ignore" />
135-
136-
<SetProperty Id="Delete_EbpfNetsh" Before="InstallInitialize" Sequence="execute"
137-
Value='"[WindowsFolder]System32\netsh.exe" del helper ebpfnetsh.dll' />
138-
<CustomAction Id="Delete_EbpfNetsh" BinaryKey="WixCA" DllEntry="WixQuietExec"
139-
Execute="deferred" Impersonate='no' Return="ignore" />
140-
141114
<!-- Now we configure the order in which the above need to execute. -->
142115
<InstallExecuteSequence>
143116
<!-- Rollback actions MUST be listed first. -->
@@ -156,19 +129,10 @@
156129
<Custom Action="Create_EbpfSvc" After="Start_NetEbpfExt">NOT Installed</Custom>
157130
<Custom Action="Start_EbpfSvc" After="Create_EbpfSvc">NOT Installed</Custom>
158131

159-
<!---
160-
<Custom Action="Copy_EbpfNetsh" After="Start_EbpfSvc">NOT Installed</Custom>
161-
<Custom Action="Dir_EbpfNetsh" After="Copy_EbpfNetsh">NOT Installed</Custom>
162-
<Custom Action="Add_EbpfNetsh" After="Dir_EbpfNetsh">NOT Installed</Custom>
163-
-->
164-
165132
<!-- Finally any uninstall actions. -->
166133
<Custom Action="Stop_EbpfSvc" After="RemoveRegistryValues">Installed</Custom>
167134
<Custom Action="Stop_NetEbpfExt" After="RemoveRegistryValues">Installed</Custom>
168135
<Custom Action="Stop_EbpfCore" After="RemoveRegistryValues">Installed</Custom>
169-
<!--
170-
<Custom Action="Delete_EbpfNetsh" After="RemoveRegistryValues">Installed</Custom>
171-
-->
172136
<Custom Action="Delete_EbpfSvc" After="RemoveRegistryValues">Installed</Custom>
173137
<Custom Action="Delete_EbpfCore" After="RemoveRegistryValues">Installed</Custom>
174138
<Custom Action="Delete_NetEbpfExt" After="RemoveRegistryValues">Installed</Custom>

0 commit comments

Comments
 (0)