Thursday, September 28, 2023

InstallScript: How to use Kernel32 MoveFile

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
#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;
view raw Setup.RUL hosted with ❤ by GitHub

No comments:

Fedora install screen chronicle

Fedora install screen chronicle Below are links to Fedora installation screens. It is interesting to see how it has evolved over time. Fe...