MoveFile ()

From ISXKB

Jump to: navigation, search

This article shows how to use the Windows API function MoveFile with Inno Setup.

Contents

Declaration

The following declaration is required in a [Code] section:

function MoveFile (lpExistingFileName, lpNewFileName: PChar): BOOL;
 external 'MoveFileA@kernel32.dll stdcall';

Remarks

Inno Setup's built-in function RenameFile () can be used instead of MoveFile. This is how it is declared already:

function RenameFile (const OldName, NewName: string): Boolean;

MoveFile () at MSDN

Example code

   If MoveFile (PChar(SourceFileName), PChar(DestFileName)) then
    begin
    end;
Personal tools
Ads: