Add registration dialog to PackageMaker
I'm currently in the process of writing a Mac PackageMaker-based installer for an application that I had previously distributed for Windows using an NSIS installer.
In NSIS, I was able to create a customized dialog that allowed the user to enter their serial number and license key before being allowed to install the program.
In PackageMaker, I can't really see anyway to add a custom dialog short of writing an little GUI app that is called by PackageMaker as a requirement. If this is the only way to do what I want, can anyone direct me to a resource that would explain how to do that?
If there is a 开发者_C百科another way, I'd also love to hear about that too.
(I know this question is similar but seems to deal more with editing the existing PackageMaker screens.)
PackageMaker supports plug-ins which can be added at any step of the installation. What you should do is write a plug-in which shows your license key prompt, and then load this plug-in at a step in the installation (say, the License step).
Here's an example of such a plug-in: http://lists.apple.com/archives/Installer-dev/2008/Feb/msg00076.html
Personally, I'd recommend that you spare yourself the headache, and not use PackageMaker to make your Mac installer, but rather, an alternative tool, like Iceberg, and save yourself the trouble of tons of bugs.
If you insist on using PackageMaker, you should read this guide first to be ready for the many problems you may encounter: (couldn't post this link because SO didn't let me, since I'm a first-time poster, but Google "PackageMaker workarounds" and it's the third result.
Apple's InstallerPluginSample sample code demonstrates how to add a registration pane to a PackageMaker-created installer.
I would recommend putting the license dialog in the application rather than in the installer. I haven't ever seen a Mac app that requests a license key during the install. They all do it when you launch the app.
精彩评论