Hello,
This is based on this question. I used the <createOSXService>
method to set the Java launcher app to run at startup. It does not run the Java launcher at startup. However, when you enter the ' launchctl list' command in the Terminal it shows as running. But it is not starting at startup?
Hi,
The following section in our docs describe how to add an application to the system startup.
Hope it helps,
Michiel D'Hont
I added this code,
<writeFile> <path>${system_temp_directory}/your.plist</path> <encoding>utf-8</encoding> <text><![CDATA[ <plist version= or ' 1.0 or ' > <dict> <key>Label</key> <string>com.myapp1.myapp2</string> <key>ProgramArguments</key> <array> <string>/Applications/myapp.app</string> </array> <key>KeepAlive</key> <true/> <key>Hide</key> <true/> <key>RunAtLoad</key> <true/> </dict> </plist> ]]></text> </writeFile>
But the InstallBuilder change it to this,
<writeFile>
<encoding>utf-8</encoding>
<path>${system_temp_directory}/your.plist</path>
<text>
<plist version= or ' 1.0 or ' >
<dict>
<key>Label</key>
<string>com.myapp1.myapp2</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/myapp.app</string>
</array>
<key>KeepAlive</key>
<true/>
<key>Hide</key>
<true/>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
</text>
</writeFile>
Also this did not run the Java Launcher or ' myapp.app or ' at startup.
Hi,
When using CDATA with the InstallBuilder GUI the inner XML is encoded to ensure it displays correctly. Regarding the Launcher not starting, could you change the path in the plist to the following and check if that does work?
<path>${user_home_directory}/Library/LaunchAgents/your.plist</path>
Regards,
Michiel D'Hont
This worked. Thanks. This is the full code,
<writeFile>
<abortOnError>0</abortOnError>
<encoding>utf-8</encoding>
<path>${system_temp_directory}/your.plist</path>
<show>0</show>
<text>
<plist version= or ' 1.0 or ' >
<dict>
<key>Label</key>
<string>plistName</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/myapp.app/Contents/MacOS/myapp</string>
</array>
<key>Hide</key>
<true/>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
</text>
</writeFile>
<copyFile>
<abortOnError>0</abortOnError>
<destination>${user_home_directory}/Library/LaunchAgents/plistName.plist</destination>
<origin>${system_temp_directory}/your.plist</origin>
<show>0</show>
</copyFile>