Skip to content

Commit 6ce8ab6

Browse files
committed
Mac OSX version refactory
1 parent 724b07f commit 6ce8ab6

14 files changed

+266
-243
lines changed

build-linux

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
go build
2-
cp whitecat-create-agent installer/linux/
2+
cp whitecat-create-agent installer/linux/wccagent
3+
rm whitecat-create-agent

build-osx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
go build
2-
cp whitecat-create-agent installer/darwin/The\ Whitecat\ Create\ Agent.app/Contents/MacOS/
2+
cp whitecat-create-agent installer/darwin/wccagent
3+
rm whitecat-create-agent

build-win.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
go build -ldflags="-H windowsgui"
2-
cp whitecat-create-agent.exe installer\windows\whitecat-create-agent.exe
2+
cp whitecat-create-agent.exe installer\windows\wccagent.exe
3+
del whitecat-create-agent.exe

installer/darwin/The Whitecat Create Agent.app/Contents/Info.plist

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,29 @@
22
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>CFBundleDevelopmentRegion</key>
6-
<string>English</string>
7-
<key>CFBundleExecutable</key>
8-
<string>whitecat-create-agent</string>
9-
<key>CFBundleGetInfoString</key>
10-
<string>The Whitecat Create Agent - whitecatboard.org</string>
11-
<key>CFBundleIconFile</key>
12-
<string>AppIcon</string>
13-
<key>CFBundleIdentifier</key>
14-
<string>org.whitecatboard.the-whitecat-create-agent</string>
15-
<key>CFBundleInfoDictionaryVersion</key>
16-
<string>6.0</string>
17-
<key>CFBundleLocalizations</key>
18-
<array>
19-
<string></string><string>es</string>
20-
</array>
21-
<key>CFBundleName</key>
22-
<string>The Whitecat Create Agent</string>
23-
<key>CFBundlePackageType</key>
24-
<string>APPL</string>
25-
<key>CFBundleShortVersionString</key>
26-
<string>1.2</string>
27-
<key>CFBundleSignature</key>
28-
<string>The Whitecat Create Agent</string>
29-
<key>CFBundleVersion</key>
30-
<string>1.2</string>
31-
<key>NSHighResolutionCapable</key>
32-
<true/>
33-
<key>LSUIElement</key>
34-
<true/>
5+
<key>CFBundleName</key>
6+
<string>The Whitecat Create Agent</string>
7+
<key>CFBundleIdentifier</key>
8+
<string>org.whitecatboard.TheWhitecatCreateAgent</string>
9+
<key>CFBundleInfoDictionaryVersion</key>
10+
<string>6.0</string>
11+
<key>CFBundleVersion</key>
12+
<string>1.2</string>
13+
<key>CFBundleExecutable</key>
14+
<string>The Whitecat Create Agent</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>LSUIElement</key>
18+
<true/>
19+
<key>CFBundleIconFile</key>
20+
<string>appIcon.icns</string>
21+
<key>LSMinimumSystemVersion</key>
22+
<string>10.7.0</string>
23+
<key>CFBundleDevelopmentRegion</key>
24+
<string>en</string>
25+
<key>NSHumanReadableCopyright</key>
26+
<string>© 2017 whitecatboard.org</string>
27+
<key>CFBundleShortVersionString</key>
28+
<string>1.2</string>
3529
</dict>
3630
</plist>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
/bin/launchctl unload -w /Library/LaunchAgents/org.whitecatboard.TheWhitecatCreateAgent.plist
4+
/bin/launchctl load -w /Library/LaunchAgents/org.whitecatboard.TheWhitecatCreateAgent.plist

installer/darwin/The Whitecat Create Agent.app/Contents/MacOS/start.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

installer/darwin/The Whitecat Create Agent.app/Contents/MacOS/update.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

installer/darwin/org.whitecatboard.the-whitecat-create-agent.plist renamed to installer/darwin/org.whitecatboard.TheWhitecatCreateAgent.plist

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33
<plist version="1.0">
44
<dict>
55
<key>Label</key>
6-
<string>org.whitecatboard.the-whitecat-create-agent</string>
6+
<string>org.whitecatboard.TheWhitecatCreateAgent</string>
77
<key>ProgramArguments</key>
88
<array>
9-
<string>/Applications/The Whitecat Create Agent/The Whitecat Create Agent.app/Contents/MacOS/start.sh</string>
9+
<string>/usr/bin/wccagent</string>
10+
<string>-ui</string>
1011
</array>
1112
<key>RunAtLoad</key>
1213
<true/>
13-
<key>ProcessType</key>
14-
<string>Interactive</string>
1514
<key>KeepAlive</key>
16-
<false/>
15+
<dict>
16+
<key>SuccessfulExit</key>
17+
<false/>
18+
</dict>
1719
</dict>
1820
</plist>

installer/darwin/wccagent

10.6 MB
Binary file not shown.

installer/whitecatcreateagent.xml

Lines changed: 73 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,18 @@
111111
<platforms>osx</platforms>
112112
<distributionFileList>
113113
<distributionFile>
114-
<origin>darwin/org.whitecatboard.the-whitecat-create-agent.plist</origin>
114+
<origin>darwin/org.whitecatboard.TheWhitecatCreateAgent.plist</origin>
115+
</distributionFile>
116+
</distributionFileList>
117+
</folder>
118+
<folder>
119+
<description>System Files</description>
120+
<destination>/usr/bin</destination>
121+
<name>newfolder5</name>
122+
<platforms>osx</platforms>
123+
<distributionFileList>
124+
<distributionFile>
125+
<origin>darwin/wccagent</origin>
115126
</distributionFile>
116127
</distributionFileList>
117128
</folder>
@@ -150,29 +161,18 @@
150161
</startMenuShortcutList>
151162
</component>
152163
</componentList>
153-
<preInstallationActionList>
154-
<runProgram>
155-
<abortOnError>0</abortOnError>
156-
<program>/bin/launchctl</program>
157-
<programArguments>unload -w /Library/LaunchAgents/org.whitecatboard.the-whitecat-create-agent.plist</programArguments>
158-
<showMessageOnError>0</showMessageOnError>
164+
<initializationActionList>
165+
<setInstallerVariable>
166+
<name>app_folder</name>
167+
<value>${installdir}/${product_fullname}.app/Contents/MacOS</value>
159168
<ruleList>
160169
<platformTest>
161170
<type>osx</type>
162171
</platformTest>
163172
</ruleList>
164-
</runProgram>
165-
<runProgram>
166-
<abortOnError>0</abortOnError>
167-
<program>killall</program>
168-
<programArguments>whitecat-create-agent</programArguments>
169-
<showMessageOnError>0</showMessageOnError>
170-
<ruleList>
171-
<platformTest>
172-
<type>linux-x64</type>
173-
</platformTest>
174-
</ruleList>
175-
</runProgram>
173+
</setInstallerVariable>
174+
</initializationActionList>
175+
<readyToInstallActionList>
176176
<runProgram>
177177
<abortOnError>0</abortOnError>
178178
<program>stop.bat</program>
@@ -188,54 +188,24 @@
188188
</platformTest>
189189
</ruleList>
190190
</runProgram>
191-
</preInstallationActionList>
192-
<postInstallationActionList>
193-
<registrySet>
194-
<key>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run</key>
195-
<name>${product_fullname}</name>
196-
<type>REG_SZ</type>
197-
<value>"${installdir}\whitecat-create-agent.exe"</value>
198-
</registrySet>
199191
<runProgram>
200192
<abortOnError>0</abortOnError>
201193
<program>/bin/launchctl</program>
202-
<programArguments>load -w /Library/LaunchAgents/org.whitecatboard.the-whitecat-create-agent.plist</programArguments>
194+
<programArguments>unload -w /Library/LaunchAgents/org.whitecatboard.TheWhitecatCreateAgent.plist</programArguments>
203195
<showMessageOnError>0</showMessageOnError>
204196
<ruleList>
205197
<platformTest>
206198
<type>osx</type>
207199
</platformTest>
208200
</ruleList>
209201
</runProgram>
210-
<runProgram>
211-
<abortOnError>0</abortOnError>
212-
<program>start.bat</program>
213-
<programArguments></programArguments>
214-
<showMessageOnError>0</showMessageOnError>
215-
<workingDirectory>${installdir}</workingDirectory>
216-
<ruleList>
217-
<platformTest>
218-
<type>windows</type>
219-
</platformTest>
220-
</ruleList>
221-
</runProgram>
222-
</postInstallationActionList>
202+
</readyToInstallActionList>
223203
<preUninstallationActionList>
224-
<runProgram>
225-
<abortOnError>0</abortOnError>
226-
<program>/bin/launchctl</program>
227-
<programArguments>unload -w /Library/LaunchAgents/org.whitecatboard.the-whitecat-create-agent.plist</programArguments>
228-
<showMessageOnError>0</showMessageOnError>
229-
<ruleList>
230-
<platformTest>
231-
<type>osx</type>
232-
</platformTest>
233-
</ruleList>
234-
</runProgram>
235204
<registryDelete>
236205
<abortOnError>0</abortOnError>
237206
<key>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run</key>
238207
<name>${product_fullname}</name>
208+
<showMessageOnError>0</showMessageOnError>
239209
</registryDelete>
240210
<runProgram>
241211
<abortOnError>0</abortOnError>
@@ -253,14 +223,12 @@
253223
</runProgram>
254224
<runProgram>
255225
<abortOnError>0</abortOnError>
256-
<program>killall</program>
257-
<programArguments>whitecat-create-agent</programArguments>
258-
<run>0</run>
259-
<show>0</show>
226+
<program>/bin/launchctl</program>
227+
<programArguments>unload -w /Library/LaunchAgents/org.whitecatboard.TheWhitecatCreateAgent.plist</programArguments>
260228
<showMessageOnError>0</showMessageOnError>
261229
<ruleList>
262230
<platformTest>
263-
<type>linux-x64</type>
231+
<type>osx</type>
264232
</platformTest>
265233
</ruleList>
266234
</runProgram>
@@ -278,6 +246,54 @@
278246
<vendor>whitecatboard.org</vendor>
279247
<windowsExecutableIcon>whitecat.ico</windowsExecutableIcon>
280248
<windowsUninstallerExecutableIcon>uninstall.ico</windowsUninstallerExecutableIcon>
249+
<finalPageActionList>
250+
<registrySet>
251+
<abortOnError>0</abortOnError>
252+
<key>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run</key>
253+
<name>${product_fullname}</name>
254+
<show>0</show>
255+
<showMessageOnError>0</showMessageOnError>
256+
<type>REG_SZ</type>
257+
<value>"${installdir}\whitecat-create-agent.exe"</value>
258+
</registrySet>
259+
<runProgram>
260+
<abortOnError>0</abortOnError>
261+
<program>/bin/launchctl</program>
262+
<programArguments>unload -w /Library/LaunchAgents/org.whitecatboard.TheWhitecatCreateAgent.plist</programArguments>
263+
<show>0</show>
264+
<showMessageOnError>0</showMessageOnError>
265+
<ruleList>
266+
<platformTest>
267+
<type>osx</type>
268+
</platformTest>
269+
</ruleList>
270+
</runProgram>
271+
<runProgram>
272+
<abortOnError>0</abortOnError>
273+
<program>/bin/launchctl</program>
274+
<programArguments>load -w /Library/LaunchAgents/org.whitecatboard.TheWhitecatCreateAgent.plist</programArguments>
275+
<show>0</show>
276+
<showMessageOnError>0</showMessageOnError>
277+
<ruleList>
278+
<platformTest>
279+
<type>osx</type>
280+
</platformTest>
281+
</ruleList>
282+
</runProgram>
283+
<runProgram>
284+
<abortOnError>0</abortOnError>
285+
<program>start.bat</program>
286+
<programArguments></programArguments>
287+
<show>0</show>
288+
<showMessageOnError>0</showMessageOnError>
289+
<workingDirectory>${installdir}</workingDirectory>
290+
<ruleList>
291+
<platformTest>
292+
<type>windows</type>
293+
</platformTest>
294+
</ruleList>
295+
</runProgram>
296+
</finalPageActionList>
281297
<parameterList>
282298
<directoryParameter>
283299
<name>installdir</name>

0 commit comments

Comments
 (0)