-
Notifications
You must be signed in to change notification settings - Fork 392
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
Match macOS software <-> titles using bundle identifier #19969
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this binary was created using this script:
#!/bin/bash
PACKAGE_ID="com.example.dummy"
PACKAGE_VERSION="1.0.0"
INSTALL_LOCATION="DummyApp.app"
TEMP_DIR=$(mktemp -d)
PAYLOAD_DIR="$TEMP_DIR/payload"
mkdir -p "$PAYLOAD_DIR"
pkgbuild --root "$PAYLOAD_DIR" --identifier "$PACKAGE_ID" --version "$PACKAGE_VERSION" "$TEMP_DIR/dummy.pkg"
DISTRIBUTION_XML="$TEMP_DIR/Distribution"
cat <<EOF > "$DISTRIBUTION_XML"
<?xml version="1.0" encoding="utf-8"?>
<installer-script minSpecVersion="1.0">
<title>Dummy Installer</title>
<choices-outline>
<line choice="default">
<line choice="dummy"/>
</line>
</choices-outline>
<choice id="default"/>
<pkg-ref id="$PACKAGE_ID" version="$PACKAGE_VERSION" auth="root">
<bundle-version>
<bundle CFBundleShortVersionString="$PACKAGE_VERSION" CFBundleVersion="$PACKAGE_VERSION" id="$PACKAGE_ID" path="$INSTALL_LOCATION"/>
</bundle-version>
</pkg-ref>
</installer-script>
EOF
productbuild --distribution "$DISTRIBUTION_XML" --resources "$TEMP_DIR" --package-path "$TEMP_DIR" "dummy_installer.pkg"
rm -rf "$TEMP_DIR"
echo "Dummy .pkg installer created: dummy_installer.pkg"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great (and I did manually test the fix for another ticket, worked perfectly)!
Only some questions where I was unsure about the handling of NULLs.
server/datastore/mysql/migrations/tables/20240703193943_AddBundleIdentifierToSoftwareTitles.go
Outdated
Show resolved
Hide resolved
server/datastore/mysql/migrations/tables/20240703193943_AddBundleIdentifierToSoftwareTitles.go
Outdated
Show resolved
Hide resolved
server/datastore/mysql/migrations/tables/20240703193943_AddBundleIdentifierToSoftwareTitles.go
Outdated
Show resolved
Hide resolved
server/datastore/mysql/migrations/tables/20240703193943_AddBundleIdentifierToSoftwareTitles.go
Outdated
Show resolved
Hide resolved
Co-authored-by: Martin Angers <martin.n.angers@gmail.com>
hey @getvictor, can you take a look at this when time allows? pinging you as a code owner and because from the git blame I think you have the most context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just a minor question for my own curiosity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good.
Probably too late now, but I would have used a more generic identifier
instead of Apple-specific bundle_identifier
so that we can reuse this for Windows/Linux/etc later if needed.
for #19144 and #20171
Checklist for submitter
If some of the following don't apply, delete the relevant line.
changes/
,orbit/changes/
oree/fleetd-chrome/changes
.See Changes files for more information.
SELECT *
is avoided, SQL injection is prevented (using placeholders for values in statements)COLLATE utf8mb4_unicode_ci
).