Share via


User Selected Installation Location (SP Only)

Smartphone allows a user to choose the installation location during a typical application installation. By default, an application may be placed in the main storage memory or in secondary storage, such as a MultiMedia card. The user can then choose the location that has adequate free space.

Therefore, applications should be written with this freedom in mind; the application's installation directory can change at installation time based on the user's preference.

The user is prompted for the preferred installation location only if the following two conditions are met:

  • The application developer has created an %installdir% variable in the [CEStrings] section of the .inf file. For details, see the previous example.
  • The device has more than one storage volume available (such as a secondary MultiMedia card storage).

To enable user selected installation location prompting

  1. Specify the %installdir% variable in the [CEStrings] section of the .inf file. This variable can contain other variables, such as %CE1% for the Program Files directory.

  2. Use the %installdir% variable to specify the default destination for a CopyFiles section.

  3. Optionally, use the %installdir% variable on an individual FileCopy operation.

  4. The %installdir% variable is also replaced in the value element in registry keys during an application installation. Specify these keys in an AddReg section of the .inf file.

    Note   Additional information about .inf variables is available on MSDN®.

To disable user-selected installation location prompting

Do not specify an %installdir% variable in the [CEStrings] section of the .inf file. If this variable is not found, the device will not prompt the user.

After the .inf file has been processed by CABWizSP and the .cab file has been successfully sent to the device, application installation begins. If the two conditions mentioned previously are met, the user is prompted to select the installation location.

The user is prompted to select only the file volume, not a folder location. The prompting message lists all available storage locations on the system and each storage volume's available free space.

The fact that the user does not select a file location also means that only the storage volume information is replaced on the user selected installation location. For example, if the %installdir% variable is set to \MyApp in the .inf file and the user selects a MultiMedia card named MyStorageCard4, the installation location will be \MyStorageCard4\MyApp. This concept also applies to %CE% variables; if %installdir% is set to %CE1%\MyApp and the user selects the storage card as they did previously, the resulting location will be \MyStorageCard4\Program Files\MyApp.

See Also

.inf File Example (SP Only) |

Last updated on Friday, April 22, 2005

© 2005 Microsoft Corporation. All rights reserved.

Send feedback on this topic to the authors.