Domanda

I have created an installer plugin which would show a pane while installing the pkg file from a GUI. I need to know the location of the executable of the installerplugin run when the installation takes place, so that I could access a file relative to that path. The NSProcessInfo class is of no help as the process it refers to is the installer.app. Is there some way to find out?

È stato utile?

Soluzione

I found out the way. We can use the NSBundle Class to locate the bundle by:

NSBundle* iPlugin = [NSBundle bundleForClass:[MyInstallerPlugin class]];

and then using

[iPlugin bundlePath ];

we can find the absolute path of the root of the bundle.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top