Main App Bundle .
Uninstaller App Bundle.
I am creating a packet tunneling system extension from the the Main App Bundle. Is there a way I could use NEVPNManager's loadAllFromPreferences to access the VPN created from the main app bundle and remove that VPN ?
I can think of using IPC to communicate from Uninstaller App Bundle to the main App Bundle to let the Main App Bundle know when to delete the VPN, but is there a way to do it directly from the Uninstaller App Bundle, so that in case the main process from the Main App bundle isn't running I could still remove the VPN ?
Also, embedded inside the Main App Bundle is another executable file which run as LaunchDaemon. Could I use the LaunchDaemon process to remove the VPN profile as well?
One more question. In the documentation it says the following :
Uninstall a System Extension
The system automatically uninstalls any system extensions when the user deletes the corresponding app. You can also uninstall a system extension by creating a deactivation request. Call the deactivationRequest(forExtensionWithIdentifier:queue:) method of OSSystemExtensionRequest and submit the resulting object to the OSSystemExtensionManager.
When I delete the app it doesn't automatically delete the corresponding System Extension/VPN. Is the documentation wrong or do I need to have done something else for the system extension to get deleted automatically?
I can also remove the VPN/SystemExtension by using NEVPNManager's removeFromPreferences. Is there a pro/con in using removeFromPreferences vs deactivationRequest ?