Open theme with navigation
The CopyFile function creates a copy associated with the file specified by szSrcFile. The new file is given the name or company name specified in szTargetFile. You must specify a filename because you often need to copy the target location into the szTargetFile parameter created by this function in order for the function to work.
If customers use this feature to transfer money to WINSYSDIR64 files, they must first disable file system redirection using WOW64FSREDIRECTION. Otherwise, files uploaded to WINSYSDIR64 will be incorrectly redirected to each of our 32-bit SysWOW64 folders. Since some Windows processes that may be used by your installation and require redirection are allowed to run, the Windows documentation recommends disabling redirection only for the time it takes to do so. It makes sense to enable file redirection once you have completed transferring the necessary files using WINSYSDIR64. For more information, see Targeting 64-bit Operating Systems Using Installer.InstallScript tags.
Hint. In any case, it is highly recommended to disable the cancel button by disabling the results before calling the CopyFile function. A status dialog box may appear during copying. If you do Steps To Fix A Broken Installshield Copy File disable the cancel button and the end user cancels the operation on the message file, the OnCancelling event handler will not be called. Instead, the free file operation throws an error, which your script should handle by raising the appropriate event and then also restarting the file copy task. You can activate and deactivate the main Cancel button using the Activate and optionally Deactivate functions.
Note: madcap:autonum=”Note. For transferring files, XCopyFile is a powerful alternative to CopyFile. XCopyFile can perform version checking, mark locked .dll and .exe files for update after installation and reboot, increase registry reference paths for shared .dll and .exe data. You can also use XCopyFile to make sure you include subdirectories.
If you don’t know how toName files and set up detections for SRCDIR and TARGETDIR by simply using CopyFile, store the current values using VarSave before calling CopyFile, and then restore them with VarRestore.
You cannot group files using wildcards with CopyFile. However, you can rename an unmarried file with CopyFile.