DeleteFile Method

InstallShield 2016 » Automation Interface

Project • This information applies to the following project types:

InstallScript
InstallScript Object

Call DeleteFile to delete a file from a specified component subfolder. The files added with this method have static file links, similar to adding files in the IDE.

Syntax

DeleteFile (pFile As ISWiFile) As Long

Parameters

DeleteFile Method Parameters

Parameter

Description

pFile

Pass the file object that you want to delete.

Example

The following Visual Basic example deletes a file from the component subfolder MyCompSubFolder:

    Dim pProj As ISWiProject

    Set pProj = CreateObject("IswiAutoAutomation Interface Version.ISWiProject")

    pProj.OpenProject "C:\MySetups\Project1.ism"

    Dim pFeature As ISWiFeature

    Dim pComponent As ISWiComponent

    Dim pComponentSubFolder As ISWiComponentSubFolder

    Dim pFile As ISWiFile

 

    Set pFeature = pProj.ISWiFeatures.Item("MyFeature")

    Set pComponent = pFeature.ISWiComponents.Item("MyComp")

    Set pComponentSubFolder = pComponent.ISWiComponentSubFolders.Item("MyCompSubFolder")

    Set pFile = pComponentSubFolder.ISWiFiles.Item("MyFile.ext")

    pComponentSubFolder.DeleteFile pFile

 

    pProj.SaveProject

    pProj.CloseProject

Applies To

ISWiComponentSubFolder