Package all in one installation on Mac

Introduction

With MacOS, we have iquploader.app, iqboxshare.app and Share file(s) online with IQBoxShare.workflow (we will zip this file) and we want to create only one installation package what will let two app files to Application folder and workflow file to ~/Library/Services (/Users/[user name]/Library/Services)

Tools: packageMaker (auxiliary tool for Xcode)

Getting Started

Step1: Drag and Drop 3 files to PackageMaker.

1-package-mac

 

Step 2: configure destination and Uncheck “Allow relocation”.

-With iquploader.app and iqboxshare.app, we set /Applications

With Share file(s) online with IQBoxShare.zip, we set to /tmp

(PackageMaker cannot know the current user home folder (Ex: /User/Tung/Library/Services) and Mac 10.8 doesn’t have services folder. We must set this file to a temporary folder and then we run a shell script to do all things for it.)

2-package-mac

 

 4-package-mac

Uncheck “Allow relocation” with both IQUploader.app and IQBoxShare.app. When “allow relocation” is checked, it means that the installer will search for an existing copy of the application and replace it there rather than the default install location. It’s probably finding the app in its build folder and replacing it there.

3-package-mac_1

 

Step 3: Select our Shell Script for postflight (This script is launched after the files in the package have been installed. See (preinstall / preupgrade) to see which one is launched)

The content of shell script or can download here:

#!/bin/bash

echo "Start postflight script"

cd ~/Library
if [ -d "Services" ]; then
    echo "That directory exists"
else
    echo "That directory doesn't exists. Create it"
    mkdir "Services"
fi

mv "/tmp/Share file(s) online with IQBoxShare.zip" ~/Library/Services/
cd ~/Library/Services/
unzip "Share file(s) online with IQBoxShare.zip"
rm "Share file(s) online with IQBoxShare.zip"
rm -rf __MACOSX
echo "End postflight script"
exit 0
 

5-package-mac

Then set a name for the output

6-package-mac

 

Click “Build” and we will have a package file.

Reference:

http://s.sudre.free.fr/Stuff/PackageMaker_Howto.html

Các bài viết khác
Cùng lan toả
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
- Công việc chuyên môn là lập trình. - Thời gian làm việc đa số dùng internet cho nên cũng mong muốn chia sẻ những kiến thức và nhận định của mình cho mọi người về thế giới internet đầy rẫy tham sân si này. - Đã có vợ con. - Mọi liên hệ các bạn vui lòng email [email protected] hoặc [email protected]
Posts created 86

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top