VirtFsAdd

Top  Previous  Next

int _stdcall

VirtFsAdd(

   IN  PACKAGE_HANDLE               hPkg,

   IN  LPWSTR                       SrcFileName,

   IN  LPWSTR                       DestFileName,

   IN  BOOL                         bVariablizeName )

Adds a file to the virtual application package.

Parameters

hPkg [in]

Virtual application package handle, returned by PackageOpen.

SrcFileName [in]

Name of the physical file to be added to the package. In the form: "C:\SomeFile.ext".

DestFileName [in]

Name of the file as it will appear in the virtual package. In the form: "SomeDir\SomeFile.ext". If bVariablizeName is set to TRUE, the path will be variablized.

bVariablizeName [in]

If set to TRUE, DestFileName will be variablized. For example, "C:\Windows\SomeFile.ext" will be added as "%Windows%\SomeFile.ext".

Return Value

Returns APIRET_SUCCESS if successful, or APIRET_NOT_FOUND if the file was not found.

Remarks

The package containing virtual files will be reconstructed during the next call to PackageSave. The source file must remain accessible at that time.

 

DestFileName should always contain a logical path, containing a drive name.

Good examples: "%Program Files%\MyApp\SomeFile.exe", "C_\MyApp\SomeFile.exe" (or, if bVariablizeName set to false: "C:\Program Files\MyApp\SomeFile.exe", "C:\MyApp\SomeFile.exe").

BAD example: "MyApp\SomeFile.exe".

Remember: the virtual application has to be able to find this file with a full, logical path containing a drive.