forked from WeberSynBioLab/optoConfig-96
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_dmg.sh
43 lines (35 loc) · 1.51 KB
/
create_dmg.sh
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
#!/bin/bash
# Remove build intermediate from dist/ directory to not include it in the .dmg
# when choosing dist/ as the source folder for create-dmg
# Copying the .app into a dedicated dmg/ directory appears to mess with code
# signing. Don't touch it.
rm -r dist/optoConfig96
readme='Trouble opening? READ ME!.txt'
cat > "dist/${readme}" << EOF
After dragging optoConfig96 into your Applications directory, you may be shown
a popup with one of these messages:
* "optoConfig96" can't be opened because Apple cannot check it for malicious
software.
* "optoConfig96" cannot be opened because the developer cannot be verified.
In that case, Control-Click on the optoConfig icon and select "Open". You will
be asked if you are sure you want to open it. Once you confirm this,
optoConfig96 will launch.
You can also go to
* "System Preferences > Security & Privacy > General Tab", or
* "System Preferences > Privacy & Security > Security Section",
depending on the version of MacOS you are using, and choose "Open Anyway" for
optoConfig96 after having tried to open it once.
You only need to do this when launching optoConfig96 for the first time.
EOF
# Create a .dmg archive from the .app after building
create-dmg \
--volname "optoConfig" \
--volicon "optoConfig96/resources/oc96.icns" \
--window-size 600 300 \
--icon-size 100 \
--icon "optoConfig96.app" 0 120 \
--icon "${readme}" 300 60 \
--hide-extension "optoConfig96.app" \
--hide-extension "${readme}" \
--app-drop-link 500 120 \
darwin.dmg dist