Installation Q & A
Installing my application does not require to restart the Mac if it's installed for the first time. But a restart is required if a previous version is already installed. How can I do that?
It's possible to achieve this behavior with a distribution by relying on the fact that the installation will only take into account the post-installation behaviors of selected choices.

This article will describe how to do this with Packages.

  1. Open Packages.
  2. Create a new Distribution project.
  3. Rename the default package to "Payload".
  4. Proceed as usual to configure this package but make sure Post-installation Behavior is set to "Do Nothing".
  5. Choose Project > New Package.
  6. Rename the default package to "Restart".
  7. Set a proper identifier for the Restart package and make sure Post-installation Behavior is set to "Require Restart".
  8. Select the Project item in the source list.
  9. Click the Presentation tab.
  10. Choose the Installation Type step.
  11. Select the Restart choice.
  12. Set its visibility to Invisible.
  13. Click the Requirements tab.
  14. Add a requirement.
  15. Define which requirement should trigger a restart (for instance the existence of a file in a specific location).
  16. Click OK.

You can now build your package and test it.

Sample Project

Site Map

Copyright 2012 Stéphane Sudre. All rights reserved.