home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- Smaller Installer © 1993 Bill Goodman, All Rights Reserved
- *******************************************************************************
-
- System 6/7 Select Example
-
- This installer hook procedure checks the version of the System that is running
- and enables group "Q" if System 7 is running or group "R" if System 6 is
- running.
-
- To use this hook procedure, you must compile this code and create a code
- resource with type 'SICR' and an ID of 500. This resource should be
- non-preloaded, nonpurgeable, unlocked, unprotected and non-sysheap. Copy this
- resource to your installer's resource file.
-
- ******************************************************************************/
-
- #include <SetUpA4.h>
- #include <GestaltEqu.h>
- #include "SIHookProc.h"
-
-
- /******************************************************************************
- Module Internal Function Prototypes
- ******************************************************************************/
- void SetTargetVolFunction(void);
-
-
- /******************************************************************************
- Constant Declarations
- ******************************************************************************/
- #define groupQ 0 /* Group Q select value */
- #define groupR 1 /* Group R select value */
-
-
- /******************************************************************************
- Module Variables Declarations
- ******************************************************************************/
- SIHookParmBlk *parms; /* Global pointer to parameter block */
-
-
- /*****************************************************************************/
- pascal void main(
- SIHookParmBlk *parmBlk /* Pointer to parameter block */
- )
- /******************************************************************************
- This is the main entry point for the installer hook procedure.
- ******************************************************************************/
- {
- RememberA0(); /* This is necessary to access any global variables */
- SetUpA4();
- parms = parmBlk;
-
- switch (parms->function)
- {
- case siHookSetTargetVol:
- SetTargetVolFunction();
- break;
- }
- RestoreA4();
- }
-
-
- /*****************************************************************************/
- void SetTargetVolFunction(void)
- /******************************************************************************
- Input parameters:
- "targetVRefNum" - Volume reference number of target volume
- "groupAPFlags", "groupQUSel", "groupVZSel" - Groups currently selected
- for installation
- Returns:
- "groupAPFlags", "groupQUSel", "groupVZSel" - New installation groups
-
- This function is called at startup and whenever the target volume is
- changed.
- ******************************************************************************/
- {
- long feature;
-
- /* Use Gestalt to obtain system version. Assume System 6 if Gestalt fails */
- parms->groupQUSel = groupR;
- if (Gestalt(gestaltSystemVersion, &feature) == noErr)
- if (feature >= 0x0700)
- parms->groupQUSel = groupQ;
- }
-