Issues When Attempting to Run Scripts During MacOS Package Install

So I’m trying to build an installer for a .NET project. I’ve published the project in Jetbrains Rider and this is my file structure now:

NewPoseidonRoot
├── Poseidon
│   ├── Contents
│   │   ├── Info.plist
│   │   ├── MacOS
│   │   │   └── Poseidon.svc
│   │   ├── Resources
│   │       └── [all other files needed by Poseidon.svc]
├── scripts
│   ├── preinstall.sh
│   └── postinstall.sh
└── component.plist

Poseidon.svc is a service that I’m targeting for the install, and all of its supporting files are in Resources. The issue I’m seeing is that the scripts don’t execute, and in /var/log/install.log, I see the following output:

2024-05-14 12:42:37-04 MacBook-Pro-4 Installer[74100]: PackageKit: Enqueuing install with framework-specified quality of service (utility)
2024-05-14 12:42:37-04 MacBook-Pro-4 installd[73903]: PackageKit: Set reponsibility for install to 74100
2024-05-14 12:42:37-04 MacBook-Pro-4 installd[73903]: PackageKit: Hosted team responsibility for install set to team:(R5Z254TK93)
2024-05-14 12:42:37-04 MacBook-Pro-4 installd[73903]: PackageKit: ----- Begin install -----
2024-05-14 12:42:37-04 MacBook-Pro-4 installd[73903]: PackageKit: request=PKInstallRequest <1 packages, destination=/>
2024-05-14 12:42:37-04 MacBook-Pro-4 installd[73903]: PackageKit: packages=(
        "PKLeopardPackage <id=com.netarx.poseidon, version=1.0.0, url=file://localhost/Users/stevep/Documents/NewPoseidon/Poseidon.pkg>"
    )
2024-05-14 12:42:38-04 MacBook-Pro-4 installd[73903]: PackageKit: Will do receipt-based obsoleting for package identifier com.netarx.poseidon (prefix path=Library/Application Support/Netarx)
2024-05-14 12:42:38-04 MacBook-Pro-4 installd[73903]: PackageKit: Extracting file://localhost/Users/stevep/Documents/NewPoseidon/Poseidon.pkg (destination=/Library/InstallerSandboxes/.PKInstallSandboxManager/86FE3A0F-3737-4311-937D-639C117886D7.activeSandbox/Root/Library/Application Support/Netarx, uid=0)
2024-05-14 12:42:39-04 MacBook-Pro-4 installd[73903]: PackageKit: prevent user idle system sleep
2024-05-14 12:42:39-04 MacBook-Pro-4 installd[73903]: PackageKit: suspending backupd
2024-05-14 12:42:39-04 MacBook-Pro-4 installd[73903]: PackageKit (package_script_service): Preparing to execute script "./scripts/preinstall.sh" in /private/tmp/PKInstallSandbox.IQhJX0/Scripts/com.netarx.poseidon.nEaGyN
2024-05-14 12:42:39-04 MacBook-Pro-4 package_script_service[73940]: PackageKit: Preparing to execute script "preinstall.sh" in /private/tmp/PKInstallSandbox.IQhJX0/Scripts/com.netarx.poseidon.nEaGyN/scripts
2024-05-14 12:42:39-04 MacBook-Pro-4 package_script_service[73940]: Set responsibility to pid: 74100, responsible_path: /System/Library/CoreServices/Installer.app/Contents/MacOS/Installer
2024-05-14 12:42:39-04 MacBook-Pro-4 package_script_service[73940]: Hosted team responsibility for script set to team:(R5Z254TK93)
2024-05-14 12:42:39-04 MacBook-Pro-4 package_script_service[73940]: PackageKit: Executing script "preinstall.sh" in /private/tmp/PKInstallSandbox.IQhJX0/Scripts/com.netarx.poseidon.nEaGyN/scripts
2024-05-14 12:42:39-04 MacBook-Pro-4 package_script_service[73940]: PackageKit: *** launch path not accessible
2024-05-14 12:42:39-04 MacBook-Pro-4 package_script_service[73940]: PackageKit: Failed task has no attributes: Error Domain=NSCocoaErrorDomain Code=260 "The file “preinstall.sh” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/private/tmp/PKInstallSandbox.IQhJX0/Scripts/com.netarx.poseidon.nEaGyN/scripts/preinstall.sh, NSUnderlyingError=0x14c307510 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
2024-05-14 12:42:39-04 MacBook-Pro-4 package_script_service[73940]: PackageKit: Hosted team responsible for script has been cleared.
2024-05-14 12:42:39-04 MacBook-Pro-4 package_script_service[73940]: Responsibility set back to self.
2024-05-14 12:42:39-04 MacBook-Pro-4 install_monitor[74117]: Temporarily excluding: /AppleInternal, /Applications, /Library, /System, /bin, /private, /sbin, /usr
2024-05-14 12:42:39-04 MacBook-Pro-4 install_monitor[74117]: Re-included: /AppleInternal, /Applications, /Library, /System, /bin, /private, /sbin, /usr
2024-05-14 12:42:39-04 MacBook-Pro-4 installd[73903]: PackageKit: releasing backupd
2024-05-14 12:42:39-04 MacBook-Pro-4 installd[73903]: PackageKit: allow user idle system sleep
2024-05-14 12:42:39-04 MacBook-Pro-4 installd[73903]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “Poseidon.pkg”." UserInfo={NSFilePath=./scripts/preinstall.sh, NSURL=file://localhost/Users/stevep/Documents/NewPoseidon/Poseidon.pkg, PKInstallPackageIdentifier=com.netarx.poseidon, NSLocalizedDescription=An error occurred while running scripts from the package “Poseidon.pkg”.} {
        NSFilePath = "./scripts/preinstall.sh";
        NSLocalizedDescription = "An error occurred while running scripts from the package U201cPoseidon.pkgU201d.";
        NSURL = "file://localhost/Users/stevep/Documents/NewPoseidon/Poseidon.pkg";
        PKInstallPackageIdentifier = "com.netarx.poseidon";
    }

When I built this package, I ran this command from within the NewPoseidonRoot directory:

pkgbuild --root ./ 
         --identifier "com.netarx.poseidon" 
         --version "1.0.0" 
         --install-location "/Library/Application Support/Netarx" 
         --scripts ./scripts  
         --component-plist ./component.plist 
         --sign "Developer ID Installer: Steve P (xxxxxxxxxxx)" 
         ../Poseidon.pkg

Here is my component.plist also:

<plist version="1.0">
<array>
    <dict>
        <key>RootRelativeBundlePath</key>
        <string>Poseidon</string>
        <key>BundleIsRelocatable</key>
        <true/>
        <key>BundleIsVersionChecked</key>
        <true/>
        <key>BundleHasStrictIdentifier</key>
        <true/>
        <key>BundlePreInstallScriptPath</key>
        <string>scripts/preinstall.sh</string>
        <key>BundlePostInstallScriptPath</key>
        <string>scripts/postinstall.sh</string>
    </dict>
</array>
</plist>

This produces the package without error, but for some reason when I run the installer, I see that the script preinstall.sh cannot be found. Any idea where I’m going wrong?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật