InstallScript: How to use Kernel32 MoveFile
MoveFile Kernel32 API function moves an existing file or a directory, including its children.Below shows an example code how to use it in InstallScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ifx.h" | |
prototype Kernel32.OutputDebugString(wstring); | |
prototype NUMBER Kernel32.MoveFileW(wstring, wstring); | |
prototype NUMBER Kernel32.GetLastError(); | |
function OnBegin() | |
NUMBER nReturn, nError; | |
STRING sError; | |
begin | |
OutputDebugString("OnBegin..start"); | |
nReturn = Kernel32.MoveFileW("D:\\tmp\\srcdir","D:\\tmp\\dstdir"); | |
nError = Err.LastDllError; | |
if( 0 == nReturn) then | |
NumToStr(sError, nError); | |
OutputDebugString("Bad move:" + sError); | |
endif; | |
OutputDebugString("OnBegin..end"); | |
end; |
No comments:
Post a Comment