-
Notifications
You must be signed in to change notification settings - Fork 472
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
fix: use a new strategy for finding the app name in case the title is wrong #25297
Merged
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e8bb6b3
fix: fallback to bundle id if a default name is set
jahzielv 2871461
feat: use the <choice> tag list to find a better name
jahzielv 2d66bd5
chore: changes file
jahzielv 8c8500c
Update changes/24873-pkg-name
jahzielv e8916e6
fix: update identifier search to use the choices list if present
jahzielv 073d0bc
chore: remove unneeded code block
jahzielv 126415b
Revert "chore: remove unneeded code block"
jahzielv 0ecdc56
chore: add clarifying comment
jahzielv ba0fb39
Merge branch 'main' into 24873-pkg-name
jahzielv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
155 changes: 155 additions & 0 deletions
155
pkg/file/testdata/distribution/distribution-sentinelone.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<installer-gui-script authoringTool="Packages" authoringToolVersion="1.2.10" authoringToolBuild="732" minSpecVersion="1.0"> | ||
<options rootVolumeOnly="true" customize="never" hostArchitectures="x86_64,arm64"/> | ||
<installation-check script="installation_check()"/> | ||
<volume-check script="volume_check()"/> | ||
<!--+==========================+ | ||
| Presentation | | ||
+==========================+--> | ||
<title>DISTRIBUTION_TITLE</title> | ||
<background file="background" uti="public.tiff" scaling="none" alignment="bottomleft" layout-direction="natural"/> | ||
<background-darkAqua file="background" uti="public.tiff" scaling="none" alignment="bottomleft" layout-direction="natural"/> | ||
<!--+==========================+ | ||
| Installer | | ||
+==========================+--> | ||
<choices-outline> | ||
<line choice="installer_choice_1"/> | ||
</choices-outline> | ||
<choice id="installer_choice_1" title="SentinelOne" description=""> | ||
<pkg-ref id="com.sentinelone.pkg.sentinel-agent"/> | ||
</choice> | ||
<!--+==========================+ | ||
| Package References | | ||
+==========================+--> | ||
<pkg-ref id="com.sentinelone.pkg.sentinel-agent" version="24.3.2.7753" auth="Root" installKBytes="151168">#SentinelOne.pkg</pkg-ref> | ||
<!--+==========================+ | ||
| JavaScript Scripts | | ||
+==========================+--> | ||
<script> | ||
|
||
const __IC_FLAT_DISTRIBUTION__=true; | ||
const IC_OS_DISTRIBUTION_TYPE_ANY=0; | ||
const IC_OS_DISTRIBUTION_TYPE_CLIENT=1; | ||
const IC_DISK_TYPE_DESTINATION=0; | ||
const IC_OS_DISTRIBUTION_TYPE_SERVER=2; | ||
const IC_DISK_TYPE_STARTUP_DISK=1; | ||
|
||
function IC_CheckOS(inDiskType,inMustBeInstalled,inMinimumVersion,inMaximumVersion,inDistributionType) | ||
{ | ||
var tOSVersion=undefined; | ||
|
||
/* Check Version Constraints */ | ||
|
||
if (inDiskType==IC_DISK_TYPE_DESTINATION) | ||
{ | ||
if (my.target.systemVersion!=undefined) | ||
{ | ||
tOSVersion=my.target.systemVersion.ProductVersion; | ||
} | ||
|
||
/* Check if no OS is installed on the potential target */ | ||
|
||
if (tOSVersion==undefined) | ||
{ | ||
return (inMustBeInstalled==false); | ||
} | ||
|
||
if (inMustBeInstalled==false) | ||
{ | ||
return false; | ||
} | ||
} | ||
else | ||
{ | ||
tOSVersion=system.version.ProductVersion; | ||
} | ||
|
||
if (system.compareVersions(tOSVersion,inMinimumVersion)==-1) | ||
return false; | ||
|
||
if (inMaximumVersion!=undefined && | ||
system.compareVersions(tOSVersion,inMaximumVersion)==1) | ||
return false; | ||
|
||
/* Check Distribution Type */ | ||
|
||
if (inDistributionType!=IC_OS_DISTRIBUTION_TYPE_ANY) | ||
{ | ||
var tIsServer; | ||
|
||
if (system.compareVersions(tOSVersion,'10.8.0')==-1) | ||
{ | ||
if (inDiskType==IC_DISK_TYPE_DESTINATION) | ||
{ | ||
tIsServer=system.files.fileExistsAtPath(my.target.mountpoint+'/System/Library/CoreServices/ServerVersion.plist'); | ||
} | ||
else | ||
{ | ||
tIsServer=system.files.fileExistsAtPath('/System/Library/CoreServices/ServerVersion.plist'); | ||
} | ||
} | ||
else | ||
{ | ||
if (inDiskType==IC_DISK_TYPE_DESTINATION) | ||
{ | ||
tIsServer=system.files.fileExistsAtPath(my.target.mountpoint+'/Applications/Server.app'); | ||
} | ||
else | ||
{ | ||
tIsServer=system.files.fileExistsAtPath('/Applications/Server.app'); | ||
} | ||
} | ||
|
||
if (inDistributionType==IC_OS_DISTRIBUTION_TYPE_CLIENT && tIsServer==true) | ||
{ | ||
return false; | ||
} | ||
|
||
if (inDistributionType==IC_OS_DISTRIBUTION_TYPE_SERVER && tIsServer==false) | ||
{ | ||
return false; | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
|
||
function IC_CheckMinimumAvailableDiskSpace(inMinimumAvailableSpaceKB) | ||
{ | ||
return (my.target.availableKilobytes>=inMinimumAvailableSpaceKB); | ||
} | ||
|
||
function installation_check() | ||
{ | ||
var tResult; | ||
|
||
tResult=IC_CheckOS(IC_DISK_TYPE_STARTUP_DISK,true,'13.0','15.99.99',IC_OS_DISTRIBUTION_TYPE_ANY); | ||
|
||
if (tResult==false) | ||
{ | ||
my.result.title = system.localizedString('REQUIREMENT_FAILED_MESSAGE_INSTALLATION_CHECK_1'); | ||
my.result.message = system.localizedString('REQUIREMENT_FAILED_DESCRIPTION_INSTALLATION_CHECK_1'); | ||
my.result.type = 'Fatal'; | ||
} | ||
|
||
return tResult; | ||
} | ||
|
||
function volume_check() | ||
{ | ||
var tResult; | ||
|
||
tResult=IC_CheckMinimumAvailableDiskSpace(2147483648); | ||
|
||
if (tResult==false) | ||
{ | ||
my.result.message = system.localizedString('REQUIREMENT_FAILED_MESSAGE_VOLUME_CHECK_2'); | ||
my.result.type = 'Fatal'; | ||
} | ||
|
||
return tResult; | ||
} | ||
|
||
</script> | ||
<product version="24.3.2.7753" id="com.sentinelone.sentinel-agent"/> | ||
</installer-gui-script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
MacFULL
andSU_TITLE
are two other "bad names" that @jmwatts found, as we find more we can add them to this set.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.
Guessing this fix worked on the other packages @jmwatts found? Or do some of those wind up needing to fall all the way back to bundle ID?