1� � _{
//012 3
Win32 Application Setup Issues
Table of Contents
1. Introduction 1
2. Win32 Applications on Windows NT 2
2.1. Windows NT Security 2
2.2. Windows NT Registry 3
2.2.1. Registry Structure 3
2.2.2. Global Application Configuration 5
2.2.3. User Configuration 6
2.3. Program Manager 7
3. Win32 Applications on Windows 3.1 and Windows NT 9
3.1. Using .ini Files on Windows NT and Windows 3.1 10
4. Win32 Setup Tools 12
4.1. Win32s System Setup 12
4.2. Platform Detection 13
Introduction
Setup programs have the responsibility of installing an application's components and configuring any system parameters. Some setup programs for MS-DOS based applications do no more than copy files to the user's hard disk. More complicated MS-DOS and Windows 3.x based setup programs require modification of both MS-DOS and Windows parameters, such as changing config.sys and win.ini.
The evolution of personal computing has placed new requirements upon application setup programs. Personal computers are being networked and shared between different users. System security and configuration management are extremely important in this multi-user network environment. Portable code is being developed to run on multiple operating systems and hardware platforms. Graphical user interfaces are becoming more popular as they make applications easier to use. These issues directly affect application setup, which must install securely on different platforms, configure the system for the multi-user environment, and provide an intuitive user interface to facilitate the installation process.
Win32 applications may be written for two operating system platforms - Windows NT and Windows 3.1. In addition, Windows NT runs on Intel 386 and 486 based computers as well as RISC platforms such as R4000 ARC-compliant systems and DEC ALPHA based systems. In order to maintain portability, most Win32 code should not depend upon a specific operating system or hardware platform. Setup programs must therefore handle any environmental dependencies before the application is run. For example, a Win32 application may provide both x86 and R4000 binaries in a single package. The setup program must determine which hardware platform it is running and install the appropriate binaries. However, the actual code may have no dependencies on the hardware platform.
This document will outline the requirements and establish conventions for Win32 application setup. Both the Windows NT and the Windows 3.1 operating systems will be discussed. Windows NT offers some features and requirements that directly relate to application setup but are not required for Windows 3.1. This document will address the differences and propose recommendations to ensure compatibility on both operating systems.
Win32 Applications on Windows NT
Windows NT has been designed for the multi-user, network environments. User-level security, networking, and configuration management is built into this operating system. Win32 applications installing on Windows NT must setup securely, be configured for different users, and maintain per-user preferences in this multi-user scenario.
Windows NT Security
Windows NT implements user level security. This implies that every user has a user-id and password. In Windows NT, a user-id corresponds to a security identifier (SID) which is a unique number used to identify the user. This allows for accountability and access restriction. Resources are protected by access control lists (ACLs), which are conceptually a list of SIDs and the corresponding permissions.
Both files and directories are protected through ACLs. Files that are copied into a directory inherit the permissions of the directory by default. New sub-directories also inherit permissions from the parent directory. These permissions may be changed through the File Manager or security APIs. However, applications may be securely installed through a set of conventions without having to use the security APIs or File Manager to modify the ACLs. The applications are securely installed through inherited permissions.
Administrators should be encouraged to install their applications into the \WIN32APP directory. ISVs should provide a default path for their application which is a sub-directory of \WIN32APP. Applications stored in this directory will be accessible by all users of the machine. The \WIN32APP directory has been established with the following permissions:
Everyone - read and execute permission
Administrator - all permissions
These permissions imply that only an administrator may install software into this directory. Since users do not have write permission to this directory, shared applications are protected from one user corrupting, deleting, or replacing an application file with a Trojan horse. Although users may install their own software into their own directory, only administrators should have the permission to install securely software that is shared by different users.
Independent software vendors (ISVs) encouraged to implement this convention as the default path in their setup programs. Their documentation must also communicate the requirement for an administrator to install the software. By installing into this path, applications gain security without having to modify ACLs through the Win32 security APIs. Since security is provided through inherited permissions, Win32 applications may use the same setup code to create directories and install files on both Windows NT and Windows 3.1.
Windows NT Registry
The Windows NT registry is a database for all hardware, software, security, and user configuration data. This data includes all of the information that was previously stored in config.sys, autoexec.bat, win.ini, system.ini, and other configuration files that are found on MS-DOS and Windows 3.1 systems. Conceptually, the registry can be thought of as a set of keys and values arranged in a set of trees - like a file system. A key corresponds to a node in the registry. It may have child keys and associated attributes which are called values. Using the file system analogy, the keys are like directories and the values are like files. Applications may modify the registry through an API. This API is completely remoteable through Remote Procedure Call (RPC) which therefore provides a standard interface to perform remote configuration and administration of a Windows NT workstation. Registry keys are protected by ACLs and new keys inherit the permissions of the parent key.
Applications running on Windows NT do not have to use the registry. The alternative is to use .ini files as in Windows 3.1. However, the Windows NT registry offers benefits that are important to customers - especially for large, corporate environments. The registry can be accessed through APIs and may not be edited like config.sys or win.ini which reduces the chance of user error. Since this API is remoteable through RPC, the registry provides standardized remote management and administration for all aspects of a Windows NT workstation including hardware, software, security, and performance parameters. A Windows NT network can be configured such that user profiles follow the user from station to station. This user profile includes desktop preferences such as colors and bitmap as well as application preferences. Since the user profile is stored in the registry, the application preferences will follow the user in this scenario. Security may be set on a specific key rather than on the entire .ini file which allows system administrators tighter control of the user's environment.
Registry Structure
The registry contains four pre-defined roots which should be viewed as the top nodes of their respective trees (see Figure 1).
� g1% g1% ( @ �� 1 & ���� Z����*
&
���� & $ ���� TNPP Microsoft PowerPoint & TNPP P
&
���� & TNPP ��Z� j41 � ��� � � �� � � � �� ��� ��� ��� ��� ��� ��� � � �� � � � �� ��� 4 5 & ���� ���� & ���� Z����) � ��� - � ��� - � - )���Z�
&
���� & ���� 2�� ��9 ��� � Arial �� - .
2
� l� Security5 - , 1 -
&
���� & ���� ` @�l � ��� - � - � - � l@�` ��� �� Times New Roman - � .
2
���
HKEY_USERSK @ @ : 0 F 5 @ @ 6
&
���� & ���� �; I� ��� � Arial �� - � .
2
� � .Default : , - 0
&
���� & ���� �� (e ��� � Arial W� - � .
2
(�
S-0-1-2-34567 5 , - - - , - , -
&
���� & ���� �S(� ��� � Arial �� - � .
2
��
S-1-2-3-45678 5 , - - - , - , -
&
���� & ���� P��X� - � - � � � � "System - � ����� � - U�P AP - - � '��
&
���� & ���� O��� - - I�O � - �� �E - - � '��
&
���� & ���� O� - - ��q O � - E � - - � '��
&
���� & ���� O� �� - - -���O � - � E � � - - � '��
&
���� & ���� ���r�� � ��� - � - �r���� � � ��� �� Times New Roman Ar - .
! 2
o$� HKEY_CLASSES_ROOT K @ @ : 0 @ ; @ 5 6 @ 5 0 @ F E ;
&
���� & ���� �� ��� & ���� �Hn�� � ��� - � - ��I;����G� � - � - ��I;����G�
&
���� & ���� (�?k�[ � ��� - � - � - �
$ c�G(�?*�S
&
����
&
���� & ���� ` �� � ��� - � - � - � ��` � � ��� �� Times New Roman l - � .
! 2
o� HKEY_CURRENT_USER K @ @ : 0 @ F @ @ @ E ; 0 E 6 @ @
&
���� & ���� J M � & ���� � �� � ��� - � - �� ���A�� � - � - �� ���@��
&
���� & ���� ��� � ��� - � - � - �
$ �����
&
����
&
���� & ���� �EE�� ��� � Arial W� - � .
2
�K� Description : , - , 0 1 1
&
���� & ���� ��@��� � ��� - � - � - � ��@��� � � ��� �� Times New Roman �� - � .
"