Previous Section
 < Day Day Up > 
Next Section


Creating Installation Scripts

To begin the process of creating an installation script, start SMS Installer to launch the Installation Expert interface, as shown in Figure 14.7.

Click To expand
Figure 14.7: The Installation Expert interface.

We’ll begin the process of creating an SMS Installer–generated executable by running the Repackage Installation Wizard. In this example we’ll create the Microsoft TechNet installation executable.

To create the installation executable, follow these steps:

  1. In the Installation Expert interface, click Repackage to launch the Repackage Installation Wizard, shown in Figure 14.8.

    Click To expand
    Figure 14.8: The Repackage Installation Wizard page.

  2. On the Repackage Installation Wizard page, you configure the name and path of the setup program used by the application for installation. You might also need to add any other command-line arguments that the setup program might need.

  3. In the Directory list, configure any directories you want to be included in the list of directories to be scanned during the installation process. To add a drive or directory, click Change to open the Repackage Advanced Settings dialog box, shown in Figure 14.9.

    Click To expand
    Figure 14.9: The Repackage Advanced Settings dialog box.

  4. In the Directories To Scan section of the Files/Directories tab, click Add to display the Select Directory dialog box, shown in Figure 14.10.

    Click To expand
    Figure 14.10: The Select Directory dialog box.

  5. In the Select Directory dialog box, we can select the root directory or we can select only the specific subdirectories we want to scan. Narrowing the scan can save significant time during the repackaging process. As a general rule, you don’t want to scan every directory if you know some directories won’t be affected during the installation.

  6. When you have added all the directories you want to scan, click OK. The directories are added to the Directory list.

  7. Next, we’ll configure the directories and files we want to ignore during the scan process. Again, being selective here can improve the performance of the installation process. In the Files To Ignore section of the Files/Directories tab, click Add to display the Open dialog box, as shown in Figure 14.11.

    Click To expand
    Figure 14.11: The Open dialog box.

  8. For this example, the C:\junk directory won’t contain any files pertaining to our installation of Microsoft TechNet, so we can ignore this entire directory. Select the C:\junk directory by double-clicking on it, and then enter *.* in the File Name text box to include all files in this directory. If you wanted to exclude a specific file in a folder, select that file.

  9. Click Open to add the directory, or files, to the File Name list, as shown in Figure 14.12.

    Click To expand
    Figure 14.12: The modified File Name list.

  10. You can also specify whether to ignore scanning of any temporary files during the installation process. To scan temporary files, select the Scan Temp Files check box.

  11. To specify the registry keys and values to scan or ignore during the installation process, select the Registry Keys tab, shown in Figure 14.13.

    Click To expand
    Figure 14.13: The Registry Keys tab.

    Caution 

    Selecting registry keys to scan or ignore can be a tricky business. Be especially careful not to overlook or choose to ignore a key that’s altered during the setup process—doing so would invariably render your installation script worthless. On the other hand, the installation can change something such as a DHCP address setting by releasing and renewing an IP setting during a system restart, which is unrelated to the installation itself and shouldn’t be included in the installation script. Your best bet is to get to know the keys that your installation will affect and once you have created the final script, test, test, test!

  12. The Registry Keys tab contains four panes. The top two panes represent the current registry settings read from the reference computer. The lower two panes represent the registry settings that are to be ignored. In the top-left pane, under My Computer, select the registry trees or values you want to ignore. To add the registry subtree to the list of subtrees to ignore, click Add Tree. To add a key you want to ignore, select the key in the upper-right pane, and then click Add Value. The lower-left pane shows where the selected keys are located on the reference computer; the lower-right pane lists their values. Select Scan All Selected Registry Keys to scan for hardware registry entries to ignore. Select Convert Registry To Other Script Items to convert ODBC changes and installation of services to the Install ODBC Driver, Configure ODBC Data Source, and Create Service script items.

  13. Click OK to return to the Repackage Installation page, and then click Next to begin the scanning and installation process of our application, as shown in Figure 14.14.

    Click To expand
    Figure 14.14: The Repackage Installation page showing the scanning process.

    During the installation phase, the Repackage Installation Wizard will run Setup.exe with any switches you provided in the initial configuration of the wizard The setup will run exactly as it normally does. Remember that you’re providing the installation options that will be used during the actual setup of the application on the target computers.

  14. After the Repackage Installation Wizard has completed the setup of the application, click Next to rescan the directories and registry settings, as shown in Figure 14.15. The wizard will compare the system image before and after the installation of the software.

    Note 

    You might also want to add application setups during this repackaging process—for example, you might want to distribute several applications within one silent installation process. To accomplish this, click Run Setup to run the next setup and add the additional software. Keep in mind the size of these packages as we begin to install larger, more complex applications or multiple applications in a single SMS Installer–generated executable.

    Click To expand
    Figure 14.15: The Repackage Installation page showing the rescanning process.

  15. When the rescan of the directories and registry keys is complete, click Finish to complete the repackaging process.

At this point, clicking Compile in the Installation Expert interface will generate a basic script that, while perhaps not very elegant, might certainly be adequate for distribution. You could use the Installation Expert to verify the installation configuration that was created during the repackaging process and then modify and customize the script to meet the particular needs of your users and organization.

Caution 

If the setup routine for the application you’re repackaging requires a system restart, SMS Installer won’t automatically restart the repackaging process. You’ll need to restart SMS Installer and the repackaging process and then continue repackaging.



Previous Section
 < Day Day Up > 
Next Section