mirror of
https://github.com/fleetdm/fleet
synced 2026-05-16 13:38:43 +00:00
for: - https://github.com/fleetdm/fleet/issues/18314 - https://github.com/fleetdm/fleet/issues/18315 - https://github.com/fleetdm/fleet/issues/18317 - https://github.com/fleetdm/fleet/issues/18316 # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [x] Added/updated tests - [x] Manual QA for all new/changed functionality
14 lines
700 B
PowerShell
14 lines
700 B
PowerShell
$exeFilePath = "$INSTALLER_PATH"
|
|
|
|
# extract the name of the executable to use as the sub-directory name
|
|
$exeName = [System.IO.Path]::GetFileName($exeFilePath)
|
|
$subDir = [System.IO.Path]::GetFileNameWithoutExtension($exeFilePath)
|
|
|
|
# determine the correct Program Files directory based on OS architecture
|
|
$destinationPath = Join-Path -Path $env:ProgramFiles -ChildPath $subDir
|
|
$destinationExePath = Join-Path -Path $destinationPath -ChildPath $exeName
|
|
|
|
# remove only the exe file, while at runtime other files could have been
|
|
# created in this folder, this is a naive approach to prevent forcing us to
|
|
# remove important folders by crafting a malicious file name.
|
|
Remove-Item -Path $destinationExePath
|