Add File Command Option

Command Syntax

/AddFile  <target_folder_path>
          <source_file_path>
          [-overwrite {default|always|no}]
          [-overwrite no -cond <no_overwrite_condition>]
          [-usePathVariable]
          [-digsign {yes|no}]
          [-createNewComponent]
    

Adds a file to the project.

Parameters:

  • <target_folder_path>
  • The target project folder.
  • <source_file_path>
  • The source file's path.
  • [-overwrite default]
  • If the file from the package is newer, it overwrites the one from the target machine at install time. This happens only in case there's a file with the same name in the same location on the target machine. This is the Windows Installer default.
  • [-overwrite always]
  • Always installs the file.
  • [-overwrite no]
  • Prevents overwriting the existing file with the same name from the target machine if there is one in the same install location.
  • [-overwrite no -cond <no_overwrite_condition>]
  • Prevents the existing file to be overwritten if the condition is met.
  • [-usePathVariable]
  • Convert the file to a path variable.
  • [-digsign yes]
  • sets the "Digitally sign the file" flag on true
  • [-digsign no]
  • sets the "Digitally sign the file" flag on false
  • [-createNewComponent]
  • Automatically create a new component for the added file

NoteUsing the standalone -digsign parameter without specifying yes or no will trigger the default behavior: only the EXE files will be signed

NoteThe -overwrite parameter variations can be used only in MSI-based project types.

NoteIf the added file already exists in the project, then its attributes will be updated with the current specified ones.

Example:

AdvancedInstaller.com /edit MyProject.aip
    /AddFile APPDIR C:\File.txt

This installed file will be overwritten with the file from the package only if the condition is false:

AdvancedInstaller.com /edit MyProject.aip
    /AddFile APPDIR C:\File.txt -overwrite no -cond "MY_PROP=1"

For WinCE projects:

AdvancedInstaller.com /edit MyProject.aip
    /AddFile %InstallDir% C:\File.txt