An installation script is a procedure you write in the development dictionary that runs automatically when you install your application with Microsoft Dynamics GP. You will use an installation script can be used to perform certain setup tasks, such as setting default security for your integrating application.
You indicate the installation script for your application when building a chunk dictionary for your extracted application dictionary, using either the Auto-Chunk or Create Chunk Dictionary utilities. When the chunk dictionary installs, or “unchunks” in the same location as the Microsoft Dynamics GP dictionary, it automatically runs the installation script you’ve indicated.
Installation scripts are rarely used for integrations with recent versions of Microsoft Dynamics GP.
You write an installation script just like an ordinary procedure. However, it’s important to keep in mind when the installation script actually runs. The installation script is run only one time when the chunk dictionary is installed. It is never run again.
You cannot check values of any Microsoft Dynamics GP global variables using an installation script. Microsoft Dynamics GP sets the values of global variables after your installation script runs.
The installation script runs before any user has logged into the system. This is as issue for SQL Server, because a user must be logged in before any table operations can be performed. To avoid the SQL Login window being displayed during installation, any operations that access tables must be delayed until the user has logged into the system. Typically this is done using a procedure trigger for the Add_Successful_Login_Record procedure in Microsoft Dynamics GP. The following example shows the registration for this trigger.
l_result = Trigger_RegisterProcedure(script Add_Successful_Login_Record, TRIGGER_AFTER_ORIGINAL, script IG_Setup_SQL_Tables);