-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCreate_App.command
executable file
·103 lines (73 loc) · 2.83 KB
/
Create_App.command
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# HP-EliteBook-840-G4
# (c) Copyright 2022 chris1111, All Right Reserved.
# This will create a Apple Bundle App HP-EliteBook-840-G4
# Dependencies: osacompile
PARENTDIR=$(dirname "$0")
cd "$PARENTDIR"
find . -name '.DS_Store' -type f -delete
# Declare some VARS
APP_NAME="HP_EliteBook-840_G4.app"
SOURCE_SCRIPT="./Files_In/HP-EliteBook840_G4.applescript"
echo "= = = = = = = = = = = = = = = = = = = = = = = = = "
echo "HP EliteBook 840_G4"
echo "= = = = = = = = = = = = = = = = = = = = = = = = = "
# shell script Notifications
osascript -e 'display notification "Installer OpenCorePackage" with title "Create" sound name "default"'
# Delete build if exist
rm -rf ./Packages/OpenCore-Package
rm -rf ./Packages/OpenCore-Package
rm -rf /tmp/PackageDIR
rm -rf ./Packages/OpenCore-Package.pkg
Sleep 1
mkdir -p ./Packages/OpenCore-Package/BUILD-PACKAGE
mkdir -p /tmp/PackageDIR
# Create Packages with pkgbuild
pkgbuild --root ./Packages/OC-EFI --scripts ./Packages/ScriptEFI --identifier com.opencorePackage.OpenCorePackage.pkg --version 1.0 --install-location /Private/tmp/EFIROOTDIR ./Packages/OpenCore-Package/BUILD-PACKAGE/opencorePackage.pkg
Sleep 2
# Expend the Packages with pkgutil
pkgutil --expand ./Packages/OpenCore-Package/BUILD-PACKAGE/opencorePackage.pkg /tmp/PackageDIR/opencorePackage.pkg
Sleep 3
# Copy resources and distribution
cp -r ./Packages/Distribution ./Packages/OpenCore-Package/BUILD-PACKAGE/Distribution.xml
cp -rp ./Packages/Resources ./Packages/OpenCore-Package/BUILD-PACKAGE/
echo "
= = = = = = = = = = = = = = = = = = = = = = = = =
Create finale Package with Productbuild "
Sleep 3
# Create finale Package with Productbuild
productbuild --distribution "./Packages/OpenCore-Package/BUILD-PACKAGE/Distribution.xml" \
--package-path "./Packages/OpenCore-Package/BUILD-PACKAGE/" \
--resources "./Packages/OpenCore-Package/BUILD-PACKAGE/Resources" \
"./OpenCore.pkg"
# Remove app
rm -rf "$APP_NAME"
rm -rf ./Packages/OpenCore-Package
Sleep 2
# Create the dir structure
/usr/bin/osacompile -o "$APP_NAME" "$SOURCE_SCRIPT"
# Copy Licenses
cp ./Files_In/LICENSE "$APP_NAME"/Contents/Resources/LICENSE.txt
# Copy description
cp -rp ./Files_In/description.rtfd "$APP_NAME"/Contents/Resources
# Copy Installer
cp -rp ./OpenCore.pkg "$APP_NAME"/Contents/Resources/Scripts
# Copy Command
cp -rp ./Files_In/Create-Install-SSD "$APP_NAME"/Contents/Resources/Scripts
Sleep 2
# Copy applet.icns
cp -rp ./Files_In/applet.icns "$APP_NAME"/Contents/Resources
cp -rp ./Files_In/applet.icns "$APP_NAME"/Contents/Resources/Scripts
# Zip app
Sleep 1
zip -r "$APP_NAME".zip "$APP_NAME"
Sleep 1
rm -rf "$APP_NAME"
unzip "$APP_NAME".zip
Sleep 1
# Remove app
rm -rf ./OpenCore.pkg
rm -rf ./"$APP_NAME".zip
Open $APP_NAME
echo " = = = = = = = = = = = = = = = = = = = = = = = = =
HP-EliteBook-840-G4.app completed
= = = = = = = = = = = = = = = = = = = = = = = = = "