Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orbit for Windows ARM64 #27882

Merged
merged 34 commits into from
Apr 11, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
eb989ad
Begin work on windows arm64. fleet/desktop compile
dantecatalfamo Apr 3, 2025
a506b46
Start working on build and update mechanisms
dantecatalfamo Apr 4, 2025
a5037e4
Download win arm osquery to the right place
dantecatalfamo Apr 4, 2025
324661e
More work on supporting arm
dantecatalfamo Apr 4, 2025
fefd2ba
Add goreleaseer link, output msi with arch extension
dantecatalfamo Apr 4, 2025
2c89156
Almost successful round trip with local TUF, more WiX work required
dantecatalfamo Apr 4, 2025
df0d549
Get fleetctl package build working locally
dantecatalfamo Apr 7, 2025
0677ed6
Don't rename amd64 installer output
dantecatalfamo Apr 7, 2025
3ec1d7a
Merge branch 'main' into 27275-windows-arm64
dantecatalfamo Apr 7, 2025
db2a3de
Try getting goreleaser to run for new orbit target
dantecatalfamo Apr 7, 2025
791ec9f
Use full arm osquery for windows arm64
dantecatalfamo Apr 8, 2025
511f6ad
Fix syso test
dantecatalfamo Apr 8, 2025
5f6e8a4
Attempt to update releaser scripts, needs to be tested
dantecatalfamo Apr 8, 2025
bfcc7bb
Add changes/
dantecatalfamo Apr 8, 2025
c7e38ec
Add help text about ARM for windows and linux agent
dantecatalfamo Apr 9, 2025
451312b
Fix indentation in yaml
lucasmrod Apr 9, 2025
b56025c
Fix bash
lucasmrod Apr 9, 2025
439284d
Change v1 to v8.0 for windows arm
lucasmrod Apr 9, 2025
2049591
Linter fixeroni
dantecatalfamo Apr 9, 2025
253dd09
Try creating generate osqueryd for windows-arm64
dantecatalfamo Apr 9, 2025
1be1717
Label executable as arm64
dantecatalfamo Apr 9, 2025
ee0ff70
js test
dantecatalfamo Apr 9, 2025
23de376
Correct shell, linting
dantecatalfamo Apr 9, 2025
f5ef575
Add orbit/changes
dantecatalfamo Apr 9, 2025
ae29dd2
Don't include version number in arm msi package
dantecatalfamo Apr 10, 2025
2796692
Changes changes
dantecatalfamo Apr 10, 2025
ae5d97a
Attempt code signing 1st try
dantecatalfamo Apr 10, 2025
21ff74e
arm64 code sign
dantecatalfamo Apr 10, 2025
eab0b6d
Orbit is just called orbit
dantecatalfamo Apr 10, 2025
2c29281
Merge branch 'main' into 27275-windows-arm64
dantecatalfamo Apr 10, 2025
46b127c
Code sign desktop-windows-arm64
dantecatalfamo Apr 10, 2025
07df70e
Arm64 executable separate
dantecatalfamo Apr 10, 2025
84d6003
Contents read permission
dantecatalfamo Apr 10, 2025
b35ce00
Whitespace change
dantecatalfamo Apr 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 35 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ endif
.help-long--build:
@echo "Builds the specified binaries (defaults to building fleet and fleetctl)"
.help-usage--build:
@echo "$(TOOL_CMD) build [binaries] [options]"
@echo "$(TOOL_CMD) build [binaries] [options]"
.help-options--build:
@echo "GO_BUILD_RACE_ENABLED"
@echo "Turn on data race detection when building"
Expand Down Expand Up @@ -142,7 +142,7 @@ lint-go:
.help-long--lint:
@echo "Runs the linters for Go and Javascript code. If linter type is not specified, all linters will be run."
.help-usage--lint:
@echo "$(TOOL_CMD) lint [linter-type]"
@echo "$(TOOL_CMD) lint [linter-type]"
.help-extra--lint:
@echo "AVAILABLE LINTERS:"
@echo " go Lint Go files with golangci-lint"
Expand All @@ -165,13 +165,13 @@ dump-test-schema: test-schema
# PKG_TO_TEST: Go packages to test, e.g. "server/datastore/mysql". Separate multiple packages with spaces.
# TESTS_TO_RUN: Name specific tests to run in the specified packages. Leave blank to run all tests in the specified packages.
# GO_TEST_EXTRA_FLAGS: Used to specify other arguments to `go test`.
# GO_TEST_MAKE_FLAGS: Internal var used by other targets to add arguments to `go test`.
# GO_TEST_MAKE_FLAGS: Internal var used by other targets to add arguments to `go test`.
PKG_TO_TEST := ""
go_test_pkg_to_test := $(addprefix ./,$(PKG_TO_TEST)) # set paths for packages to test
dlv_test_pkg_to_test := $(addprefix github.com/fleetdm/fleet/v4/,$(PKG_TO_TEST)) # set URIs for packages to debug
.run-go-tests:
ifeq ($(PKG_TO_TEST), "")
@echo "Please specify one or more packages to test. See '$(TOOL_CMD) help run-go-tests' for more info.";
@echo "Please specify one or more packages to test. See '$(TOOL_CMD) help run-go-tests' for more info.";
else
@echo Running Go tests with command:
go test -tags full,fts5,netgo -run=${TESTS_TO_RUN} ${GO_TEST_MAKE_FLAGS} ${GO_TEST_EXTRA_FLAGS} -parallel 8 -coverprofile=coverage.txt -covermode=atomic -coverpkg=github.com/fleetdm/fleet/v4/... $(go_test_pkg_to_test)
Expand All @@ -182,7 +182,7 @@ endif
# DEBUG_TEST_EXTRA_FLAGS: Internal var used by other targets to add arguments to `dlv test`.
.debug-go-tests:
ifeq ($(PKG_TO_TEST), "")
@echo "Please specify one or more packages to debug. See '$(TOOL_CMD) help run-go-tests' for more info.";
@echo "Please specify one or more packages to debug. See '$(TOOL_CMD) help run-go-tests' for more info.";
else
@echo Debugging tests with command:
dlv test ${dlv_test_pkg_to_test} --api-version=2 --listen=127.0.0.1:61179 ${DEBUG_TEST_EXTRA_FLAGS} -- -test.v -test.run=${TESTS_TO_RUN} ${GO_TEST_EXTRA_FLAGS}
Expand Down Expand Up @@ -379,6 +379,8 @@ binary-bundle: xp-fleet xp-fleetctl
# Build orbit/fleetd fleetd_tables extension
fleetd-tables-windows:
GOOS=windows GOARCH=amd64 go build -o fleetd_tables_windows.exe ./orbit/cmd/fleetd_tables
fleetd-tables-windows-arm64:
GOOS=windows GOARCH=arm64 go build -o fleetd_tables_windows_arm64.exe ./orbit/cmd/fleetd_tables
fleetd-tables-linux:
GOOS=linux GOARCH=amd64 go build -o fleetd_tables_linux.ext ./orbit/cmd/fleetd_tables
fleetd-tables-linux-arm64:
Expand All @@ -389,7 +391,7 @@ fleetd-tables-darwin_arm64:
GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build -o fleetd_tables_darwin_arm64.ext ./orbit/cmd/fleetd_tables
fleetd-tables-darwin-universal: fleetd-tables-darwin fleetd-tables-darwin_arm64
lipo -create fleetd_tables_darwin.ext fleetd_tables_darwin_arm64.ext -output fleetd_tables_darwin_universal.ext
fleetd-tables-all: fleetd-tables-windows fleetd-tables-linux fleetd-tables-darwin-universal fleetd-tables-linux-arm64
fleetd-tables-all: fleetd-tables-windows fleetd-tables-linux fleetd-tables-darwin-universal fleetd-tables-linux-arm64 fleetd-tables-windows-arm64
fleetd-tables-clean:
rm -f fleetd_tables_windows.exe fleetd_tables_linux.ext fleetd_tables_linux_arm64.ext fleetd_tables_darwin.ext fleetd_tables_darwin_arm64.ext fleetd_tables_darwin_universal.ext

Expand Down Expand Up @@ -610,6 +612,19 @@ FLEET_DESKTOP_VERSION ?= unknown
desktop-windows:
go run ./orbit/tools/build/build-windows.go -version $(FLEET_DESKTOP_VERSION) -input ./orbit/cmd/desktop -output fleet-desktop.exe

# Build desktop executable for Windows.
# This generates desktop executable for Windows that includes versioninfo binary properties
# These properties can be displayed when right-click on the binary in Windows Explorer.
# See: https://docs.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource
# To sign this binary with a certificate, use signtool.exe or osslsigncode tool
#
# Usage:
# FLEET_DESKTOP_VERSION=0.0.1 make desktop-windows-arm64
#
# Output: fleet-desktop.exe
desktop-windows-arm64:
go run ./orbit/tools/build/build-windows.go -version $(FLEET_DESKTOP_VERSION) -input ./orbit/cmd/desktop -output fleet-desktop.exe -arch arm64

# Build desktop executable for Linux.
#
# Usage:
Expand Down Expand Up @@ -653,6 +668,19 @@ desktop-linux-arm64:
orbit-windows:
go run ./orbit/tools/build/build-windows.go -version $(ORBIT_VERSION) -input ./orbit/cmd/orbit -output orbit.exe

# Build orbit executable for Windows.
# This generates orbit executable for Windows that includes versioninfo binary properties
# These properties can be displayed when right-click on the binary in Windows Explorer.
# See: https://docs.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource
# To sign this binary with a certificate, use signtool.exe or osslsigncode tool
#
# Usage:
# ORBIT_VERSION=0.0.1 make orbit-windows-arm64
#
# Output: orbit.exe
orbit-windows-arm64:
go run ./orbit/tools/build/build-windows.go -version $(ORBIT_VERSION) -input ./orbit/cmd/orbit -output orbit.exe -arch arm64

# db-replica-setup setups one main and one read replica MySQL instance for dev/testing.
# - Assumes the docker containers are already running (tools/mysql-replica-testing/docker-compose.yml)
# - MySQL instance listening on 3308 is the main instance.
Expand Down Expand Up @@ -682,4 +710,4 @@ db-replica-run: fleet
include ./tools/makefile-support/helpsystem-targets

foo:
@echo $(MAKECMDGOALS)
@echo $(MAKECMDGOALS)
5 changes: 3 additions & 2 deletions cmd/fleetctl/package.go
Copy link
Member

@lucasmrod lucasmrod Apr 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@noahtalerman @dantecatalfamo Should we add a note somewhere in the output that fleetctl package --type=msi --arch=arm64 [...] is experimental?

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func packageCommand() *cli.Command {
},
&cli.StringFlag{
Name: "arch",
Usage: "Target CPU Architecture for the installer package (Only supported with '--type' deb or rpm)",
Usage: "Target CPU Architecture for the installer package (Only supported with '--type' deb, rpm, or msi)",
Destination: &opt.Architecture,
Value: "amd64",
},
Expand Down Expand Up @@ -343,8 +343,9 @@ func packageCommand() *cli.Command {
case "deb", "rpm":
linuxPackage = true
}
windowsPackage := c.String("type") == "msi"

if opt.Architecture != packaging.ArchAmd64 && !linuxPackage {
if opt.Architecture != packaging.ArchAmd64 && !(linuxPackage || windowsPackage) {
return fmt.Errorf("can't use '--arch' with '--type %s'", c.String("type"))
}

Expand Down
2 changes: 1 addition & 1 deletion ee/fleetctl/updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func updatesAddFunc(c *cli.Context) error {
dstPath = filepath.Join(name, platform, tag, name)
}
switch {
case name == constant.DesktopTUFTargetName && platform == "windows":
case name == constant.DesktopTUFTargetName && (platform == "windows" || platform == "windows-arm64"):
// This is a special case for the desktop target on Windows.
dstPath = filepath.Join(filepath.Dir(dstPath), constant.DesktopAppExecName+".exe")
case name == constant.DesktopTUFTargetName && (platform == "linux" || platform == "linux-arm64"):
Expand Down
1 change: 1 addition & 0 deletions orbit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ For reference, here are the build configuration files:
- [goreleaser-linux-arm64.yml](./goreleaser-linux-arm64.yml)
- [goreleaser-macos.yml](./goreleaser-macos.yml)
- [goreleaser-windows.yml](./goreleaser-windows.yml)
- [goreleaser-windows.yml](./goreleaser-windows-arm64.yml)

Following are the commands to build in case you can't use goreleaser.

Expand Down
6 changes: 5 additions & 1 deletion orbit/cmd/orbit/orbit.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,11 @@ func main() {
case "darwin":
opt.Targets[constant.DesktopTUFTargetName] = update.DesktopMacOSTarget
case "windows":
opt.Targets[constant.DesktopTUFTargetName] = update.DesktopWindowsTarget
if runtime.GOARCH == "arm64" {
opt.Targets[constant.DesktopTUFTargetName] = update.DesktopWindowsArm64Target
} else {
opt.Targets[constant.DesktopTUFTargetName] = update.DesktopWindowsTarget
}
case "linux":
if runtime.GOARCH == "arm64" {
opt.Targets[constant.DesktopTUFTargetName] = update.DesktopLinuxArm64Target
Expand Down
44 changes: 44 additions & 0 deletions orbit/goreleaser-windows-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: 2

project_name: orbit

#################################################################################################
# If this is updated make sure to update the "How to build from source" section in the README.md.
#################################################################################################

builds:
- id: orbit
dir: ./orbit/cmd/orbit/
binary: orbit
env:
- CGO_ENABLED=0
goos:
- windows
goarch:
- arm64
flags:
- -trimpath
ldflags:
- -X github.com/fleetdm/fleet/v4/orbit/pkg/build.Version={{.Version}}
- -X github.com/fleetdm/fleet/v4/orbit/pkg/build.Commit={{.Commit}}
- -X github.com/fleetdm/fleet/v4/orbit/pkg/build.Date={{.Date}}
hooks:
pre: "go run ./orbit/tools/build/build-windows.go -version {{.Version}} -input ./orbit/cmd/orbit -resource=true -arch arm64"

archives:
- id: orbit
builds:
- orbit
name_template: orbit_{{.Version}}_{{.Os}}
format_overrides:
- goos: windows
format: zip

checksum:
name_template: 'checksums.txt'

snapshot:
version_template: "{{ .Tag }}-untagged"

changelog:
disable: true
26 changes: 18 additions & 8 deletions orbit/pkg/packaging/windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"golang.org/x/mod/semver"
)

const wixDownload = "https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip"
const wixDownload = "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip"

// BuildMSI builds a Windows .msi.
// Note: this function is not safe for concurrent use
Expand All @@ -52,7 +52,11 @@ func BuildMSI(opt Options) (string, error) {
updateOpt := update.DefaultOptions

updateOpt.RootDirectory = orbitRoot
updateOpt.Targets = update.WindowsTargets
if opt.Architecture == ArchAmd64 {
updateOpt.Targets = update.WindowsTargets
} else {
updateOpt.Targets = update.WindowsArm64Targets
}
updateOpt.ServerCertificatePath = opt.UpdateTLSServerCertificate

if opt.UpdateTLSClientCertificate != "" {
Expand All @@ -64,7 +68,11 @@ func BuildMSI(opt Options) (string, error) {
}

if opt.Desktop {
updateOpt.Targets[constant.DesktopTUFTargetName] = update.DesktopWindowsTarget
if opt.Architecture == ArchArm64 {
updateOpt.Targets[constant.DesktopTUFTargetName] = update.DesktopWindowsArm64Target
} else {
updateOpt.Targets[constant.DesktopTUFTargetName] = update.DesktopWindowsTarget
}
// Override default channel with the provided value.
updateOpt.Targets.SetTargetChannel(constant.DesktopTUFTargetName, opt.DesktopChannel)
}
Expand Down Expand Up @@ -206,15 +214,15 @@ func BuildMSI(opt Options) (string, error) {
return "", fmt.Errorf("transform heat: %w", err)
}

if err := wix.Candle(tmpDir, opt.NativeTooling, absWixDir); err != nil {
if err := wix.Candle(tmpDir, opt.NativeTooling, absWixDir, opt.Architecture); err != nil {
return "", fmt.Errorf("build package: %w", err)
}

if err := wix.Light(tmpDir, opt.NativeTooling, absWixDir); err != nil {
return "", fmt.Errorf("build package: %w", err)
}

filename := "fleet-osquery.msi"
filename := fmt.Sprintf("fleet-osquery_%s_%s.msi", opt.Version, opt.Architecture)
Copy link
Member

@lucasmrod lucasmrod Apr 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep the amd64 one the same name (without prefix).
To not break customer automations that are assuming the name of the output.

(And not add version for now until/if we decide to do it for pkg too.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems reasonable, I can save the new name format for the arm release only

if opt.NativeTooling {
filename = filepath.Join("build", filename)
}
Expand Down Expand Up @@ -299,13 +307,15 @@ func writePowershellInstallerUtilsFile(opt Options, rootPath string) error {

// writeManifestXML creates the manifest.xml file used when generating the 'resource_windows.syso' metadata
// (see writeResourceSyso). Returns the path of the newly created file.
func writeManifestXML(vParts []string, orbitPath string) (string, error) {
func writeManifestXML(vParts []string, orbitPath string, arch string) (string, error) {
filePath := filepath.Join(orbitPath, "manifest.xml")

tmplOpts := struct {
Version string
Arch string
}{
Version: strings.Join(vParts, "."),
Arch: arch,
}

var contents bytes.Buffer
Expand Down Expand Up @@ -429,7 +439,7 @@ func writeResourceSyso(opt Options, orbitPath string) error {
return fmt.Errorf("invalid version %s: %w", opt.Version, err)
}

manifestPath, err := writeManifestXML(vParts, orbitPath)
manifestPath, err := writeManifestXML(vParts, orbitPath, opt.Architecture)
if err != nil {
return fmt.Errorf("creating manifest.xml: %w", err)
}
Expand All @@ -444,7 +454,7 @@ func writeResourceSyso(opt Options, orbitPath string) error {
vi.Walk()

outPath := filepath.Join(orbitPath, "resource_windows.syso")
if err := vi.WriteSyso(outPath, "amd64"); err != nil {
if err := vi.WriteSyso(outPath, opt.Architecture); err != nil {
return fmt.Errorf("creating syso file: %w", err)
}

Expand Down
3 changes: 2 additions & 1 deletion orbit/pkg/packaging/windows_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ var ManifestXMLTemplate = template.Must(template.New("").Option("missingkey=erro
type="win32"
name="Fleet osquery"
version="{{.Version}}"
processorArchitecture="*"/>
processorArchitecture="{{.Arch}}"
/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
Expand Down
10 changes: 8 additions & 2 deletions orbit/pkg/packaging/wix/wix.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func darwinWineExecutable() (string, error) {
//
// See
// https://wixtoolset.org/documentation/manual/v3/overview/candle.html.
func Candle(path string, native bool, localWixDir string) error {
func Candle(path string, native bool, localWixDir string, arch string) error {
var args []string

if !native && localWixDir == "" {
Expand All @@ -124,10 +124,16 @@ func Candle(path string, native bool, localWixDir string) error {
args = append(args, wineExec)
}
}

wixArch := "x64"
if arch == "arm64" {
wixArch = "arm64"
}

args = append(args,
candlePath, "heat.wxs", "main.wxs", // command
"-ext", "WixUtilExtension",
"-arch", "x64",
"-arch", wixArch,
)

cmd := exec.Command(args[0], args[1:]...)
Expand Down
20 changes: 20 additions & 0 deletions orbit/pkg/update/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ var (
},
}

WindowsArm64Targets = Targets{
constant.OrbitTUFTargetName: TargetInfo{
Platform: "windows-arm64",
Channel: "stable",
TargetFile: "orbit.exe",
},
// NOTE: Currently osquery doesn't fully support ARM64, continue to use the x86 version for now
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am curious does the Windows arm64 provided in the Github releases not work?

Copy link
Member Author

@dantecatalfamo dantecatalfamo Apr 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Lucas! So I'm still a little uncertain about osquery's windows ARM support. They don't have build instructions on their website and I've tried my best to build it locally but failed. This isn't a total dealbreaker but it means that we cannot submit bug fixes upstream if we find an issue with it for the time being. I've also noticed that it doesn't return the cpu_type from the system_info table, so I'm not sure what else might behave differently. I would probably suggest someone run a full test suite against it to figure out if anything else behaves weirdly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest discussing it with the product team. Maybe we can release fleetd for Windows ARM64 as beta/alpha (to get gears moving).

Copy link
Member

@lucasmrod lucasmrod Apr 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Because the user/customer requesting this wanted to avoid emulation.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this release is going to be a "newly supported" platform, I could also just use it and we mark it as experimental

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@noahtalerman Do you have any input on this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucasmrod One problem I've noticed with the ARM version of osquery is that it doesn't report the processor information at all. I'm also not able to debug the issue because I can't compile it locally though.

constant.OsqueryTUFTargetName: TargetInfo{
Platform: "windows",
Channel: "stable",
TargetFile: "osqueryd.exe",
},
}

WindowsTargets = Targets{
constant.OrbitTUFTargetName: TargetInfo{
Platform: "windows",
Expand All @@ -80,6 +94,12 @@ var (
TargetFile: constant.DesktopAppExecName + ".exe",
}

DesktopWindowsArm64Target = TargetInfo{
Platform: "windows-arm64",
Channel: "stable",
TargetFile: constant.DesktopAppExecName + ".exe",
}

DesktopLinuxTarget = TargetInfo{
Platform: "linux",
Channel: "stable",
Expand Down
24 changes: 24 additions & 0 deletions orbit/pkg/update/options_windows_arm64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package update

import (
"os"
"path/filepath"

"github.com/theupdateframework/go-tuf/client"
)

var defaultOptions = Options{
RootDirectory: `C:\Program Files\Orbit`,
ServerURL: DefaultURL,
RootKeys: defaultRootMetadata,
LocalStore: client.MemoryLocalStore(),
InsecureTransport: false,
Targets: WindowsArm64Targets,
}

func init() {
// Set root directory to value of ProgramFiles environment variable if not set
if dir := os.Getenv("ProgramFiles"); dir != "" {
DefaultOptions.RootDirectory = filepath.Join(dir, "Orbit")
}
}
Loading
Loading