ALLUSERS Sample Project
The value of the new ALLUSERS system variable determines the following:
the root key that is selected when RegDBSetDefaultRoot(HKEY_USER_SELECTABLE) is called
the root key under which the application uninstallation key is created
the value of the DISK1TARGET system variable (which specifies the path to the folder in which copies of certain of the setupís files are placed to enable maintenance setups and uninstallation)
the default value of the TARGETDIR system variable that is set by the default OnFirstUIBefore code
whether a shortcut that is defined in the IDE with its Type property set to Automatic appears in the list of personal shortcuts or common shortcuts when the shortcut is created
the default option button selection in the SdCustomerInformation and SdCustomerInformationEx dialog boxes
The first time the setup is run, ALLUSERS is automatically initialized to FALSE if the target operating system is Windows NT 4, 2000, or XP and the user is not an administrator or power user, or to TRUE otherwise. If ALLUSERS is initialized to FALSE, assigning it a value in the script has no effect; otherwise, setting ALLUSERS to TRUE calls ProgDefGroupType(COMMON) and setting ALLUSERS to FALSE calls ProgDefGroupType(PERSONAL). (The reverse is not true, that is, calling ProgDefGroupType has no effect on the value of ALLUSERS.)
If the setup is run again from the source media, ALLUSERS is automatically initialized as follows: if the registry key HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionUninstall<INSTANCE_GUID> exists, ALLUSERS is initialized to FALSE; otherwise it is initialized to TRUE. If the setup is run from the Add/Remove Programs dialog box, ALLUSERS is automatically initialized to the value of the AllUsers keyname that the setup created in Setup.ini (in the DISK1TARGET folder) when it first ran.
In the ALLUSERS Sample Project, two shortcuts are to be installed - one is defined under Shell Objects in the Resources window of the IDE, the other is created by a script routine. The shortcut defined in the Resources window is under Shell Objects/Start Menu/Programs/Sample Folder. This 'Sample Shortcut' shortcut has its Type property set to Automatic, which means that it will be installed to a common folder if ALLUSERS is TRUE, or to a personal folder if ALLUSERS is FALSE.
In this sample project's script, beginning on line 32 of the ComponentEvents.rul file, a shortcut is being created using the AddFolderIcon( ) InstallShield function. Note that there is no need to script a call to ProgDefGroupType( ) in this example, because if the InstallShield variable ALLUSERS is TRUE, then this shortcut will automatically be installed to a Common program group via an internal call to ProgDefGroupType( COMMON ). If ALLUSERS is FALSE, then this shortcut will automatically be installed to a Personal program group via an internal call to ProgDefGroupType( PERSONAL ).
In this sample, we also create two registry key values - one is defined under Registry Sets in the Resources window of the IDE, the other is created by a script routine. The key value defined in the Resources Window is contained in the registry set named 'Sample Registry Set.' Since this key is defined under HKEY_USER_SELECTABLE, it will be created under HKEY_LOCAL_MACHINE if ALLUSERS is TRUE, or under HKEY_CURRENT_USER if ALLUSERS is FALSE.
In this sample project's script, beginning on line 14 of the ComponentEvents.rul file, a registry key value is being created using the RegDBSetKeyValueEx( ) InstallShield function. RegDBSetDefaultRoot( ) is called to set the root key to the current value of the new InstallShield predefined constant HKEY_USER_SELECTABLE. The value of HKEY_USER_SELECTABLE is then automatically set at runtime to HKEY_LOCAL_MACHINE if ALLUSERS is TRUE, or to HKEY_CURRENT_USER is ALLUSERS if FALSE.
An event-based script automatically calls
functions that create the primary setup-related registry keys: the application
information key and the application uninstallation. In this case, there is no need to create the
keys in a registry set; doing so will yield undesired results.
Windows NT 4.0 does not allow the creation of a key directly under HKEY_LOCAL_MACHINE or HKEY_USERS.
Politica de confidentialitate|
Adauga cod HTML in site