大网数据广告活动
安装更新与部署

Searching All Fixed Drives for a File

· 52CE 我爱测

During a Windows Installer installation, the installer can search all fixed drives for a file.

To search all fixed drives for a file

  1. Enter the file signature and name in the Signature Table. The remaining fields in this record can be null to search for any version of MyApp.exe.

    Signature Table (partial)

    Signature File Name
    AppFile MyApp.exe

  2. Enter the property that the Installer is to set if MyApp.exe is installed.

    AppSearch Table

    Property Signature
    MYAPP AppFile

  3. Use the DrLocator Table. Leave the Parent and Path fields empty to search all fixed drives of the user system. Specify in the Depth column the number of subdirectory levels to search. For example, setting Depth to 0 detects c:\MyApp.exe, but does not detect the file at a depth of 2, for example: c:\Program Files\MyApps\MyApp.exe.

    DrLocator Table

    Signature Parent Path Depth
    AppFile 3

  4. Include the AppSearch action in the action sequence. If MyApp.exe is installed, the Installer sets the property MYAPP to the location of the file. If the file is installed, MYAPP evaluates as True in a conditional expression.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。