簡體   English   中英

從 pkgbuild 生成的 .pkg 安裝程序安裝的零字節應用程序

[英]Zero-byte Application being installed from pkgbuild generated .pkg installer

這是我用來生成.pkg安裝程序的 shell 腳本。

#!/bin/bash

APP_PATH=$1
DSYM_PATH=$2
PKG_PATH=$3
IDENTIFIER=$4
VERSION=$5
TARGET_DIR=$(dirname "$APP_PATH")/temp

echo "Deleting old Pkg File."
rm -rf $PKG_PATH
rm -rf $TARGET_DIR
mkdir $TARGET_DIR
echo "Done."

echo "Copying APP \"$APP_PATH\" and dSYM \"$DSYM_PATH \" to temp folder."

cp -a $APP_PATH $TARGET_DIR
cp -a $DSYM_PATH $TARGET_DIR

echo "Done."


echo "Generating .Pkg file with dSYM folder"

/usr/bin/pkgbuild \
  --root "$TARGET_DIR" \
  --install-location "/Applications" \
  --identifier "$IDENTIFIER" \
  --version "$VERSION" \
  "$PKG_PATH"

echo "Done Generating \"$APP_PATH\" with dSYM folder"

.pkg安裝到/Applications文件夾,但它的大小zero byte

我試圖更改文件的權限,但沒有用。

為了解決這個問題,我不得不更改文件的權限。

我在腳本中添加了以下行。

chmod -R 755 $TARGET_DIR

具有錯誤權限的文件將導致zero-bytes安裝。

#!/bin/bash

APP_PATH=$1
DSYM_PATH=$2
PKG_PATH=$3
IDENTIFIER=$4
VERSION=$5
TARGET_DIR=$(dirname "$APP_PATH")/temp

echo "Deleting old Pkg File."
rm -rf $PKG_PATH
rm -rf $TARGET_DIR
mkdir $TARGET_DIR
echo "Done."

echo "Copying APP \"$APP_PATH\" and dSYM \"$DSYM_PATH \" to temp folder."

cp -a $APP_PATH $TARGET_DIR
cp -a $DSYM_PATH $TARGET_DIR

echo "Done."

chmod -R 755 $TARGET_DIR

echo "Generating .Pkg file with dSYM folder"

/usr/bin/pkgbuild \
  --root "$TARGET_DIR" \
  --install-location "/Applications" \
  --identifier "$IDENTIFIER" \
  --version "$VERSION" \
  "$PKG_PATH"

echo "Done Generating \"$APP_PATH\" with dSYM folder"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM